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
Product Type✅✅✅
Product✅✅✅
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✅✅
Product → Tags✅✅
Engagement → Tags✅✅
Engagement → Inherited Tags✅✅
Test → Tags✅✅
Test → Inherited Tags✅✅
Endpoint → Tags✅✅
Endpoint → Inherited Tags✅✅
Finding Template → Tags✅✅
App Analysis (Technology) → Tags✅✅
Objects/Product → 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✅✅✅
Product Group Assignment✅✅✅
Product Type Group Assignment✅✅✅
Product Member✅✅✅
Product Type 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.