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:
secret:
source: key_store
selector: signer_key
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: ${INTROSPECTION_EP_AUTH}
finalizers:
- id: create_jwt
type: jwt
config:
signer:
secret:
source: ${SIGNER_STORE_SOURCE}
This example demonstrates the use of both simple and complex values in environment variables. For instance, SIGNER_STORE_SOURCE is a straightforward string specifying the source of the key to use for signing purposes, whereas INTROSPECTION_EP_AUTH is more intricate, representing the entire authentication structure: { "type": "basic_auth", "config": { "credentials": { "source": "some_source", "selector": "hydra_creds" }}}.