Upon startup, heimdall looks for a static configuration file named heimdall.yaml in the following locations:
You can override this default search by using the --config argument, e.g., heimdall --config <path-to-your-config-file>. Supported formats are YAML, or JSON.
The configuration file can leverage environment variables, including both simple and complex values, with access provided through Bash-style syntax. The following expressions are supported:
${var} - Value of $var
${var=default} - If $var is not set, evaluate expression as default
${var:=default} - If $var is not set or is empty, evaluate expression as default
Example 1. Possible minimal fully working configuration
The configuration below specifies a default rule that instructs heimdall to generate a JSON Web Token (JWT) with the sub claim set to anonymous for all GET and POST requests across every URL. This JWT is then included in the Authorization header as a bearer token.
log:
level: info
mechanisms:
authenticators:
- id: anonymous_authenticator
type: anonymous
finalizers:
- id: create_jwt
type: jwt
config:
signer:
key_store:
path: /etc/heimdall/signer.pem
default_rule:
execute:
- authenticator: anonymous_authenticator
- finalizer: create_jwt
Example 2. Configuration with a mechanism defined using environment variables substitution
mechanisms:
authenticators:
- id: hydra_authenticator
type: oauth2_introspection
config:
introspection_endpoint:
url: https://hydra:4445/oauth2/introspect
auth:
type: basic_auth
config: ${INTROSPECTION_EP_CREDENTIALS}
finalizers:
- id: create_jwt
type: jwt
config:
signer:
key_store:
path: ${SIGNER_KEY_STORE_FILE}
This example demonstrates the use of both simple and complex values in environment variables. For instance, SIGNER_KEY_STORE_FILE is a straightforward string specifying the path to a PEM file, whereas INTROSPECTION_EP_CREDENTIALS is more intricate, representing a structure required by the basic_auth authentication type: { "user": "someUser", "password": "VerySecure" }.