nano SIEM
Settings

Platform Audit Logging

Platform Audit Logging

nano provides comprehensive audit logging for all platform operations, enabling security teams to monitor administrative actions, track changes, build compliance reports, and even create detection rules on platform activity itself.

Overview

All platform audit events are stored in ClickHouse with source_type=audit, making them fully searchable using the standard nano query interface. Each event includes a source field indicating which subsystem generated the event.

Key Benefits

  • Full Searchability: Query audit logs using the same interface as security data
  • Detection Capabilities: Build detection rules on platform activity
  • Compliance: Track all administrative actions for audit trails
  • Dashboards: Create operational dashboards for platform monitoring
  • Alerting: Set up alerts for suspicious administrative activity

Audit Sources

SourceDescription
authAuthentication events (login, logout, password reset)
detectionDetection rule changes (create, update, delete, enable/disable)
userUser management (create, update, delete, lock/unlock)
tuningAuto-tuning proposals and settings changes
caseCase lifecycle events (see Case Audit Events)
apikeyAPI key management (create, delete, enable/disable)
roleRole management (create, update, delete)
groupGroup management (create, update, delete, role assignments)
credentialsCloud credential management (create, update, delete)

Audit Event Schema

Common Fields

All audit events share these fields:

FieldTypeDescription
source_typeStringAlways "audit"
sourceStringSubsystem (auth, detection, user, etc.)
actionStringSpecific action performed
actor_idUUIDUser ID who performed the action
actor_nameStringDisplay name of the actor
api_key_idUUIDAPI key used (if applicable)
resource_typeStringType of resource affected
resource_idUUIDID of affected resource
resource_nameStringName of affected resource
ip_addressStringClient IP address
user_agentStringClient user agent
successBooleanWhether the action succeeded
detailsJSONAdditional action-specific data
timestampDateTimeWhen the event occurred

Action Reference

Authentication Actions

ActionDescriptionTriggered By
login_successUser successfully logged inLogin form, SSO
login_failedLogin attempt failedInvalid credentials, locked account
logoutUser logged outManual logout
token_refreshAccess token refreshedToken refresh endpoint
password_reset_requestPassword reset requestedForgot password form
password_reset_completePassword reset completedReset link clicked
password_changedPassword changedUser settings
oidc_loginSSO/OIDC login completedOIDC flow

Detection Rule Actions

ActionDescriptionTriggered By
rule_createdDetection rule createdNew rule saved
rule_updatedDetection rule modifiedRule edited
rule_deletedDetection rule deletedRule removed
rule_enabledDetection rule enabledToggle or bulk action
rule_disabledDetection rule disabledToggle or bulk action
rule_promotedRule promoted to productionExperimental to production
rule_demotedRule demoted to experimentalProduction to experimental
rule_duplicatedRule duplicatedClone action

User Management Actions

ActionDescriptionTriggered By
user_createdNew user createdAdmin creates user
user_updatedUser profile updatedAdmin or self-edit
user_deletedUser deletedAdmin action
user_lockedUser account lockedFailed login threshold
user_unlockedUser account unlockedAdmin action
user_disabledUser account disabledAdmin action
user_enabledUser account enabledAdmin action
user_groups_updatedUser group memberships changedAdmin action

Auto-Tuning Actions

ActionDescriptionTriggered By
proposal_approvedTuning proposal approvedManual approval
proposal_rejectedTuning proposal rejectedManual rejection
settings_updatedRule tuning settings changedSettings edit
version_revertedRule reverted to previous versionRevert action

API Key Actions

ActionDescriptionTriggered By
apikey_createdNew API key createdKey generation
apikey_deletedAPI key deletedKey deletion
apikey_enabledAPI key enabledAdmin action
apikey_disabledAPI key disabledAdmin action

Role Actions

ActionDescriptionTriggered By
role_createdNew role createdAdmin action
role_updatedRole modifiedPermission changes
role_deletedRole deletedAdmin action

Group Actions

ActionDescriptionTriggered By
group_createdNew group createdAdmin action
group_updatedGroup modifiedAdmin action
group_deletedGroup deletedAdmin action
group_roles_updatedGroup role assignments changedAdmin action

Credential Actions

ActionDescriptionTriggered By
credential_createdCloud credential addedAdmin action
credential_updatedCloud credential modifiedAdmin action
credential_deletedCloud credential removedAdmin action

Querying Audit Events

Basic Queries

All Authentication Events

source_type=audit source=auth

Failed Login Attempts

source_type=audit source=auth action=login_failed

All Detection Rule Changes

source_type=audit source=detection

Changes by Specific User

source_type=audit actor_name="admin@example.com"

All API Key Activity

source_type=audit source=apikey

Activity from Specific IP

source_type=audit ip_address="192.168.1.100"

Aggregation Queries

Actions by Source

source_type=audit
| stats count by source, action
| sort -count

Most Active Users

source_type=audit
| stats count by actor_name
| sort -count
| head 10

Daily Activity Trend

source_type=audit
| bucket timestamp span=1d
| stats count by timestamp, source

Failed Operations

source_type=audit success=false
| stats count by source, action

Security Monitoring

Authentication Security

Failed Login Monitoring

source_type=audit source=auth action=login_failed
| stats count by actor_name, ip_address
| where count > 5

Logins from New Locations

source_type=audit source=auth action=login_success
| stats earliest(timestamp) as first_seen by actor_name, ip_address
| where first_seen > now() - 24h

After-Hours Logins

source_type=audit source=auth action=login_success
| eval hour = hour(timestamp)
| where hour < 6 OR hour > 20

Privilege Escalation Detection

Role Changes

source_type=audit source=role action=role_updated
| table timestamp, actor_name, resource_name, details

User Permission Changes

source_type=audit source=user action=user_groups_updated
| table timestamp, actor_name, resource_name, details

API Key Creation

source_type=audit source=apikey action=apikey_created
| table timestamp, actor_name, resource_name

Detection Rule Monitoring

Rule Deletions

source_type=audit source=detection action=rule_deleted
| table timestamp, actor_name, resource_name

Rules Disabled Today

source_type=audit source=detection action=rule_disabled
| where timestamp > now() - 24h
| table timestamp, actor_name, resource_name

Rule Changes by Non-Admins

source_type=audit source=detection
| where actor_name NOT IN ("admin@example.com", "system")
| stats count by actor_name, action

Dashboard Examples

Security Operations Dashboard

PanelQueryVisualization
Failed Logins (24h)source_type=audit action=login_failed | where timestamp > now() - 24h | stats countSingle value
Login Locationssource_type=audit action=login_success | stats count by ip_addressMap/Table
Rule Changes (7d)source_type=audit source=detection | bucket timestamp span=1d | stats count by timestampLine chart
Active Userssource_type=audit | stats dc(actor_id) as unique_usersSingle value
Top Actionssource_type=audit | stats count by source, action | sort -count | head 20Bar chart

Compliance Dashboard

PanelQueryVisualization
User Account Changessource_type=audit source=userTable
Role/Permission Changessource_type=audit source=role OR source=groupTable
API Key Activitysource_type=audit source=apikeyTable
Credential Changessource_type=audit source=credentialsTable
All Admin Actionssource_type=audit | where action contains "created" OR action contains "deleted"Table

Admin Activity Dashboard

PanelQueryVisualization
Actions per Usersource_type=audit | stats count by actor_namePie chart
Activity Timelinesource_type=audit | bucket timestamp span=1h | stats count by timestampLine chart
Actions by Typesource_type=audit | stats count by actionBar chart
Source Distributionsource_type=audit | stats count by sourcePie chart

Alerting on Audit Events

Create detection rules on audit events to monitor for security-relevant activity:

Brute Force Detection

name: Brute Force Login Attempt
query: |
  source_type=audit source=auth action=login_failed
  | stats count by actor_name
  | where count > 10
schedule: "*/5 * * * *"
severity: high

Unauthorized Rule Deletion

name: Detection Rule Deleted
query: |
  source_type=audit source=detection action=rule_deleted
schedule: "* * * * *"
severity: critical

After Hours Admin Activity

name: After Hours Administrative Action
query: |
  source_type=audit
  | where source IN ("user", "role", "group", "apikey", "credentials")
  | eval hour = hour(timestamp)
  | where hour < 6 OR hour > 22
  | stats count
  | where count > 0
schedule: "*/15 * * * *"
severity: medium

Multiple Failed Actions

name: Multiple Failed Operations
query: |
  source_type=audit success=false
  | stats count by actor_name
  | where count > 5
schedule: "*/10 * * * *"
severity: medium

New API Key Created

name: API Key Created Alert
query: |
  source_type=audit source=apikey action=apikey_created
schedule: "* * * * *"
severity: low

Bulk User Changes

name: Bulk User Account Changes
query: |
  source_type=audit source=user
  | where timestamp > now() - 5m
  | stats count
  | where count > 10
schedule: "*/5 * * * *"
severity: high

Best Practices

1. Monitor Critical Actions

Set up real-time alerts for:

  • Detection rule deletions or bulk disabling
  • Role/permission changes
  • API key creation
  • User account lockouts
  • Failed authentication spikes

2. Establish Baselines

Track normal patterns for:

  • Number of logins per user
  • Time of day for administrative actions
  • Frequency of rule changes
  • API key usage patterns

3. Review Regularly

Schedule periodic reviews:

  • Daily: Failed logins, rule changes
  • Weekly: User account changes, API key activity
  • Monthly: Role/permission changes, compliance reports

4. Correlate with Security Events

Combine audit logs with security data:

(source_type=audit source=auth action=login_success) OR (source_type=windows_security EventID=4624)
| stats count by actor_name, ip_address

5. Retain for Compliance

Configure appropriate retention for audit data:

  • Many compliance frameworks require 90+ day retention
  • Consider longer retention for authentication and access control events
  • Export critical events to long-term storage if needed

API Access

Query Audit Events

curl -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "source_type=audit source=auth",
    "start": "-24h",
    "end": "now",
    "limit": 1000
  }' \
  http://nanosiem:3000/api/search

Export for Compliance

# Export all audit events for the past 30 days
curl -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "source_type=audit",
    "start": "-30d",
    "end": "now",
    "format": "json"
  }' \
  http://nanosiem:3000/api/search/export > audit-export.json

Troubleshooting

Audit Events Not Appearing

  1. Check ClickHouse connectivity: Audit events require ClickHouse to be operational
  2. Verify source_type: Query with source_type=audit (not source_type=case_audit)
  3. Check time range: Ensure your query time range includes the expected events
  4. Review permissions: User must have appropriate view permissions

Missing Actor Information

  • Events from background jobs may have actor_id=null
  • API key events include api_key_id but may not have user context
  • System-initiated events may show actor_name="system"

High Volume Concerns

If audit volume is too high:

  • Review which actions are most frequent
  • Consider filtering routine read operations
  • Adjust dashboard refresh intervals
  • Use aggregation queries instead of raw event lists
On this page

On this page