Basic configuration
This section guides you through creating the basic configuration Access Decision Service (ADS) requires before deployment.
Operating ADS requires a deployment configuration file called deployment.yaml
that defines essential parameters for ADS to function correctly. See yaml.orgOpens in a new tab for more information about the format.
There are two ways to create the deployment configuration file. You can either write it yourself or utilize the sample configuration files included in the Axiomatics installation package under /docker/resources
. Whichever method you choose, the file must reference a valid domain and a valid license.
The Additional Resources section Deployment configuration samples provides some samples that you can use as a starting point. These samples serve as a customizable template, facilitating your configuration process.
By default, ADS reads the deployment.yaml
file at startup. To update your deployment, you'll need to stop the service, edit the deployment file, and then restart the service.
General guidelines
The following guidelines are some recommendations to ensure the optimal operation of ADS.
File paths
The samples in this section sometimes use file references, such as <path_to_file>
. These should always be interpreted as relative to the environment in which ADS is running.
Environment variables
The samples in this section contain custom values. However, Axiomatics strongly suggests configuring properties in the deployment file using environment variables, particularly for sensitive information such as passwords. Using environment variables ensures that sensitive data is managed and protected through generic mechanisms external to the deployment file.
The following example showcases the syntax used for environment variables:
property: ${<environment variable name\>:-<default value\>}
The deployment configuration sample below, uses the environment variable PORT
for setting the application port:
server:
applicationConnectors:
- type: http
port: ${PORT:-8888}
# If environment variable Port is not defined, then the default port value is `8888`.
## Other names can be used, for example: ${APP_PORT}.
Environment variable PORT with a default value
License
ADS requires a valid license file provided separately by Axiomatics. This license file contains the license key and needs to be in place before ADS starts.
To configure the license section of the deployment configuration file (deployment.yaml
file):
- Obtain the license file from Axiomatics as it's provided separately.
- Open the deployment configuration file and locate the
license
property. - Set the value of the
license
property to the path or URL where the license file is stored.tipUse one of the formats listed in the License file reference section below.
#### Path to license file
license: file:<path_to_file>/axiomatics_PDP.license
License file reference
You can set a file reference using one of the following formats:
Format | Description |
---|---|
dir/axiomatics_PDP.license | Relative path on file system |
/dir/axiomatics_PDP.license | Absolute path on file system |
http://<host:port>/<path_to_file> | URL to the file |
https://<host:port>/<path_to_file> | URL to the file NOTE: There must be a valid certificate present that the JVM trusts. If not, a valid certificate has to be added to the truststore, and the JVM instructed to use it. |
classpath:/axiomatics_PDP.license | File on classpath |
License file reference formats
Compatibility for SLF4J API versions
Starting from ADS version 1.14.0, Dropwizard 3.0.x was introduced, which has a dependency on the slf4j-api
version 2.x. This version is not backward compatible with version 1.7.x, commonly used by various attribute connectors such as Table, LDAP, and SQL, as well as other custom connectors.
To prevent dependency conflicts, it is recommended to place the slf4j-api 2.x
jar file or the ADS jar file at the start of your classpath. This should be done before including any other SLF4J-related jars.
Domain
ADS uses a domain file to evaluate service requests. This domain file contains a set of XACML policies and configurations, along attribute connectors and/or cache settings, essential for the authorization process.
The domain file is deployed by setting a file reference to it in the deployment.yaml
configuration file.
ADS supports authorization domain configuration files expressed in two different formats, YAML and XML. Each format requires its own property for configuration:
For a domain configuration file in YAML format, use the
domain
property.More details about the YAML format can be found at yaml.orgOpens in a new tab.
For a domain configuration file in XML format produced by the Axiomatics Services Manager (ASM) (up to and including version 6.2.12), use the
legacyXmlConfig
property.
The properties are mutually exclusive and only one of them can be enabled at any given time. The sample deployment configuration file, provided in the distribution package, uses the domain property configuration (YAML).
Configure the authorization domain
The instructions below explain how to configure the authorization domain that ADS will use to evaluate requests, based on the format of your domain file.
- YAML
- XML
To configure the domain section of the deployment configuration file using a YAML authorization file:
- Download or acquire from Axiomatics the domain file containing the authorization domain.
- Add the
domain
property in thedeployment.yaml
configuration file. - Set the
domain
property to the domain path or URL where the domain file is stored, using one of the supported formats listed in the next table.
A sample YAML-format domain file is available in the Additional Resources section Authorization decisions domain file. This domain configuration also contains a policy that you can use to run the four example requests against, as described in the section Authorization decisions. It does not contain any attribute connector configurations.
#### Path to domain file
domain: domain.yaml
- Download or acquire from Axiomatics the domain file containing the authorization domain.
- Add the
legacyXmlConfig
property in thedeployment.yaml
configuration file. - Set the
legacyXmlConfig
property to an XML-format authorization domain configuration file.
#### Path to domain file
legacyXmlConfig: <path_to_file>/domain.xml
An XML-format authorization domain configuration file must be produced either by exporting it from Axiomatics Services Manager (up to and including version 6.2.12) via the ASM UI or retrieved programmatically using the Admin API. It is not intended to be edited manually.
See Authorization Domains for more information about domains and how to create authorization domain configuration files.
Domain configuration file reference
For the domain property pointing to the authorization domain configuration file to be used, use one of the supported formats listed in the table:
Format | Description |
---|---|
dir/file.yaml | relative path on file system |
/dir/file.yaml | absolute path on file system |
http://<host:port>/<path_to_file> | URL to the file |
https://<host:port>/<path_to_file> | URL to the file NOTE: There must be a valid certificate present that the JVM trusts. If not, a valid certificate has to be added to the truststore, and the JVM instructed to use it. |
classpath:/file.yaml | file on classpath |
Domain configuration file reference formats
The same retrieval options apply for both YAML- and XML-format files.
Domain management API
You can manage authorization domains from the Axiomatics Services Manager using the domain management API provided with the service. See Domain management APIOpens in a new tab in the ASM documentation for more information.
Retrieve authorization domain from ASM
ADS can be configured to retrieve its authorization domain from ASM.
For more details on how to setup this configuration refer to Configure ADS to retrieve authorization domain from ASM.
Update the domain configuration during runtime
By default, ADS is configured to read the domain configuration only once, when loading the deployment configuration file at start-up.
However, there is an optional property that will make ADS poll the domain configuration source at regular intervals during runtime. See Runtime updating of domain configurations for more information.
Service connectors
In this section, you can configure service connectors for the server to use specific ports and/or encryption to secure communication. You have the option to use either TLS or TLS with client certificates for enhanced security.
In the ADS deployment configuration, the server:
property is key for setting these service connectors, which are crucial for secure and efficient server communication.
The two main types of endpoints used as service connectors are:
Type of endpoint | Property | Default port |
---|---|---|
Application | applicationConnectors | 8080 |
Administration | adminConnectors | 8081 |
For configuring the application and administration service connector endpoints, choose custom ports that best suit the requirements of your specific environment. Axiomatics strongly advises explicitly setting the ports, as this practice significantly facilitates troubleshooting if needed.
The example below showcases a sample service connector configuration with the recommended endpoints:
server:
applicationConnectors:
- type: http
port: 8080
adminConnectors:
- type: http
port: 8081
Sample service connector configuration with default ports
Single port configuration
If your environment restricts the use of dual ports, you can alternatively configure a unified single port for all endpoints, utilizing either HTTP or HTTPS. In this setup, differentiate the endpoints by appending /application
for application services and /admin
for administrative services to the base URL. You can do this simplified setup by specifying the connector type as simple.
To configure the single port setup:
- Locate the
server
property in the deployment configuration file. - Add the
type
andconnector
properties and settype
tosimple
. - Configure the
type
andport
properties underconnector
.
The following example showcases the single port configuration:
server:
type: simple
connector:
type: http
port: 8081
Single port configuration
TLS configuration
You can configure HTTPS connections (type: https
) with TLS encryption for increased security.
The following options are available:
- Basic TLS encryption without client certificate authentication
- TLS encryption with client certificate authentication
Below are two sample configurations, in the deployment file, for each scenario:
- TLS
- TLS with client certificate
Basic TLS example:
server:
applicationConnectors:
## Required to enable TLS
- type: https
port: 8443
keyStorePath: file:<path_to_file>/server.keystore
keyStorePassword: changeit
keyStoreType: pkcs12
TLS with client certificate example:
server:
applicationConnectors:
## Required to enable TLS with client certificate
- type: https
port: 8443
keyStorePath: file:<path_to_file>/server.keystore
keyStorePassword: changeit
keyStoreType: pkcs12
trustStorePath: file:<path_to_file>/server.truststore
trustStorePassword: changeit
trustStoreType: pkcs12
needClientAuth: true
For more detailed information on the TLS options and their respective Keystore and Trustore properties, refer to Additional authentication properties section.
Authentication
In ADS deployment configuration, authentication settings dictate how users or systems are verified before gaining access to services. You can configure authentication using the type
property under the authentication
section of the deployment.yaml
.
ADS supports three authentication methods:
- None
- Basic
- Token
To ensure secure and controlled access within the ADS environment, it is crucial to carefully select and configure the most appropriate authentication method based on your specific security requirements.
- None
- Basic
- Token (JWT)
When type
is set to None
(no user name or password needed for access), then any additional entries (user
or jwt
) in the authentication section, will be ignored.
The example below showcases authentication set to none:
authentication:
type: None
None authentication
To activate Basic authentication set the type
property to Basic
and enter the user property and provide a username along with a SHA-256 hashed password. This method restricts access to a single configured user, ensuring a simple yet secure way to authenticate.
The example below showcases a basic authentication configuration:
authentication:
type: Basic
user:
username: ads-user
hashPassword: <sha-256 hash password>
Basic authentication
Basic authentication grants the authenticated user access to any endpoint on ADS.
For a more secure and flexible option, setting the type
to Token
enables JSON Web Token (JWT) authentication. This method utilizes JSON Web Tokens and includes properties such as jwksUri
for key set location, optional jwksRefreshInterval
for key set update frequency, and audience
, issuer
, and clockSkew
for validating the token's intended audience, issuer, and timing discrepancies, respectively.
The example below showcases a JWT authentication configuration:
authentication:
type: Token
jwt:
jwksUri: "https://localhost/api/.well-known/jwks" # Required ( Only 'file:' or 'https:' URIs are allowed)
jwksRefreshInterval: 60 minutes # Optional
audience: ["ads", "axiomatics"] # Optional
issuer: "axiomatics" # Optional
clockSkew: 30 # Optional
JWT authentication
JWT verification properties
The JWT verification properties section outlines crucial settings for validating JSON Web Tokens (JWT) in a secure manner. These settings include:
Property | Description | Required |
---|---|---|
jwksUri | Specifies the location of the JSON Web Key Set (JWKS) for verifying JWT signatures. Must be a local file with a file: prefix or a secure HTTPS URL with a https: prefix. | Required |
jwksRefreshInterval | Defines the refresh rate for JWKS when using HTTP(S) URIs. It determines how frequently the ADS retrieves JWKS from the location specified in jwksUri . | Optional |
audience | Corresponds to the JWT's aud claim, indicating the intended recipients of the token. This setting is used to verify that the token is intended for the specific audience. | Optional |
issuer | Relates to the JWT's iss claim, identifying the issuer of the token. This setting is used to ensure the token was issued by a trusted source. | Optional |
clockSkew | Allows a configurable time difference between the token issuer's clock and the verifying system's clock when validating the exp and nbf claims. This property accommodates potential clock discrepancies to prevent valid tokens from being incorrectly rejected. | Optional |
Additional notes on JWT verification properties
This section provides further insights and important considerations related to the JWT verification properties, detailing how each setting influences the authentication process and enhances security measures.
jwksUri
Local File: When the
jwksUri
is set to a local file, it must use thefile:
prefix. The content of this file should adhere to the JWKS format. This setup is essential for verifying JWTs with locally stored keys.HTTPS URI: If
jwksUri
points to an HTTPS URI, it must begin withhttps:
. This endpoint is expected to return a JWKS response. Note thathttp
protocol is not supported for security reasons. To use your own keys for JWT verification, they must be converted into the JWKS format. This conversion can be done manually or through a library designed for such tasks.
- jwksRefreshInterval
- This property allows for the customization of the JWKS refresh interval, enabling the system to update the key set in the background. If not explicitly set, it defaults to a 60-minute refresh cycle. This flexibility ensures that the JWKS used for token verification is always up to date.
clockSkew
The
clockSkew
property can take both positive and negative values:Positive Values: Setting
clockSkew
to a positive integer (e.g.,30
) permits a time difference of up to that number of seconds for token validation. This approach accommodates slight discrepancies between the clocks of the token issuer and the verifying system, thereby extending the token's validity window.Negative Values: A negative integer value (e.g.,
-30
) anticipates a scenario where the token issuer's clock is slightly ahead, adjusting the validity period accordingly.Zero Value: A
clockSkew
of0
or unset means no tolerance for time discrepancy; the token'sexp
andnbf
claims are strictly enforced as is.noteIt is recommended to set the
clockSkew
value to an integer that corresponds to a reasonable time window, typically representing a few minutes.
For successful JWT authentication, the claims exp
(expiration time) and sub
(subject) are essential.
Token authentication configuration does not support the use of Soap API.
For more detailed information on JWT claims and their specifications, refer to the official RFC documentationOpens in a new tab.
Authentication and endpoint configuration
ADS handles authentication of the application and administration endpoints differently:
Application Endpoints:
These endpoints require authentication configuration because they handle authorization queries where security is crucial. Ensure that these endpoints are configured to use authentication protocols suitable for your security requirements.
Administration Endpoints:
These endpoints do not require authentication, as they are primarily used for retrieving information for service maintenance, including Kubernetes probes.
noteIn a single port setup, administration endpoints continue to not require authentication, just as in the dual port configuration.
Logging
In ADS deployment configuration, logging settings dictate how ADS displays logs in the console as well as the types of events that are logged.
You can configure log settings using the level
property under the logging
section of the deployment.yaml
.
ADS supports the following logging level
options:
OFF
: No logging at all. This level is used to turn off logging.
ERROR
: Signifies problems that might not halt ADS but are significant issues, such as exceptions that are handled but indicate faulty behaviorINFO
: Provides general operational insights into the application's state, suitable for monitoring runtime behavior and progression without overwhelming detail.WARN
: Provided information for situations that aren't errors but could potentially lead to errors or unexpected behavior in the future.TRACE
: The finest level of logging, showing detailed diagnostic information.DEBUG
: Logs information that is useful for developers debugging issues.FATAL
: A severe error indicating that the system might crash or a critical operation has failed.
In the following sections the WARN
level is used.
Example of logging section in the deployment configuration file:
logging:
level: WARN
#loggers:
# "com.axiomatics.audit": INFO
appenders:
- type: console
target: stdout
timeZone: system
Default logging
The default logging setting consists of the following properties:
Properties | Description |
---|---|
appenders | Specifies how and where log data is recorded, such as to a console, file, or other logging systems. |
├─type | Defines the type of appender (e.g., console, file). |
├─target | Determines the output destination (e.g., standard output, a file path). |
└─timeZone | Defines the time zone used for logging timestamps. For example system uses the system default time zone. |
Enable audit logging
Audit logging in ADS tracks detailed records of policy evaluations and system changes for security, compliance, and troubleshooting purposes. This feature is disabled by default.
The following instructions describe how to enable it:
- Locate the
logging
property in the deployment configuration file and make sure thatlevel
is set toWARN
. - Uncomment both
loggers
andcom.axiomatics.audit
lines underlevel
.
The logging section should look like the following sample:
logging:
level: WARN
loggers:
"com.axiomatics.audit": INFO
appenders:
- type: console
target: stdout
timeZone: system
Audit logging enabled
You can find a more detailed explanation of the audit logging properties in the table below:
Properties | Description |
---|---|
loggers | A collection of logger configurations, each specifying logging levels for different components or packages within the application. |
└─com.axiomatics.audit | Under loggers , specifies the logging level for Axiomatics audit logging. In the example above, INFO sets the minimum level of messages to be logged for auditing purposes. |
Disable audit logging
To disable audit logging, comment out again the loggers
and com.axiomatics.audit
lines in the deployment configuration file.
Enhanced logging options
There are additional logging settings supported by ADS that may be useful in certain environments. These advanced logging configurations are described in more detail in the Additional configuration chapter in section Additional logging properties.
Dropwizard
ADS leverages Dropwizard to facilitate the capturing, formatting, and outputting of log messages.
For more information about Dropwizard logging configuration options, please refer to the logging sectionOpens in a new tab of the Dropwizard documentation.
Furthermore, Dropwizard implements the Logback logging system. Refer to Logback documentationOpens in a new tab, for more information.
Additional configuration
This section described the basic configuration options for ADS as well as some main settings.
You can further customize your ADS environment with additional configuration properties and settings in the deployment.yaml
file.
For these custom and more advanced options see the Additional configuration chapter.
ADS reads the deployment.yaml
file by default only once during startup. Therefore, to apply any changes, you must first stop the service, update your deployment file, and then restart the service.
Disclaimer
Access Decision Service makes use of the Dropwizard framework for its implementation.
There are many configuration options available in Dropwizard. However, only properties explicitly mentioned in the Access Decision Service documentation are supported. Axiomatics assumes no responsibility or liability for the use of other configuration options.
For more information about Dropwizard configuration options, please refer to the Dropwizard documentationOpens in a new tab.
Next steps
- Consider using the ADS caching features to further improve the system's performance. See the Attribute caching section for more information.
- Explore additional configuration options to optimize your ADS implementation. See the section Additional configurations for more information.