LDAP/SSO¶
SentriKat supports LDAP/Active Directory authentication and SAML 2.0 Single Sign-On for enterprise environments.
PRO Feature
LDAP and SAML SSO require a PRO license. DEMO users authenticate with local accounts only.
LDAP / Active Directory¶
Configuration¶
Configure LDAP via environment variables in your .env file:
LDAP_ENABLED=true
LDAP_SERVER=ldap://ldap.example.com
LDAP_PORT=636
LDAP_BIND_DN=cn=sentrikat,ou=services,dc=example,dc=com
LDAP_BIND_PASSWORD=your-bind-password
LDAP_BASE_DN=ou=users,dc=example,dc=com
These six variables are the ones overridable from the environment. All other LDAP options (SSL mode, user filter, group mappings) are configured from the web UI and stored in the database.
After setting these variables, restart SentriKat:
Environment Variables¶
| Variable | Description | Example |
|---|---|---|
LDAP_ENABLED | Enable LDAP authentication | true |
LDAP_SERVER | LDAP server URL | ldap://ldap.example.com or ldaps://... |
LDAP_PORT | Connection port | 389 (LDAP) or 636 (LDAPS) |
LDAP_BIND_DN | Service account DN | cn=sentrikat,ou=services,dc=example,dc=com |
LDAP_BIND_PASSWORD | Service account password | Required |
LDAP_BASE_DN | User search base | ou=users,dc=example,dc=com |
All other LDAP options (user filter, group bases/filters, TLS client certificates) are configured from the web UI (Settings > Authentication) and stored in the database. They are not read from the environment.
Active Directory Example¶
For Microsoft Active Directory, use these settings:
LDAP_ENABLED=true
LDAP_SERVER=ldaps://dc01.corp.example.com
LDAP_PORT=636
LDAP_BIND_DN=CN=SentriKat Service,OU=Service Accounts,DC=corp,DC=example,DC=com
LDAP_BIND_PASSWORD=your-bind-password
LDAP_BASE_DN=DC=corp,DC=example,DC=com
Set the AD-specific user filter ((sAMAccountName={username})) and the group bases/filters from Settings > Authentication.
Group-to-Role Mapping¶
Map LDAP/AD groups to SentriKat roles in Settings > Authentication:
| LDAP Group | SentriKat Role | Description |
|---|---|---|
CN=SentriKat-Admins,OU=Groups,... | org_admin | Full org management |
CN=SentriKat-Managers,OU=Groups,... | manager | Product and vuln management |
CN=SentriKat-Users,OU=Groups,... | viewer | Read-only access |
If a user does not belong to any mapped group, they are assigned the default role, configured on the same Settings > Authentication page.
Testing LDAP¶
Validate your LDAP configuration before enabling it for all users:
# Test from within the Docker container
docker compose exec sentrikat flask ldap test
# Or test via the admin panel
# Settings > Authentication > Test Connection
Expected output:
Warning
Always test LDAP with a non-admin account first. If LDAP is misconfigured and you enable it, local admin login remains available as a fallback at /auth/local-login.
SAML 2.0 SSO¶
Overview¶
SentriKat acts as a SAML 2.0 Service Provider (SP). You configure your Identity Provider (IdP) to trust SentriKat and send signed assertions.
Supported Identity Providers¶
SentriKat has been tested with:
- Microsoft Entra ID (Azure AD)
- Okta
- Google Workspace
- Keycloak
- ADFS
SentriKat SP Metadata¶
Your SentriKat instance exposes SP metadata at:
Provide this URL to your IdP when configuring the trust relationship.
IdP Configuration¶
- In the Azure Portal, go to Enterprise Applications > New Application
- Select Create your own application > Non-gallery
- Under Single sign-on, choose SAML
- Set the following:
- Entity ID:
https://sentrikat.example.com/api/saml/metadata - Reply URL (ACS):
https://sentrikat.example.com/saml/acs - Sign-on URL:
https://sentrikat.example.com/saml/login
- Entity ID:
- Under Attributes & Claims, map:
email->user.maildisplayName->user.displayname
- Download the Federation Metadata XML
- In Okta Admin, go to Applications > Create App Integration
- Choose SAML 2.0
- Set the following:
- Single sign-on URL:
https://sentrikat.example.com/saml/acs - Audience URI:
https://sentrikat.example.com/api/saml/metadata
- Single sign-on URL:
- Add attribute statements:
email->user.emaildisplayName->user.firstName + " " + user.lastName
- Download the IdP Metadata XML
- In Keycloak Admin, go to Clients > Create
- Set Client Protocol to
saml - Set Client ID to
https://sentrikat.example.com/api/saml/metadata - Configure endpoints:
- Master SAML URL:
https://sentrikat.example.com/saml/acs
- Master SAML URL:
- Under Mappers, add
emailanddisplayName - Export the realm's SAML metadata
SentriKat SAML Settings¶
SAML is configured in the application, not in .env. Unlike LDAP (which has six environment overrides, listed above), SAML has none: the settings live in the database and are edited from the admin UI, so a change takes effect without a restart.
- Go to Settings > Authentication
- Enable SAML SSO
- Paste your IdP's metadata XML into IdP Metadata
- Set the Service Provider fields to match what you registered with the IdP:
- SP Entity ID:
https://sentrikat.example.com/api/saml/metadata - SP ACS URL:
https://sentrikat.example.com/saml/acs - SP SLS URL:
https://sentrikat.example.com/saml/sls
- SP Entity ID:
- Use Test Connection before saving
The SP metadata SentriKat publishes for your IdP is served at /api/saml/metadata. 5. Optionally, check Enforce SSO to disable local password login for non-admin users
TOTP Two-Factor Authentication¶
New in v1.0.2
TOTP 2FA was added in SentriKat v1.0.2.
SentriKat supports Time-based One-Time Password (TOTP) two-factor authentication for all user accounts, including local, LDAP, and SSO users.
Enabling TOTP¶
Global Enforcement¶
Require all users to set up TOTP:
- Go to Settings > Authentication
- Enable Require Two-Factor Authentication
- Save
Users will be prompted to set up TOTP on their next login.
Per-User Setup¶
Individual users can enable TOTP from their profile:
- Go to Profile > Security
- Click Enable Two-Factor Authentication
- Scan the QR code with an authenticator app (Google Authenticator, Authy, 1Password, etc.)
- Enter the verification code to confirm
Supported Authenticator Apps¶
Any TOTP-compatible authenticator works:
- Google Authenticator
- Microsoft Authenticator
- Authy
- 1Password
- Bitwarden
Recovery¶
If a user loses access to their authenticator:
An administrator disables TOTP for that user in Users & Access > select the user > Disable 2FA, and the user then enrols a new authenticator.
There are no self-service recovery codes
SentriKat does not issue backup or recovery codes at enrolment. An administrator is the only recovery path, so make sure at least one administrator account can always sign in without TOTP before you enable it organization-wide.
Hybrid Authentication¶
You can enable both LDAP and SAML simultaneously. SentriKat resolves authentication in this order:
- SAML SSO (if user clicks "Sign in with SSO")
- LDAP bind (if LDAP is configured)
- Local database (fallback)
Warning
The local super_admin account always authenticates against the local database, regardless of SSO settings. This ensures you are never locked out.
Next Steps¶
- Manage users and roles
- Configure organizations for LDAP-synced users
- Set up notifications for alert delivery