This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Advanced Installation and Configuration

Everything you need to install and configure SOARCA

After completing the Getting Started setup for SOARCA, you may find that certain advanced configurations or customizations are necessary to optimize SOARCA for your specific use cases, for example integrating with The Hive. This section provides in-depth guidance on additional steps you can take to enhance, secure, and integrate SOARCA with your infrastructure, ensuring it meets your unique operational needs.

Configuring SOARCA

VariableContentDescription
PORT8080Set the exposed port of SOARCA. Default is 8080.
ENABLE_TLSfalseEnable TLS for secure communication. Default is false.
CERT_FILE"/certs/server.crt"Path to the TLS certificate file. Default is "/certs/server.crt".
CERT_KEY_FILE"/certs/server.key"Path to the TLS certificate key file. Default is "/certs/server.key".
MAX_EXECUTIONS1000The number of historical executions saved, including the current one. Default is 1000.
SOARCA_ALLOWED_ORIGINS*Set allowed origins for cross-origin requests. Default is *.
GIN_MODEreleaseSet the GIN mode. Default is release.
DATABASEfalseSet if you want to run with an external database. Default is false.
MONGODB_URImongodb://localhost:27017Set the MongoDB URI. Default is mongodb://localhost:27017.
DATABASE_NAMEsoarcaSet the MongoDB database name when using Docker. Default is soarca.
DB_USERNAMErootSet the MongoDB database user when using Docker. Default is root.
DB_PASSWORDrootpasswordSet the MongoDB database user password when using Docker. Change this in production! Default is rootpassword.
PLAYBOOK_API_LOG_LEVELtraceSet the log level for the playbook API. Default is trace.
MAX_REPORTERS5Set the maximum number of downstream reporters. Default is 5.
LOG_GLOBAL_LEVELinfoOne of the specified log levels. Default is info.
LOG_MODEdevelopmentSet the logging mode. If production, LOG_GLOBAL_LEVEL is used for all modules. Default is development.
LOG_FILE_PATH""Path to the logfile for all logging. Default is "" (empty string).
LOG_FORMATjsonSet the logging format. Either text or json. Default is json.
ENABLE_FINSfalseEnable FINS in SOARCA. Default is false.
MQTT_BROKERlocalhostThe broker address for SOARCA to connect to for communication with FINS. Default is localhost.
MQTT_PORT1883The port for the MQTT broker. Default is 1883.
HTTP_SKIP_CERT_VALIDATIONfalseSet whether to skip certificate validation for HTTP connections. Default is false.
VALIDATION_SCHEMA_URL""Set a custom validation schema to validate playbooks. Default is "" to use the internal schema. Note: Changing this can heavily impact performance.

Integrations

The Hive

VariableContentDescription
THEHIVE_ACTIVATEfalseEnable integration with The Hive. Default is false.
THEHIVE_API_TOKENyour_tokenSet the API token for The Hive integration.
THEHIVE_API_BASE_URLhttp://your.thehive.instance/api/v1/Set the base URL for The Hive API. Default is "".

Authentication

VariableContentDescription
AUTH_ENABLEDfalseEnable authentication. Default is false.
OIDC_ISSUERhttps://localhost:9443/application/u/test/The OIDC issuer URL.
OIDC_CLIENT_IDSOME_CLIENT_IDSet the OIDC client ID.
OIDC_CLIENT_SECRETSOME_CLIENT_SECRETSet the OIDC client secret.
OIDC_REDIRECT_URLhttp://localhost:8081/auth/soarca_gui/callbackSet the OIDC redirect URL.
COOKIE_SECRET_KEYSOME_COOKIE_SECRETOptional: Secret key for cookies. Generate using openssl rand -base64 32 or `head -c 32 /dev/urandom
OIDC_SKIP_TLS_VERIFYtrueSet whether to skip TLS verification. Default is true.
AUTH_GROUPsoarca_adminSpecify the group users must belong to for authentication against SOARCA.

1 - Setup RBAC for SOARCA

Setup OIDC based Role-Based Access Control (RBAC) for SOARCA

Authentication is disabled by default in SOARCA. This means that when SOARCA is launched with its default configuration and exposed to a network, anyone can interact with it. Since SOARCA requires significant capabilities and access to reconfigure systems, exposing it without authentication poses a security risk. This section outlines how to set up authentication and authorization for SOARCA.

SOARCA leverages our internally developed gauth library as its underlying authentication framework. This library provides convenient Role-Based Access Control (RBAC) middleware, which manages authentication for various endpoints, such as the Playbook API. Based on OpenID Connect (OIDC), the library supports integration with multiple authentication providers.

Currently, for the used gauth library the Authentik authentication provider, an open-source solution that supports a wide range of authentication methods is supported and tested. As such other OIDC-based providers might not be compatible.

Supported OIDC-Based Auth Providers

Enabling RBAC

Enabling RBAC can be done by setting the AUTH_ENABLED: true.

AUTH_ENABLED: true
AUTH_GROUP: "soarca_admin"
OIDC_ISSUER: "https://authentikuri:9443/application/u/test/"
OIDC_CLIENT_SECRET: "SOME_CLIENT_SECRET"
OIDC_CLIENT_ID: "SOME_CLIENT_ID"
OIDC_SKIP_TLS_VERIFY: true

Setting up Authentik with SOARCA

Next, we need to obtain variables such as OIDC_ISSUER etc. This section will describe how we can setup Authentik.

Spinning up Authentik

Instruction and docker-compose on how to bundle SOARCA with Authentik will come!

Making an authentication provider

In Authentik first setup a new provider. This can be done under Applications -> Providers ->Create. For the provider type select the OAuth2/OpenID provider from the various options. An example configuration is given below:

Next, we need to set in the advanced protocol settings the token expiration lifetime needs to be changed to 8 hours.

core

core

Endpoints for the auth provider can also be found here:

core

Making an application

Next, we can create a new application as shown in the picture below. A new application can be added under Applications –> Create Add the earlier made provider to this application.

core

Setting the authentication provider

Next, under providers -> soarca-auth-provider -> edit we can find the following overview:

core

Here we can find the:

  • Client ID: some random stuff
  • Client Secret: some other random stuff
  • Redirect Url: Optional, should be set when using for the SOARCA-GUI explained [here]

core

We only use the Authentik integration for token validation on the SOARCA side. As such, only the OIDC_CLIENT_ID is required here. For the SOARCA-GUI, we would need the OIDC_CLIENT_SECRET.

Set these variables in the environment variables settings, for example:

AUTH_ENABLED: true  
AUTH_GROUP: "soarca_admin"
OIDC_ISSUER: "https://authentikuri/application/o/does-providing-for-soarca/"
OIDC_CLIENT_ID: "WxUcBMGZdI7c0e5oYp6mYdEd64acpXSuWKh8zBH5"
OIDC_SKIP_TLS_VERIFY: true
export AUTH_ENABLED=true
export AUTH_GROUP="soarca_admin"
export OIDC_ISSUER="https://authentikuri:9443/application/o/does-providing-for-soarca/"
export OIDC_CLIENT_ID="WxUcBMGZdI7c0e5oYp6mYdEd64acpXSuWKh8zBH5"
export OIDC_SKIP_TLS_VERIFY=true

Adding SOARCA user group and users

For the current version of SOARCA and the gauth library the access to the API for a given user is dependent on the required set AUTH_GROUP. Users are required to be in the same group as the group that has been set through this variable. Currently, there is not yet control over which group can access a specific API or route grooup. This feature is scheduled for a future version of SOARCA. In the example below, the AUTH_GROUP: soarca_admin is set.

Next, we require to setup a group in Authentik that is called soarca_admin as explained earlier. The to be obtained tokens from Authentik needs to have this group information as this will be checked by the middleware. A group can be created under Directory -> Groups -> New.

Under users normal as as service accounts can be created. We advise for machine-to-machine implementation service accounts, and for normal users (used for example for SOARCA-GUI logins) normal accounts. Now we can make an users and add to the soarca_admin group. Make use under the application that this group is added to the application provider that we have setup earlier, otherwise the grants of token might fail.

core

core

core

Authentication with Bearer

Now that authentication and authorization is enabled, every request requires to have a set Authorization: Bearer <token> header.

POST /trigger/playbook/ HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Authorization: Bearer <token from authentik> 
Content-Length: 2345

{
    "type": "playbook",
    "spec_version": "cacao-2.0",
    "id": "playbook--300270f9-0e64-42c8-93cc-0927edbe3ae7",
    "name": "Example ssh",
    ...
}

The gauth library will validate this bearer token against the setup Authentik provider and grant the user or application access. Replace the token with a working bearer token.

An example curl command is provided below:

curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <replace token>" -d @./example/ssh-playbook.json localhost:8080/trigger/playbook