Authentication and authorization

Secure the SOARCA API with Microsoft Entra ID, authentik or another OIDC provider, and static API keys

Authentication is disabled by default in SOARCA. With the default configuration, anyone who can reach SOARCA over the network can submit and execute playbooks. Because playbooks can reconfigure the systems SOARCA is connected to, enable authentication for every deployment that is reachable by more than a single trusted machine.

With authentication enabled, every API request needs an Authorization: Bearer <credential> header. SOARCA accepts three kinds of credentials, side by side:

CredentialIssued byTypical caller
Entra ID access tokenMicrosoft Entra IDAnalysts with a Microsoft account, Azure workloads, integrations registered in Entra
OIDC access tokenauthentik or another OpenID Connect providerAnalysts and service accounts managed in authentik
API keySOARCA itselfSystems that cannot request an OAuth token, such as webhook sources

You can enable any combination. SOARCA looks at each credential and hands it to the matching provider: a JWT by its issuer (iss claim), an API key by its soarca_ prefix. Tokens from an issuer SOARCA isn’t configured for are rejected.

Permissions

SOARCA grants access through four permissions. Each identity provider maps its own roles or groups onto them; see the provider pages below for the exact names.

PermissionAllows
playbook:readReading playbooks, execution reports and status
playbook:writeCreating, updating and deleting playbooks
playbook:executeTriggering playbooks and answering manual steps
soarca:adminEverything, including key management

Every role that grants playbook:write or playbook:execute also grants playbook:read.

RouteRequired permission
GET /playbook/, GET /playbook/meta/, GET /playbook/:idplaybook:read
POST /playbook/, PUT /playbook/:id, DELETE /playbook/:idplaybook:write
GET /reporter/, GET /reporter/:id, GET /status/, GET /status/pingplaybook:read
POST /trigger/playbook, POST /trigger/playbook/:idplaybook:execute
GET /manual/, GET /manual/:exec_id/:step_id, POST /manual/continueplaybook:execute
/keymanagement/*soarca:admin

A request without a valid credential gets 401 Unauthorized. A valid credential that lacks the permission gets 403 Forbidden. Both use SOARCA’s usual error format:

{
  "status": "403",
  "message": "forbidden: requires playbook:execute",
  "original-call": "POST /trigger/playbook",
  "downstream-call": ""
}

Setting up a provider

Environment variables

Authentication is turned on with AUTH_ENABLED: true. SOARCA then refuses to start unless at least one provider is fully configured.

General

VariableDefaultDescription
AUTH_ENABLEDfalseRequire a valid credential on every API request.

OpenID Connect (authentik)

VariableDefaultDescription
OIDC_ISSUERIssuer URL, exactly as it appears in the tokens’ iss claim, including any trailing slash.
OIDC_CLIENT_IDClient ID of the SOARCA provider. Tokens must carry it as their audience.
OIDC_SKIP_TLS_VERIFYfalseSkip certificate checks towards the provider. Only for test setups with self-signed certificates.
AUTH_GROUPsoarca_adminMembers of this group get every permission.

OIDC_ISSUER and OIDC_CLIENT_ID must be set together.

Microsoft Entra ID

VariableDefaultDescription
AUTH_ENTRA_TENANT_IDSComma-separated tenant IDs whose tokens SOARCA accepts.
AUTH_ENTRA_API_CLIENT_IDApplication (client) ID of the SOARCA API app registration.
AUTH_ENTRA_API_APP_ID_URIApplication ID URI of that registration, e.g. api://soarca. Optional.
AUTH_ENTRA_ALLOWED_CLIENT_IDSComma-separated client IDs of the applications allowed to call SOARCA. Empty allows every application in an allowed tenant.
AUTH_ENTRA_REQUIRED_USER_SCOPEaccess_as_userDelegated scope that user tokens must carry.
AUTH_ENTRA_ACCEPT_V1falseAlso accept v1 tokens (issuer https://sts.windows.net/<tenant>/).
AUTH_ENTRA_AUTHORITYhttps://login.microsoftonline.comLogin host. Change it only for national clouds, e.g. https://login.microsoftonline.us.

AUTH_ENTRA_TENANT_IDS and AUTH_ENTRA_API_CLIENT_ID must be set together.

API keys

VariableDefaultDescription
AUTH_API_KEYS_FILEPath to a JSON file with hashed API keys. Empty disables API keys.

Example

AUTH_ENABLED: true

# authentik
OIDC_ISSUER: "https://authentik.example.com/application/o/soarca/"
OIDC_CLIENT_ID: "soarca"
AUTH_GROUP: "soarca_admin"

# Entra ID
AUTH_ENTRA_TENANT_IDS: "11111111-1111-1111-1111-111111111111"
AUTH_ENTRA_API_CLIENT_ID: "aaaaaaaa-0000-0000-0000-000000000001"
AUTH_ENTRA_API_APP_ID_URI: "api://soarca"

# API keys
AUTH_API_KEYS_FILE: "/etc/soarca/api-keys.json"

Checking a token

Access tokens are signed, not encrypted, so you can read their claims. This is the quickest way to find out why SOARCA rejects one:

echo "$TOKEN" | cut -d. -f2 | tr '_-' '/+' | base64 -d 2>/dev/null | jq

Compare iss with the issuer SOARCA is configured for, aud with the client ID, and roles (Entra ID) or groups (authentik) with the role tables on the provider pages.

Then call SOARCA with it:

curl -H "Authorization: Bearer $TOKEN" http://localhost:8080/playbook/

Common problems

ResponseCause
401 for every requestThe token’s issuer isn’t configured, the token expired, or it was issued for another audience. Decode the token and compare iss and aud.
401 with an Entra token whose aud is https://graph.microsoft.comThe caller requested a Microsoft Graph token. Request a token for the SOARCA API instead; see Entra ID.
403 forbidden: requires …The credential is valid, but none of its roles or groups grants that permission.
SOARCA doesn’t start: AUTH_ENABLED=true requires …Authentication is enabled without a complete provider configuration.

Microsoft Entra ID

Let users and applications from Microsoft Entra ID call SOARCA

authentik and other OIDC providers

Let users and service accounts from authentik, or another OpenID Connect provider, call SOARCA

API keys

Static keys for systems that cannot request an OAuth token