Security API
The Security API provides tools for protecting the tenant against unauthorized access and malicious activity. Administrators can maintain IP allow/block lists, review suspicious login events, configure CAPTCHA verification, and manage account lockouts.
Auris evaluates security rules during every authentication attempt in this order: IP rules (block/allow) -> CAPTCHA verification -> rate limiting -> credential validation -> suspicious login analysis -> adaptive MFA. Each layer operates independently and can be configured separately.
IP Rules
IP rules define allow and block lists using CIDR notation. Block rules always take precedence over allow rules. Rules can be scoped to the entire tenant or to a specific application.
List IP Rules
/api/ip-rulesRequires: manage:usersList all IP allow/block rules configured for the tenant. Supports filtering by rule type, scope, and active status. Rules are ordered by creation date descending.
Query parameters
Success response
{
"ok": true,
"data": {
"data": [
{
"id": "ipr_abc123",
"cidr": "203.0.113.0/24",
"type": "BLOCK",
"scope": "TENANT",
"applicationId": null,
"label": "Known bad actor range",
"note": "Blocked after brute-force campaign on 2025-02-10",
"isTemporary": true,
"expiresAt": "2025-03-10T00:00:00Z",
"isActive": true,
"createdAt": "2025-02-10T14:30:00Z",
"updatedAt": "2025-02-10T14:30:00Z"
},
{
"id": "ipr_def456",
"cidr": "10.0.0.0/8",
"type": "ALLOW",
"scope": "TENANT",
"applicationId": null,
"label": "Corporate VPN",
"note": "Internal network range",
"isTemporary": false,
"expiresAt": null,
"isActive": true,
"createdAt": "2025-01-15T09:00:00Z",
"updatedAt": "2025-01-15T09:00:00Z"
},
{
"id": "ipr_ghi789",
"cidr": "198.51.100.50/32",
"type": "BLOCK",
"scope": "APPLICATION",
"applicationId": "app_prod001",
"label": "Suspicious IP",
"note": null,
"isTemporary": false,
"expiresAt": null,
"isActive": true,
"createdAt": "2025-02-05T11:20:00Z",
"updatedAt": "2025-02-05T11:20:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 3,
"totalPages": 1
}
}
}Create IP Rule
/api/ip-rulesRequires: manage:usersCreate a new IP allow or block rule. CIDR notation is required — use /32 for a single IP address.
Block rules always take precedence over allow rules during evaluation.
Request body
{
"cidr": "192.0.2.0/24",
"type": "BLOCK",
"scope": "TENANT",
"label": "Datacenter range",
"note": "Blocked due to automated scraping activity",
"isTemporary": true,
"expiresAt": "2025-04-01T00:00:00Z"
}Success response
{
"ok": true,
"data": {
"id": "ipr_jkl012",
"cidr": "192.0.2.0/24",
"type": "BLOCK",
"scope": "TENANT",
"applicationId": null,
"label": "Datacenter range",
"note": "Blocked due to automated scraping activity",
"isTemporary": true,
"expiresAt": "2025-04-01T00:00:00Z",
"isActive": true,
"createdAt": "2025-02-18T10:00:00Z",
"updatedAt": "2025-02-18T10:00:00Z"
}
}Error codes
Temporary rules are automatically cleaned up after their expiresAt timestamp. You do not need to manually delete them.
Update IP Rule
/api/ip-rules/[id]Requires: manage:usersUpdate an existing IP rule. All fields are optional — only provided fields are updated. Changing the CIDR or type of a rule takes effect immediately for subsequent login attempts.
Request body
{
"label": "Updated label",
"note": "Extended block after continued activity",
"isActive": false
}Success response
{
"ok": true,
"data": {
"id": "ipr_abc123",
"cidr": "203.0.113.0/24",
"type": "BLOCK",
"scope": "TENANT",
"applicationId": null,
"label": "Updated label",
"note": "Extended block after continued activity",
"isTemporary": true,
"expiresAt": "2025-03-10T00:00:00Z",
"isActive": false,
"createdAt": "2025-02-10T14:30:00Z",
"updatedAt": "2025-02-18T10:30:00Z"
}
}Error codes
Delete IP Rule
/api/ip-rules/[id]Requires: manage:usersPermanently delete an IP rule. The rule is removed immediately and will no longer be evaluated during authentication attempts.
Success response
{
"ok": true,
"data": {
"deleted": true,
"id": "ipr_abc123"
}
}Error codes
Suspicious Login Events
Auris monitors login attempts for anomalous behavior using five detection methods: new device, new IP address, new country, impossible travel, and VPN/proxy usage. When suspicious activity is detected, an event is logged and the configured action is taken (log only, require MFA, or block).
List Suspicious Login Events
/api/suspicious-login/eventsRequires: manage:usersList suspicious login events across the tenant. Events are ordered by creation date descending.
Use the reviewed filter to find events that need administrator attention.
Query parameters
Success response
{
"ok": true,
"data": {
"data": [
{
"id": "sle_abc123",
"userId": "usr_xyz789",
"userEmail": "[email protected]",
"reason": "impossible_travel",
"severity": "high",
"actionTaken": "require_mfa",
"details": {
"previousLocation": { "country": "Italy", "city": "Rome", "lat": 41.9028, "lng": 12.4964 },
"currentLocation": { "country": "Brazil", "city": "Sao Paulo", "lat": -23.5505, "lng": -46.6333 },
"distanceKm": 9187,
"timeDiffMinutes": 45,
"requiredSpeedKmh": 12249
},
"ipAddress": "198.51.100.42",
"reviewed": false,
"reviewedAt": null,
"reviewedBy": null,
"createdAt": "2025-02-18T09:15:00Z"
},
{
"id": "sle_def456",
"userId": "usr_abc123",
"userEmail": "[email protected]",
"reason": "vpn_detected",
"severity": "medium",
"actionTaken": "log",
"details": {
"ipAddress": "203.0.113.50",
"isp": "NordVPN",
"isVpn": true,
"isProxy": false,
"isDatacenter": true
},
"ipAddress": "203.0.113.50",
"reviewed": true,
"reviewedAt": "2025-02-18T10:00:00Z",
"reviewedBy": "usr_admin001",
"createdAt": "2025-02-18T08:45:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 47,
"totalPages": 3
}
}
}Mark Event as Reviewed
/api/suspicious-login/events/[id]/reviewRequires: manage:usersMark a suspicious login event as reviewed. This is an administrative acknowledgment and does not affect the user’s access. Use this to track which events have been investigated.
Success response
{
"ok": true,
"data": {
"id": "sle_abc123",
"reviewed": true,
"reviewedAt": "2025-02-18T11:00:00Z",
"reviewedBy": "usr_admin001"
}
}Error codes
Get Detection Config
/api/suspicious-login/configRequires: manage:usersRetrieve the current suspicious login detection configuration for the tenant.
Success response
{
"ok": true,
"data": {
"detectNewDevice": true,
"detectNewIp": true,
"detectNewCountry": true,
"detectImpossibleTravel": true,
"detectVpn": false,
"actionOnNewDevice": "log",
"actionOnNewIp": "log",
"actionOnNewCountry": "require_mfa",
"actionOnImpossibleTravel": "require_mfa",
"actionOnVpn": "log",
"maxTravelSpeedKmh": 900,
"geoIpProvider": "ip-api",
"updatedAt": "2025-02-01T12:00:00Z"
}
}Update Detection Config
/api/suspicious-login/configRequires: manage:usersUpdate the suspicious login detection configuration. All fields are optional. Changes take effect immediately for subsequent login attempts.
Request body
{
"detectVpn": true,
"actionOnVpn": "require_mfa",
"actionOnImpossibleTravel": "block",
"maxTravelSpeedKmh": 1000
}Success response
{
"ok": true,
"data": {
"detectNewDevice": true,
"detectNewIp": true,
"detectNewCountry": true,
"detectImpossibleTravel": true,
"detectVpn": true,
"actionOnNewDevice": "log",
"actionOnNewIp": "log",
"actionOnNewCountry": "require_mfa",
"actionOnImpossibleTravel": "block",
"actionOnVpn": "require_mfa",
"maxTravelSpeedKmh": 1000,
"geoIpProvider": "ip-api",
"updatedAt": "2025-02-18T11:30:00Z"
}
}Error codes
Setting actionOnImpossibleTravel or actionOnNewCountry to block can lock out legitimate users who travel frequently or use mobile networks. Consider using require_mfa instead, which adds a verification step without denying access entirely.
CAPTCHA
CAPTCHA verification adds a human challenge to authentication flows. Auris supports three providers: Cloudflare Turnstile, hCaptcha, and reCAPTCHA v3. CAPTCHA can be triggered on every attempt, only after suspicious activity, or after a configurable number of failed login attempts.
Get CAPTCHA Config
/api/captcha/configRequires: manage:usersRetrieve the current CAPTCHA configuration for the tenant.
Success response
{
"ok": true,
"data": {
"provider": "CLOUDFLARE_TURNSTILE",
"trigger": "ON_SUSPICIOUS",
"siteKey": "0x4AAAAAAA...",
"scoreThreshold": 0.5,
"enableOnLogin": true,
"enableOnRegister": true,
"enableOnReset": false,
"updatedAt": "2025-02-15T10:00:00Z"
}
}The secretKey is never returned in API responses. It can only be set via the update endpoint.
Update CAPTCHA Config
/api/captcha/configRequires: manage:usersUpdate the CAPTCHA configuration. All fields are optional. Set provider to null to disable
CAPTCHA entirely. The siteKey and secretKey must be valid for the selected provider.
Request body
{
"provider": "CLOUDFLARE_TURNSTILE",
"trigger": "AFTER_FAILURES",
"siteKey": "0x4AAAAAAA_your_site_key",
"secretKey": "0x4AAAAAAA_your_secret_key",
"scoreThreshold": 0.5,
"enableOnLogin": true,
"enableOnRegister": true,
"enableOnReset": true
}Success response
{
"ok": true,
"data": {
"provider": "CLOUDFLARE_TURNSTILE",
"trigger": "AFTER_FAILURES",
"siteKey": "0x4AAAAAAA_your_site_key",
"scoreThreshold": 0.5,
"enableOnLogin": true,
"enableOnRegister": true,
"enableOnReset": true,
"updatedAt": "2025-02-18T12:00:00Z"
}
}Error codes
Account Lockouts
When a user exceeds the lockoutThreshold configured in security settings, their account is temporarily locked. Administrators can view locked accounts and manually unlock them.
List Locked Accounts
/api/admin/lockoutsRequires: manage:usersList all currently locked user accounts. Only accounts with active lockouts are returned. Lockouts that have expired naturally are not included.
Success response
{
"ok": true,
"data": {
"data": [
{
"id": "lock_abc123",
"userId": "usr_xyz789",
"userEmail": "[email protected]",
"userName": "Alice Smith",
"failedAttempts": 5,
"lockedAt": "2025-02-18T09:00:00Z",
"expiresAt": "2025-02-18T09:15:00Z",
"ipAddress": "203.0.113.50"
},
{
"id": "lock_def456",
"userId": "usr_abc123",
"userEmail": "[email protected]",
"userName": "Bob Jones",
"failedAttempts": 5,
"lockedAt": "2025-02-18T08:50:00Z",
"expiresAt": "2025-02-18T09:05:00Z",
"ipAddress": "198.51.100.42"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2,
"totalPages": 1
}
}
}Unlock Account
/api/admin/lockouts/[userId]Requires: manage:usersImmediately unlock a user account. The failed attempt counter is reset to zero. The user can attempt to log in again immediately after being unlocked.
Success response
{
"ok": true,
"data": {
"unlocked": true,
"userId": "usr_xyz789"
}
}Error codes
Account lockouts expire automatically based on the lockoutDuration configured in security settings. Manual unlock is only needed when a legitimate user is locked out and cannot wait for the lockout to expire.
Security Evaluation Order
During every authentication attempt, Auris evaluates security layers in this order:
- IP Rules — If the client IP matches a BLOCK rule, the request is denied immediately with
403 IP_BLOCKED. - CAPTCHA — If CAPTCHA is configured and the trigger condition is met, the client must provide a valid CAPTCHA token.
- Rate Limiting — Sliding window rate limits are checked (configurable per tier).
- Credential Validation — Username/password or other credential verification via Keycloak.
- Brute Force / Lockout — Failed attempt counter is incremented. If threshold is reached, account is locked.
- Suspicious Login Analysis — Post-authentication analysis of device, IP, geography, and travel patterns.
- Adaptive MFA — Risk scoring may trigger step-up authentication if the risk score exceeds thresholds.
Each layer is independent and can be disabled without affecting the others.
Permissions Reference
Security management operations are grouped under the manage:users permission. This ensures that only administrators with full user management access can modify security settings that affect authentication for all users in the tenant.
Related
- Adaptive MFA & Risk Scoring — How risk scoring drives security decisions
- Attack Protection — Configure brute-force and suspicious login protection
- Threat Protection Setup — IP rules, CAPTCHA, and bot detection
- Security Settings — Manage all security features from the Console
- Risk Scoring & Adaptive MFA — Configure risk rules and thresholds