Audit Logging

DefectDojo records an audit trail of changes to its data. Every tracked object automatically records create, update, and delete events, and relationship (many-to-many) tables record add and remove events.

How it works

Audit tracking is driven by database triggers registered per model. For each tracked object, three event types can fire:

Event typeWhen it firesAction
InsertEventA new record is createdCreate
UpdateEventA record changes β€” only when a real field value actually changesUpdate
DeleteEventA record is deletedDelete

Many-to-many relationship tables (tags, reviewers, firewall IP ranges) track only add (InsertEvent) and remove (DeleteEvent) β€” there is no “update” for a relationship row.

What is captured with every event

  • Who β€” the acting user, taken from the request context.
  • When β€” a timestamp.
  • Source IP β€” the remote address, honoring X-Forwarded-For proxy chains.
  • Before/after snapshot β€” the full field values of the record.
  • Context / label β€” groups events originating from the same request. The label initial_backfill marks historical records imported when tracking was first enabled.

Events produced by background jobs are stitched back to the originating request’s context, so an action completed asynchronously is still attributed to the user who triggered it.

Core (Open Source) β€” tracked actions

ObjectCreateUpdateDeleteNotes
Userβœ…βœ…βœ…password excluded from snapshots
Organizationβœ…βœ…βœ…
Assetβœ…βœ…βœ…
Engagementβœ…βœ…βœ…
Testβœ…βœ…βœ…
Findingβœ…βœ…βœ…
Finding Groupβœ…βœ…βœ…
Finding Templateβœ…βœ…βœ…
Risk Acceptanceβœ…βœ…βœ…
Endpointβœ…βœ…βœ…
Locationβœ…βœ…βœ…
URLβœ…βœ…βœ…
Notification Webhookβœ…βœ…βœ…header_name / header_value excluded (secrets)

Core β€” relationship (add / remove) events

RelationshipAddRemove
Finding β†’ Reviewersβœ…βœ…
Finding β†’ Tagsβœ…βœ…
Finding β†’ Inherited Tagsβœ…βœ…
Asset β†’ Tagsβœ…βœ…
Engagement β†’ Tagsβœ…βœ…
Engagement β†’ Inherited Tagsβœ…βœ…
Test β†’ Tagsβœ…βœ…
Test β†’ Inherited Tagsβœ…βœ…
Endpoint β†’ Tagsβœ…βœ…
Endpoint β†’ Inherited Tagsβœ…βœ…
Finding Template β†’ Tagsβœ…βœ…
App Analysis (Technology) β†’ Tagsβœ…βœ…
Objects/Asset β†’ Tagsβœ…βœ…

Pro β€” tracked actions

ObjectCreateUpdateDeleteNotes
Enhanced Findingβœ…βœ…βœ…Pro companion to Finding
Ruleβœ…βœ…βœ…Rules engine
Rule Actionβœ…βœ…βœ…
Rule Action Conditionβœ…βœ…βœ…
Rule Filter Entryβœ…βœ…βœ…
Rules Engine Operationβœ…βœ…βœ…
Rules Engine Operation Messageβœ…βœ…βœ…
Scheduled Taskβœ…βœ…βœ…
Scheduled Task Runβœ…βœ…βœ…
Mitigation Policyβœ…βœ…βœ…
Tunable Settingβœ…βœ…βœ…System configuration changes
Feature Flag Stateβœ…βœ…βœ…Flag toggles + system pins
Feature Flag Definitionβœ…βœ…βœ…Metadata / registry sync
Cloud Firewallβœ…βœ…βœ…locked field excluded
Firewall IP Maskβœ…βœ…βœ…

Pro β€” RBAC / permissions

ObjectCreateUpdateDelete
Groupβœ…βœ…βœ…
Roleβœ…βœ…βœ…
Group Membershipβœ…βœ…βœ…
Global Roleβœ…βœ…βœ…
Asset Group Assignmentβœ…βœ…βœ…
Organization Group Assignmentβœ…βœ…βœ…
Asset Memberβœ…βœ…βœ…
Organization Memberβœ…βœ…βœ…

Pro β€” relationship (add / remove) events

RelationshipAddRemove
Cloud Firewall β†’ IP Rangesβœ…βœ…

Configuration & retention (On-Premise Controls)

SettingEnvironment variableDefaultEffect
Enable audit loggingDD_ENABLE_AUDITLOGTrueWhen False, all history triggers are disabled and no events are recorded
Retention periodDD_AUDITLOG_FLUSH_RETENTION_PERIOD-1 (never flush)Months of history to keep; older events are batch-deleted by the flush job
Flush batch sizeDD_AUDITLOG_FLUSH_BATCH_SIZE1000Rows deleted per batch during cleanup
Flush max batchesDD_AUDITLOG_FLUSH_MAX_BATCHES100Cap on the number of batches per flush run

Notes and limitations

  • Secrets are never captured. User passwords and notification-webhook header values are explicitly excluded from event snapshots.
  • Updates record only on a genuine change. A save that does not alter any field value produces no update event; auto-managed fields such as last_updated alone do not trigger one.
  • Authentication events are not captured here. data changes only. Login, logout, and failed-login activity are handled separately and are not part of this audit log.