security_config
block in each gateway’s definition.
X-Frame-Options
.X-Content-Type-Options
.X-XSS-Protection
.allowed_hosts
allowed_hosts
list. When allowed_hosts_are_regex
is set to true
, each entry is treated as a regular expression. This allows for flexible definitions like "^.*\\.example\\.com$"
to match any subdomain under example.com
. Requests from hosts not matching any pattern are rejected with a 403 Forbidden
.
Use case: Restrict gateway access to only trusted domains and subdomains.
ssl_redirect
true
, TrustGate issues a 301 Moved Permanently
response, redirecting the client to the secure ssl_host
. This ensures all traffic is encrypted.
In this configuration, it is set to false
, so insecure requests are accepted without redirection.
Use case: Enforce secure connections, especially in production environments without upstream TLS termination.
ssl_proxy_headers
X-Forwarded-Proto: https
.
Use case: Accurately detect HTTPS even when TLS is terminated upstream.
sts_seconds
Strict-Transport-Security
header. A value of 31536000
instructs browsers to remember the rule for one year. Combined with sts_include_subdomains
, this applies the rule to all subdomains as well.
Use case: Harden transport security by eliminating the possibility of protocol downgrade attacks.
frame_deny
X-Frame-Options: DENY
response header, preventing the site from being embedded in an iframe. This mitigates clickjacking attacks, where an attacker tricks users into clicking something different than what they perceive.
If custom_frame_options_value
is provided, it will override the default.
Use case: Prevent other sites from embedding TrustGate responses.
referrer_policy
strict-origin-when-cross-origin
means full referrer information is sent for same-origin requests, but only the origin is sent for cross-origin requests, and nothing is sent from HTTPS to HTTP.
Use case: Minimize sensitive URL exposure in cross-site requests.
content_security_policy
Content-Security-Policy
(CSP) header, which limits the sources of scripts, styles, and other content that can be loaded. For example:
content_type_nosniff
Content-Type
header. It helps prevent situations where a browser might incorrectly interpret the content type, potentially exposing the client to security risks.
Use case: Prevent MIME-type confusion attacks, which can lead to content being executed in unexpected or unsafe ways.
browser_xss_filter
X-XSS-Protection
header with the value:
ssl_redirect
.
sts_seconds
to be at least 1 year (e.g., 31536000
) in production environments for strict transport security.
Content-Security-Policy
and Referrer-Policy
help reduce the browser’s attack surface.
is_development: true
during local development to bypass host and SSL enforcement logic.