Application Protection
Access Restriction
Sets up a filter in nevisProxy to block or filter incoming requests based on the source IP of the request.
The pattern can be assigned to applications
or an entire Virtual Host using Additional Settings.
Blocked requests are responded to with HTTP error code 403.
To produce a nice looking error page, ensure that
you have configured an error page for 403 on the Virtual Host
or use the HTTP Error Handling pattern on the same location.
Source IPs accepts individual IPv4 addresses and ranges in the form
192.0.2.1-192.0.2.255. Deferred endpoints are also supported, for example
placeholder://from_1 - placeholder://to_1, and may be mixed with concrete
endpoints. Deferred values remain quoted in the generated Lua and must resolve
to valid IPv4 addresses during deployment; unresolved or invalid values fail
closed. IPv4 CIDR notation remains supported for individual concrete entries.
Listing Type
Indicates if Source IPs should be used as blacklist or whitelist.
blacklist: Access from all configuredSource IPsis denied. All other IPs are allowed.whitelist: Access is allowed only for IPs in theSource IPslist. All other IPs are blocked.
Source IPs
List of client source IPs which shall be allowed. You may include entire range of IPs by separating two IPs with -.
If there is load-balancer in front of nevisProxy please configure it to preserve the client source IP. IPv6 is not supported here.
Examples:
10.0.0.1: specific IP address192.168.0.0-192.168.0.255: range of IP addresses0.0.0.0-255.255.255.255: all IP addresses
Source IP HTTP-Header
Optional setting used to specify HTTP header that contains the users IP. Otherwise, a default environment variable from nevisProxy is used.
Examples:
X-Forwarded-For
Country Database File
IP geolocation database file for country filtering.
Currently only the mmdb format (MaxMind Database) is supported. This is a binary file format.
Country Database URL
IP geolocation database URL for country filtering.
The resource behind the given URL is periodically downloaded and used as an IP geolocation database.
Currently only the mmdb format (MaxMind Database) is supported. This is a binary file format.
Using dbUrl and dbFile together is not supported, only set one of them.
Rules
Defines what action should be taken for a specified country.
Possible actions are:
- allow: Requests are let through
- log: A log entry is made for each request from the specified country
- block: Blocks requests from a country
Default Action
Defines the action taken either when no country rules were matched or the IP of a request does not have an associated country in the database.
Possible actions are:
- allow: Requests are let through
- log: A log entry is made for each request
- block: Blocks requests
Apply only to sub-paths
Set to apply this pattern on some sub-paths only.
Sub-paths must be relative (e.g. not starting with /)
and will be appended to the frontend path(s) of the virtual host (/)
or applications this pattern is assigned to.
Sub-paths ending with / are treated as a prefix,
otherwise an exact filter-mapping will be created.
The following table provides examples to illustrate the behavior:
| Frontend Path | Sub-Path | Effective Filter Mapping |
|---|---|---|
/ | secure/ | /secure/* |
/ | accounts | /accounts |
/ | api/secure/ | /api/secure/* |
/ | api/accounts | /api/accounts |
/app/ | secure/ | /app/secure/* |
/app/ | accounts | /app/accounts |
/app/ | api/secure/ | /app/api/secure/* |
/app/ | api/accounts | /app/api/accounts |
Allow Override
By default, access restriction rules apply to all sub-locations.
For instance, when you assign an Access Restriction pattern to a Virtual Host
all applications on this virtual host will be affected.
To replace the rules defined on a parent location
select enabled on all Access Restriction patterns in the hierarchy.
If disabled is selected anywhere in the hierarchy the rules are
considered additional.
Technical Details:
This feature is implemented using a nevisProxy LuaFilter.
Mapped filters are inherited to sub-locations unless an exclude-url-regex is defined.
By selecting enabled the generator is informed that the mapped filter has the purpose
access restriction. The generator then ensures that an exclude-url-regex entry
is generated when a filter with the same purpose is mapped to a sub-location.
Custom GeoLocation Lookups
The geolocation database contains multiple attributes to its IP-groups.
The attribute(s) that are retrieved by an IP-lookup can be altered using this parameter.
To check what attributes are in your database, use the tool mmdbinspect.
To set a path, separate its elements by slashes (/).
Each lookup entry contains a path as key and an output variable name as value.
This output variable makes the returned entries accessible from LuaFilter with req:getAttribute('output_var').
Examples:
country/names/en➜geolocation: Uses the country's English name and sets thegeolocationrequest attribute.country/iso_code➜countrycode: Uses the country's two letter long code and sets thecountrycoderequest attribute.country/names/en➜geolocation,country/iso_code➜countrycode,continent/code➜continentcodeKeep the default country name but also set the country code and continent code.
By default, the country's English name is used.
Country Database Download Periodicity
The IP geolocation database download periodicity. Only has effect when the database URL is set.
Cookie Customization
Configure whether cookies are to be returned to the caller or stored in the user session.
You may also assign the pattern to multiple applications, and set Shared Protected Cookies
to share cookies between applications.
Note that cookie sharing is supported only for applications using the same session in nevisProxy, that is, applications protected by the same authentication realm.
The default cookie handling differs based on the type of application:
| Type | Behaviour | |---|---|---| | Web Application (with authentication) | Cookies are stored. | | Web Application (public) | Cookies are allowed to passthrough. | | REST API | Cookies are dropped. | | SOAP Service | Cookies are dropped. |
Client Cookies
Cookies listed here will be allowed to pass through.
Use for cookies which should be returned to the caller (e.g. browser).
Regular expressions are supported.
Example:
LANG.*
Shared Protected Cookies
Cookies listed here will be stored in nevisProxy and shared between all applications which have this pattern assigned.
Note that storing cookies requires a user session. Thus, we recommend not using this feature for applications which are supposed to be stateless and public.
Regular expressions are supported.
Note that cookies matching ^Marker_.*$ will never be stored as a
corresponding allow rule is generated to support Session Expiration features of the SAML SP Realm.
Example:
LANG.*
Protected Cookies
Cookies listed here will be stored in nevisProxy.
However, cookies marked as Client Cookies in any Cookie Customization pattern
assigned to the same application will still be allowed to pass through!
Storing cookies requires a user session. Thus, we recommend not using this feature for stateless or public applications!
Incoming cookies with the same name will be blocked.
Regular expressions are supported.
Example:
.*SESSION.*
Cookie Conflict Resolution
When multiple Cookie Customization patterns are used it happen that
a certain cookie is defined as both a Client Cookie and as a Shared Protected Cookie
for the same application.
By default, this conflict is resolved by allowing the cookie to pass-through, treating it as a Client Cookie.
This behavior is usually more robust but less secure as the cookie will be accessible in the browser.
Select protect to threat the cookie as a Shared Protected Cookie instead.
CSRF Protection Settings
Customize CSRF protection for an application, for example, Web Application.
You can assign the pattern to Virtual Host patterns as well,
to configure CSRF protection for all applications on this host.
SameSite Cookie (Experimental)
Set to lax to issue a separate cookie with the SameSite flag set to lax.
In this configuration, links and redirects from other domains are allowed,
while CSRF-prone requests (e.g. POST) should be prevented by the browser.
Set to off to not send an additional cookie.
There are several reasons why this feature may be disabled:
-
Not all browsers support the
SameSiteflag and behave incorrectly by never sending the cookie. Older versions of IE and Windows may be affected. -
The
SameSiteflag breaks SAML use cases when POST binding is used.
SP-initiated authentication does work with NEVIS but all other SAML process (e.g. logout) will fail.
Header-based Check
CSRF protection can be obstructive for some cross-domain use cases (e.g. federation or providing a public REST API).
Allowed Domains
CSRF protection can be obstructive for cross-domain use cases (e.g. federation or providing a public REST API).
Enter domains which should be excluded from header-based CSRF protection.
There is no support for wildcards, pre- or postfix notations (sub-domains must be listed individually).
Example:
www.adnovum.ch
adnovum.ch
Generic Application Settings
Customize the web.xml configuration for an application
using XML constructs as described in the nevisProxy Technical Documentation.
Use as add-on for Web Application, SOAP Service, or REST Service.
The following expressions may be used for all applications:
${name}: sanitized name of the pattern${service.name}: the name of the application${service.id}: the unique ID of the application${host.key}: use asEntryPointIDwhen adding a customIdentityCreationFilter(advanced use case)
For applications with only 1 Frontend Path:
${service.path}: the frontend path of the application, excluding trailing slash/and asterisk*${service.mapping}: theurl-patterncalculated for the frontend path of the application
In case an Authentication Realm is assigned:
${realm.name}: name of the realm (use forStateKey/DelegateSource)${auth.connector}: name of theEsauth4ConnectorServlet(use forAuthenticationServlet)${logrend.renderer}: name of theLoginRendererServlet${logrend.connector}: name of theHttp(s)ConnectorServletfor nevisLogrend (if nevisLogrend is used)
When defining filters it is recommended to set Filter Mappings to automatic.
This way the filters are mapped to all frontend paths of the application.
Filters and Mappings
Configure filters and their mappings using the XML syntax described in the nevisProxy Technical Documentation.
Filters that have the same name as other filters (even those defined by other patterns)
will be combined: the init-param sets will be merged where possible.
Direct contradictions are interpreted as validation failures.
Example 1: Create (or patch) a filter with a fixed name
<filter>
<filter-name>SomeName</filter-name>
<filter-class>ch::nevis::isiweb4::filter::SomeClass</filter-class>
<init-param>
<param-name>...</param-name>
<param-value>...</param-value>
</init-param>
</filter>
Example 2: Create (or patch) a filter using an application-specific name
<filter>
<filter-name>SomeName_${service.name}</filter-name>
<filter-class>ch::nevis::isiweb4::filter::SomeClass</filter-class>
...
</filter>
Example 3: Map a filter to a sub-path of the assigned application(s). This example works for applications which have 1 frontend path only.
<filter-mapping>
<filter-name>SomeFilter</filter-name>
<url-pattern>${service.path}/custom/*</url-pattern>
</filter-mapping>
Example 4: Use multi-value expressions
Multi-value expressions replicate an entire line for each associated value.
Use the expressions *{service.path} and *{service.mapping} to generate filters
which must contain the frontend paths of all assigned applications.
The following snippet is not complete but should illustrate the concept:
<filter>
<filter-name>FormSigning</filter-name>
<filter-class>ch::nevis::isiweb4::filter::validation::EncryptionFilter</filter-class>
<init-param>
<param-name>EntryURL</param-name>
<param-value>
*{service.path}/
</param-value>
</init-param>
...
</filter>
Filter Mappings
Choose between:
manual(default): only thefilter-mappingelements which have been configured viaFilters and Mappingswill be added.automatic: filters configured viaFilters and Mappingswill be mapped to allFrontend Pathsof the application.both: likeautomaticbut additionalfilter-mappingelements are allowed as well.
Filter Phase
When adding filter-mapping elements, a phase must be defined.
The phase defines where the filter-mapping is placed in the web.xml and ensures that filters
are applied in the right order, relative to other phases.
The order within a certain phase is undefined as it must not matter.
The order for requests is START to END and END to START for responses.
This setting applies to all filter-mapping elements.
The filter-mapping elements may be provided via Filters and Servlets,
or created automatically (see Filter Mappings for details).
Choose from the following filter phases:
START: applied as early as possible for requests and as late as possible for responses.BEFORE_SANITATION: applied before filters which validate the request (e.g. Mod Security).SANITATION: used for security. This is the first phase which allows accessing the session for applications protected by a realm.AFTER_SANITATION: your request has passed security checks.BEFORE_AUTHENTICATION: applied just before authentication.AUTHENTICATION: used by the filter which connects to nevisAuth for applications which are protected by anAuthentication Realm.AFTER_AUTHENTICATION: the request has level 1 authentication. Used byAuthorization PolicyforAuthentication Levelstepup.BEFORE_AUTHORIZATION: choose this phase to do preprocessing before authorization.AUTHORIZATION: used byAuthorization PolicyforRequired Rolescheck.AFTER_AUTHORIZATION: used by patterns assigned asApplication Access Tokento applications.END: applied as late as possible for requests and as early as possible for responses.
This setting is ignored when you patch a filter generated by another pattern
(e.g. by adding, overwriting, or removing an init-param element) but do not create any filter-mapping element.
Servlets and Mappings
Configure servlet and/or servlet-mapping elements
using the XML constructs described in the nevisProxy Technical Documentation.
You may add new elements or customize elements provided by other patterns.
- Reference a
servletby settingservlet-name. UseConnector_${service.name}for the servlet which connects to the backend application. - Reference a
servlet-mappingby settingurl-pattern.
In Kubernetes side-by-side deployment a postfix is added to service names.
Use the expression ${service.postfix} connecting to a service deployed against the same inventory.
Example 1: Add or overwrite an init-param:
Enable load-balancing when there are multiple backend servers.
<servlet>
<servlet-name>Connector_${service.name}</servlet-name>
<init-param>
<param-name>LoadBalancing</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
Instruct nevisProxy to a add Content-Type header when missing.
<servlet>
<servlet-name>Connector_${service.name}</servlet-name>
<init-param>
<param-name>ProxyPolicy</param-name>
<param-value>mime-completion</param-value>
</init-param>
</servlet>
Example 2: Remove an init-param (no param-value provided):
<servlet>
<servlet-name>Connector_${service.name}</servlet-name>
<init-param>
<param-name>CookieManager</param-name>
</init-param>
</servlet>
Example 3: Change the servlet-mapping for an application to use a different servlet
by changing servlet-name.
<servlet>
<servlet-name>Connector_Conditional_${service.name}</servlet-name>
<servlet-class>ch::nevis::isiweb4::servlet::mapping::ServletMappingServlet</servlet-class>
...
</servlet>
<servlet-mapping>
<servlet-name>Connector_Conditional_${service.name}</servlet-name>
<url-pattern>${service.path}/*</url-pattern>
</servlet-mapping>
Removing servlet or servlet-mapping elements is not supported.
Template Parameters
Define Template Parameters.
Examples:
backend-host: backend.siven.ch
These parameters can be used in:
Servlets and MappingsFilters and Mappings
The expression formats are:
${param.<name>}:
namefound: parameter value is used.namemissing: expression is not replaced.
${param.<name>:<default value>}:
namefound: parameter value is used.namemissing: default value will be used.
In <default value> the character } must be escaped as \}.
Remove Filter Mappings
Remove <filter-mapping> elements generated by other patterns.
The syntax is a map of <filter-name>:<url-pattern>, according to elements from the web.xml.
In the <filter-name> the expressions ${service.name} and ${realm.name} may be used.
For applications which have only 1 frontend path you may use ${service.mapping} instead of <url-pattern>.
Examples:
ModSecurity_${service.name}:${service.mapping}
Authentication_${realm.name}:${service.mapping}
Generic nevisProxy TLS Settings
Use the add-on to customize TLS/SSL settings for nevisProxy.
Assign to a Virtual Host to customize settings for incoming connections.
You can customize connections to backends by assigning the pattern to your applications
(Web Application, REST Service, SOAP Service) using Additional Settings.
Protocols
The value(s) configured here will be used as SSLProtocol.
Read the Apache Documentation for supported values.
The SSLProtocol can appear in 2 different places, depending on where this pattern is assigned:
- as attribute for the
SSLelement innavajo.xml. - as init-param for the
HttpsConnectorServlet.
If nothing is configured, a default will apply. The default is determined as follows:
-
For the
SSLelement innavajo.xmltheSSLProtocolattribute will be generated as-all +TLSv1.2 +TLSv1.3by theVirtual Hostpattern. -
For the
HttpsConnectorServletnoSSLProtocolinit-param will be generated, and thus the default of this servlet applies. Read the documentation of the HttpsConnectorServlet for further information.
Cipher Suite
Configure the allowed cipher suites.
Read the Apache Documentation for the supported format.
The value configured here will be applied as:
SSLCipherSuitefor theSSLelement innavajo.xmlwhen the pattern is assigned to aVirtual Host.SSLCipherSuitesfor theHttpsConnectorServletelement in theweb.xmlwhen this pattern is assigned to an application.
If nothing is configured, a default will apply. The default is determined as follows:
- For the
SSLCipherSuiteattribute of theSSLelement innavajo.xmla default will be generated by theVirtual Hostpattern. - For
HttpsConnectorServletnothing will be generated, and thus the default of this servlet applies. Read the documentation of the HttpsConnectorServlet for details.
SSL Options
The value configured here will be applied as SSLOptions.
It should only have value when assigned to a Virtual Host pattern.
Check the Apache Documentation for details.
If empty and when this pattern is assigned to a Virtual Host the following value is used:
+OptRenegotiate +StdEnvVars +ExportCertData
Generic Virtual Host Settings
Customize the web.xml configuration
using XML constructs as described in the nevisProxy Technical Documentation.
Use as add-on for the Virtual Host pattern.
The following expressions are supported:
${name}: sanitized name of the pattern${service.name}: the name of the virtual host${service.id}: the unique ID of the virtual host${service.path}: the base path of the virtual host (empty String)${service.mapping}: theurl-patternfor the virtual host/*
Filters and Mappings
Configure filters and their mappings using the XML syntax described in the nevisProxy Technical Documentation.
Filters that have the same name as other filters (even those defined by other patterns)
will be combined: the init-param sets will be merged where possible.
Direct contradictions are interpreted as validation failures.
Example 1: Create (or patch) a filter with a fixed name
<filter>
<filter-name>SomeName</filter-name>
<filter-class>ch::nevis::isiweb4::filter::SomeClass</filter-class>
<init-param>
<param-name>...</param-name>
<param-value>...</param-value>
</init-param>
</filter>
Example 2: Create (or patch) a filter using an application-specific name
<filter>
<filter-name>SomeName_${service.name}</filter-name>
<filter-class>ch::nevis::isiweb4::filter::SomeClass</filter-class>
...
</filter>
Example 3: Map a filter to a sub-path of the assigned application(s). This example works for applications which have 1 frontend path only.
<filter-mapping>
<filter-name>SomeFilter</filter-name>
<url-pattern>${service.path}/custom/*</url-pattern>
</filter-mapping>
Example 4: Use multi-value expressions
Multi-value expressions replicate an entire line for each associated value.
Use the expressions *{service.path} and *{service.mapping} to generate filters
which must contain the frontend paths of all assigned applications.
The following snippet is not complete but should illustrate the concept:
<filter>
<filter-name>FormSigning</filter-name>
<filter-class>ch::nevis::isiweb4::filter::validation::EncryptionFilter</filter-class>
<init-param>
<param-name>EntryURL</param-name>
<param-value>
*{service.path}/
</param-value>
</init-param>
...
</filter>
Filter Mappings
Choose between:
manual(default): only thefilter-mappingelements which have been configured viaFilters and Mappingswill be added.automatic: filters configured viaFilters and Mappingswill be mapped to/*.both: likeautomaticbut additionalfilter-mappingelements are allowed as well.
Filter Phase
When adding filter-mapping elements, a phase must be defined.
The phase defines where the filter-mapping is placed in the web.xml and ensures that filters
are applied in the right order, relative to other phases.
The order within a certain phase is undefined as it must not matter.
The order for requests is START to END and END to START for responses.
This setting applies to all filter-mapping elements.
The filter-mapping elements may be provided via Filters and Servlets,
or created automatically (see Filter Mappings for details).
Choose from the following filter phases:
START: applied as early as possible for requests and as late as possible for responses.BEFORE_SANITATION: applied before filters which validate the request (e.g. Mod Security).SANITATION: used for security. This is the first phase which allows accessing the session for applications protected by a realm.AFTER_SANITATION: your request has passed security checks.BEFORE_AUTHENTICATION: applied just before authentication.AUTHENTICATION: used by the filter which connects to nevisAuth for applications which are protected by anAuthentication Realm.AFTER_AUTHENTICATION: the request has level 1 authentication. Used byAuthorization PolicyforAuthentication Levelstepup.BEFORE_AUTHORIZATION: choose this phase to do preprocessing before authorization.AUTHORIZATION: used byAuthorization PolicyforRequired Rolescheck.AFTER_AUTHORIZATION: used by patterns assigned asApplication Access Tokento applications.END: applied as late as possible for requests and as early as possible for responses.
This setting is ignored when you patch a filter generated by another pattern
(e.g. by adding, overwriting, or removing an init-param element) but do not create any filter-mapping element.
Servlets and Mappings
Configure servlet and/or servlet-mapping elements
using the XML constructs described in the nevisProxy Technical Documentation.
You can also customize elements which have been generated by other patterns. Elements can be referenced as follows:
servlet:servlet-nameservlet-mapping:url-pattern
In Kubernetes side-by-side deployment a postfix is added to service names.
Use the expression ${service.postfix} connecting to a service deployed against the same inventory.
Example 1: Add or overwrite an init-param for an existing servlet:
<servlet>
<servlet-name>Hosting_Default</servlet-name>
<init-param>
<param-name>NoMatchFile</param-name>
<param-value>/index.html</param-value>
</init-param>
</servlet>
Example 2: Remove a servlet-mapping:
<servlet-mapping>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
Here we left out the servlet-name to tell the pattern to remove the servlet-mapping for the given url-pattern.
Note that the mapping of the hosted resources is an exception and cannot be removed this way
(see the property Hosted resources of the Virtual Host pattern for more information).
Removing a servlet element is not supported.
Template Parameters
Define Template Parameters.
Examples:
backend-host: backend.siven.ch
These parameters can be used in:
Servlets and MappingsFilters and Mappings
The expression formats are:
${param.<name>}:
namefound: parameter value is used.namemissing: expression is not replaced.
${param.<name>:<default value>}:
namefound: parameter value is used.namemissing: default value will be used.
In <default value> the character } must be escaped as \}.
Remove Filter Mappings
Remove <filter-mapping> elements generated by other patterns.
This is an advanced configuration.
Use only when you want to remove a <filter-mapping> but keep the <filter> element,
e.g. to map it on a sub-location.
The syntax is a map of <filter-name>:<url-pattern>, according to values from the web.xml.
For instance, the following would remove the ErrorHandler_Default from /*:
ErrorHandler_Default:/*
Mime-Mappings
Set or replace mime-mapping elements.
Examples:
<mime-mapping>
<extension>svg</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
The mime-mapping elements affect the entire Virtual Host
and are used use to determine the Content-Type for responses.
nevisProxy always sets a Content-Type header
for static resources served by the Virtual Host.
Further, nevisProxy can add a Content-Type header for resources served by applications.
To enable this advanced feature assign Generic Application Settings to the application
and set the parameter ProxyPolicy to mime-completion.
Geolocation Service
This pattern sets up a service that responds with the geolocation of the caller, based on the callers source IP.
The response is a JSON with the following format:
{
"query":"<IP>"
"status":"success|fail"
"continentCode":"<ISO continent code>"
"countryCode":"<ISO country code>"
"licence":"https://www.maxmind.com/en/geolite2/eula"
}
The pattern requires that nevisProxy is able to correctly determine the source IP for the incoming request.
If a component in front of nevisProxy terminates TLS connections (e.g. a load balancer, ingress, Cloudflare),
then you have to configure a Source IP Header in the Virtual Host pattern.
Virtual Host(s)
Assign a Virtual Host which shall serve as entry point.
Frontend Path
The path on which the service shall be accessible.
Geolocation Database
Upload a Maxmind database file.
For further information, see the documentation in the nevisProxy reference guide.
Authentication Realm
Optionally assign a realm to protect this application or service.
Additional Settings
Assign add-on patterns to customize the behavior of this service.
Example use cases:
Authorization Policyto enforce roles or an authentication level.URL Handlingto redirect or forward requests.HTTP Header Customizationto add, replace, or remove HTTP headers in requests or responses.
gRPC Service
Set up access to a backend application providing a gRPC API.
Virtual Host(s)
Assign Virtual Host patterns which shall serve as entry point for this application. HTTP/2 has to be enabled on each Virtual Host.
Frontend Path(s)
The (base) path of the application.
Examples:
/app/- defines a base path.
Any requests which have a path component starting with /app/ will be sent to this application.
/- forward all requests to this application.
Use this only when there are no other applications or hosted resources.
exact:/app.html- matches requests to/app.htmlonly (query parameters are allowed).
Use this for single-page applications which do not require any additional resources.
Note that if the frontend path is different from the path used within Backend Addresses
then URL rewriting will be configured to correctly route
requests and responses between clients and backends.
Authentication Realm
Optionally assign a realm to protect this application or service.
Application Access Token
Propagate a token to the backend application. The token informs the application about the authenticated user.
For instance, assign Nevis SecToken if the application uses Ninja or
SAML Token for applications which are able to consume SAML Responses.
Additional Settings
Assign add-on patterns to customize the behavior of this service.
Example use cases:
Authorization Policyto enforce roles or an authentication level.URL Handlingto redirect or forward requests.HTTP Header Customizationto add, replace, or remove HTTP headers in requests or responses.
Backend Addresses
Enter the complete URL (scheme, host, port and path) of the gRPC service.
Note:
- Only one backend is allowed.
- Automatic path rewriting will be performed when the path differs from the
Frontend Path.
Key Store
Optional setting to use a client certificate for connecting to HTTPS backends.
Trust Store
Optional setting for enabling trust to HTTPS backends.
For securing production environments:
- set
Backend Addressesstarting withhttps:// - assign a
Trust Storepattern containing the certificates required for verifying the backend certificate - set
Hostname Validationtoenabled
Hostname Validation
Enable to verify that the hostname on the certificate presented by the backend matches the hostname configured in Backend Addresses
Host Header
Defines the Host header for requests forwarded to the application.
When backend is selected then nevisProxy uses the host part of the backend address that has been selected.
This is the default behavior and similar to what a browser would do.
Therefore, this configuration should work in most cases.
When client is selected then nevisProxy will keep the Host header as received from the client.
The following init-param will be generated:
<init-param>
<param-name>HostName</param-name>
<param-value>ENV:HTTP_Host;</param-value>
</init-param>
The configuration is dynamic to support virtual hosts with multiple frontend addresses.
Note that this may be less secure.
Even though browsers do not allow this clients may sent an arbitrary value for the Host header.
It is therefore recommended to test how your application behaves in this case.
Outbound Client Authentication
Controls whether the service access presents a client certificate on outbound TLS connections.
automatic follows the referenced target's server-side client-authentication setting. required ensures that client authentication is used, preserving an explicitly configured key store and generating an implicit identity only when no key store is configured. disabled prevents client authentication and is rejected when the referenced target requires it.
Allowed HTTP Methods
Define the HTTP methods allowed for this application.
Methods which are listed here must also be allowed on the Virtual Host.
The only valid HTTP method used in gRPC over HTTP/2 is POST.
Note: While gRPC itself only uses POST, higher-level frameworks like Cloud Endpoints support HTTP/JSON transcoding, which can map HTTP GET, POST, PUT, and DELETE methods to gRPC methods using annotations (e.g., option (google.api.http) = { get: "/v1/shelves/{shelf}" };).
Custom Parameters
Add custom init-param(s) for the Http2Servlet. For example: ConnectionPoolSize=200
Please check the nevisProxy technical documentation for supported init-params of the servlet class ch::nevis::nevisproxy::servlet::connector::http::Http2Servlet.
Hosting Service
Use the pattern to host static pages and related resources.
For instance, you can use this pattern to host HTML or a single-page application (SPA).
Further, you can provide CSS, images, and Javascript for error pages uploaded by a HTTP Error Handling pattern.
The pattern generates configuration for the nevisProxy ch::nevis::nevisproxy::servlet::file::FileReaderServlet.
Virtual Host(s)
Assign a Virtual Host which shall serve as entry point.
Frontend Path
The path at which the resources shall be accessible at the frontend.
You may use / to deploy root content.
Resources
Upload your resources here.
All files will be deployed in the same directory. Please use standard extensions (e.g. .css, .png, .html, .htm) only.
If you want to use subdirectories please upload a .zip file instead. The content of the .zip file will be unpacked.
Default File
Defines a default file which will be returned when there is no other matching file.
Authentication Realm
Optionally assign a realm to protect this application or service.
Rewrite Rules
Rewrite rules for serving files.
This can be useful if a file should be served under a different name, or to map extensions to file names.
Examples:
| Source | Destination |
|---|---|
/static/picture | /static/picture.jpg |
Additional Settings
Assign add-on patterns to customize the behavior of this service.
Example use cases:
Authorization Policyto enforce roles or an authentication level.URL Handlingto redirect or forward requests.HTTP Header Customizationto add, replace, or remove HTTP headers in requests or responses.
HTTP Error Handling
Use the pattern to handle HTTP error codes.
You can use the pattern as an add-on for Virtual Host
or any backend application, for example, Web Application, REST Service, or SOAP Service.
Error Pages
Upload HTML error pages, JSON error pages and associated resources here.
Pages must be named like the error code they are used for (e.g. 500.html).
You can use the same page for multiple status code (e.g. 401,403,500-599.html).
By default, the error pages are deployed to /errorpages/<name> but
you can set a different location via the property Base Path (see Advanced Settings).
In your error pages we recommend using relative links to include resources.
You may also include resources deployed on the virtual host via Hosted Resources.
The following placeholders are supported:
TRANSFER_IDfor the unique ID of the request (e.g.c0a80e52-5d04-11ac0500-16906714eee-00000003)TIMESTAMPto show a timestamp (e.g.Tue, 19 Feb 2019 15:48:02 GMT)
Blocked Status Codes
Hide certain HTTP status code(s) by returning 200 OK instead (by using the reset-status-code action).
By default, the status code is not changed as it can be useful for technical clients.
The response body will still be replaced.
You may also enter:
- ranges of status codes (e.g.
500-599), - lists (e.g.
403,500) - combination thereof (e.g.
403,500-599).
Redirect Status Code Mapping
Redirect to a given location instead of rewriting the response body.
Locations can be entered as:
- URLs (starting with
http://orhttps://) - paths (starting with
/)
Internal and external locations are supported.
Examples:
404,500-599 -> /some/super/redirect/
403 -> https://www.google.com
Keep Header Status Codes
By default, HTTP headers are dropped when an error code is handled.
This avoids information leakage but can lead to session loss in some cases.
For instance, the nevisProxy session will be lost when all the following holds:
- this pattern is configured to handle code
502. - the application is unreachable (
502is produced). - the nevisProxy session cookie is renegotiated (
Set-Cookieheader is set). - user refreshes the page after the error page is shown.
To overcome this limitation you may enter 502 here.
Note that we are investigating additional measures and may adapt this property in future releases.
Overwrite Status Codes
Overwrite certain HTTP status code(s) by returning with the defined status code instead.
If for an error code both Blocked Status Code and Overwrite Status Code is configured, the Blocked Status Code will take precedent.
Examples:
404,406-499 -> 401
405 -> 200
Mode
Enable or disable the error handling.
When set to disabled, all settings except Apply only to sub-paths are ignored.
Use this setting in combination with Apply only to sub-paths to disable the error handling for some sub-paths only.
Usage examples (valid for Virtual Hosts and backend applications):
- Disable the error handling:
use an Error Handler pattern with Mode set to disabled and link it to the target pattern via Additional Settings;
- Disable the error handling for some sub-paths:
use an Error Handler pattern with Mode set to disabled and Apply only to sub-paths set to the paths where no error handling should occur, and link it to the target pattern via Additional Settings;
- Define a customised error handling and disable it for some sub-paths:
use two Error Handler patterns, one with the custom settings, and one with Mode set to disabled and Apply only to sub-paths set to the paths where no error handling should occur. Link both of them to the target pattern via Additional Settings.
Apply only to sub-paths
Set to apply the error handling on some sub-paths only.
Sub-paths must be relative (e.g. not starting with /)
and will be appended to the frontend path(s) of the virtual host (/)
or applications this pattern is assigned to.
Sub-paths ending with / are treated as a prefix,
otherwise an exact filter-mapping will be created.
The following table provides examples to illustrate the behavior:
| Frontend Path | Sub-Path | Effective Filter Mapping |
|---|---|---|
/ | secure/ | /secure/* |
/ | accounts | /accounts |
/ | api/secure/ | /api/secure/* |
/ | api/accounts | /api/accounts |
/app/ | secure/ | /app/secure/* |
/app/ | accounts | /app/accounts |
/app/ | api/secure/ | /app/api/secure/* |
/app/ | api/accounts | /app/api/accounts |
Content-Type Mode
The Content-Type Mode allows enabling or disabling the error handling depending on the Content-Type header of the backend response.
Use this setting in combination with the Content-Types setting.
Choose one of:
None: The error handling settings are applied to all backend responses.Enabled: The error handling settings are enabled only for the backend responses with aContent-Typeheader included in the Content-Types setting.
Backend responses with other Content-Types are propagated to the client.
Disabled: The error handling settings are disabled for the backend responses with aContent-Typeheader included in the Content-Types setting.
These responses are propagated to the client.
The error handling settings are applied to backend responses with other Content-Type headers.
Content-Types
The Content-Types configures the Content-Type headers for which the Content-Type Mode setting is applied.
Enter one value per line.
Use this setting in combination with the Content-Type Mode setting.
Base Path
By default, the error pages are deployed to /errorpages/<name> but you can set a different location here.
Keep Security Headers
Configure the name of special response headers which should be kept, regardless of the header action of the matching rule. Useful for keeping the security response headers for the error pages.
Default:
Strict-Transport-Security
X-Content-Type-Options
Referrer-Policy
HTTP Header Customization
Use to add, overwrite, or remove HTTP headers in requests or responses.
You can use the pattern as add-on for Virtual Host or applications,
for example, Web Application, REST Service, or SOAP Service.
The following expressions may be used:
${client.ip}- IP address of the caller${request.id}- unique ID of this request${request.header.<name>}- value of a request header (only for requests)${env.<name>}- ApacheENVvariables${auth.<name>}- access to theAUTHscope (only for requests, requires anAuthentication Realmand theFilter Phaseis to be set toAFTER_AUTHENTICATIONorEND)
Add / Overwrite Headers
Adds/overwrites HTTP headers in requests.
The syntax is: <header name>:<value>
Examples:
X-Forwarded-For: ${client.ip}
User-ID: ${auth.user.auth.UserId}
Note: change the Filter Phase to replace headers early / late.
In order to use the ${exec: ...} syntax of nevisProxy for passwords,
use an inventory secret to skip the validation of the value.
Basic Auth User
Enter the basic auth user or an expression of the format <source>:<parameter>.
For the <source> you may use:
AUTH: outargs returned by nevisAuth.CONST: constant strings.ENV: Apache environment variables.PARAM: values from a request body as provided by aParameterFilter.HEADER: request headers.
Basic Auth Password
Enter the basic auth password or an expression of the format <source>:<parameter>.
For the <source> you may use:
AUTH: outargs returned by nevisAuth.CONST: constant strings.ENV: Apache environment variables.PARAM: values from a request body as provided by aParameterFilter.HEADER: request headers.
Remove Headers
Removes HTTP headers from requests.
The syntax is: <header name>
Examples:
User-Agent
Note: change the Filter Phase to remove headers early / late.
Filter Phase
START- manipulate request headers early to hide them from validation and authentication.AFTER_AUTHENTICATION- the original values are subject to validation and can be accessed in the authentication flow.
The header manipulation is applied afterwards to affect the application only.
END- manipulate request headers late, just before the request is forwarded to the application.