Cet article est actuellement disponible en anglais uniquement. Traduction à venir.
Fait partie de notre série Compliance & Regulation
Lire le guide completAudit Trail Requirements: Building Compliance-Ready ERP Systems
When the SEC fined a major financial institution $35 million in 2025 for inadequate record-keeping, the root cause was not a security breach or a fraudulent transaction. It was the inability to produce a reliable audit trail showing who did what, when, and why. The absence of proper audit logs transformed a manageable compliance inquiry into a multi-million dollar penalty.
For companies running ERP systems, audit trails are not just a technical feature --- they are the foundation of regulatory compliance. Every major compliance framework, from GDPR to SOC2 to SOX, requires some form of audit logging. The question is not whether you need audit trails, but how to implement them in a way that satisfies multiple regulatory requirements simultaneously.
Key Takeaways
- Every audit log entry must answer four questions: who, what, when, and where
- Immutability is non-negotiable --- audit logs must be protected from modification, even by system administrators
- Retention requirements range from 1 year (PCI-DSS) to 7+ years (SOX), so plan storage accordingly
- Odoo and modern ERP systems can be configured for comprehensive audit logging, but it rarely works out of the box
What to Log: The Four W's
An audit trail must capture sufficient information to reconstruct the sequence of events for any transaction or data change. The baseline requirement across all compliance frameworks is the "four W's."
The Four W's of Audit Logging
| W | Question | Data to Capture | Example | |---|----------|----------------|---------| | Who | Who performed the action? | User ID, username, IP address, session ID, authentication method | user_id: 1042, ip: 203.0.113.45, auth: SSO | | What | What action was performed? | Action type, affected resource, old value, new value | action: UPDATE, table: sales_orders, field: status, old: "draft", new: "confirmed" | | When | When did it happen? | UTC timestamp with timezone, sequence number | 2026-03-15T14:32:07.891Z, seq: 482901 | | Where | Where in the system? | Application module, server, endpoint, source system | module: sales, server: app-prod-01, endpoint: /api/orders/1042/confirm |
What Must Be Logged
Different compliance frameworks have different logging requirements, but the union of all requirements covers these categories:
Authentication events:
- Successful and failed login attempts
- Password changes and resets
- MFA enrollment and verification
- Session creation and termination
- Account lockouts and unlocks
Authorization events:
- Role assignments and revocations
- Permission changes
- Access to sensitive data (PII, financial, health records)
- Privilege escalation attempts
- Administrative actions
Data events:
- Record creation, modification, and deletion
- Bulk data operations (imports, exports, mass updates)
- Data access for viewing (especially sensitive data)
- Report generation with sensitive content
- Data exports and downloads
System events:
- Configuration changes
- System startup and shutdown
- Backup creation and restoration
- Software updates and deployments
- Security tool alerts and responses
Financial events (for SOX/financial compliance):
- Journal entry creation and modification
- Invoice generation and payment recording
- Bank reconciliation activities
- Chart of accounts changes
- Financial report generation
Regulation to Audit Trail Requirements
Different regulations impose different logging, retention, and review requirements. The following table maps major regulations to their specific audit trail demands.
| Regulation | What to Log | Retention Period | Review Requirement | Immutability | |-----------|------------|-----------------|-------------------|-------------| | GDPR (Art. 5, 30, 33) | Processing activities, consent changes, DSARs, data breaches, access to PII | Duration of processing + demonstrable period | No specific frequency, but must demonstrate compliance on demand | Implied (accountability principle) | | SOC2 (CC7.2, CC7.3) | Security events, access changes, system changes, incidents | Audit period + reasonable retention | Regular review (typically daily for critical, weekly for standard) | Required (evidence integrity) | | PCI-DSS (Req. 10) | All access to cardholder data, authentication events, admin actions, audit log access | 1 year minimum (3 months immediately available) | Daily review of all security events | Required (tamper detection) | | SOX (Sec. 302, 404) | Financial transaction modifications, approval workflows, segregation of duties | 7 years minimum | Annual audit of financial controls | Required (financial integrity) | | ISO 27001 (A.8.15) | Security events, access control, change management, operational activities | Defined by risk assessment (typically 1-3 years) | Regular review per operational procedures | Required (evidence preservation) | | HIPAA (45 CFR 164.312) | Access to ePHI, user activity, security incidents | 6 years minimum | Regular review (typically daily) | Required (integrity controls) |
Designing for Multiple Regulations
The practical approach is to implement the strictest requirement from each dimension:
- What to log: Union of all requirements (log everything listed above)
- Retention: 7 years (SOX requirement), with 3 months in hot storage (PCI-DSS) and the remainder in cold/archive storage
- Review: Daily automated review with weekly human review of exceptions
- Immutability: Write-once, append-only storage for all audit logs
Immutable Audit Logs
Immutability is the most critical and most frequently overlooked audit trail requirement. An audit log that can be modified by anyone --- including system administrators --- has limited value as compliance evidence.
Why Immutability Matters
If an employee modifies a financial record and then deletes the audit log entry recording that modification, the audit trail has been circumvented. Regulators and auditors specifically look for evidence that audit logs cannot be tampered with.
Implementation Approaches
Approach 1: Write-Once Storage
Use storage systems that enforce write-once-read-many (WORM) semantics:
- AWS S3 Object Lock (Governance or Compliance mode)
- Azure Immutable Blob Storage
- Google Cloud Storage retention policies
- Purpose-built immutable databases (immudb, Amazon QLDB)
Approach 2: Cryptographic Chaining
Chain log entries using cryptographic hashes (similar to blockchain):
- Each log entry includes the hash of the previous entry
- Modifying or deleting any entry breaks the chain
- The chain can be independently verified
- This approach works with any storage backend
Approach 3: Separate Logging Infrastructure
Send audit logs to a separate system with restricted access:
- Centralized logging platform (ELK Stack, Datadog, Splunk)
- Separate credentials and access controls from the application
- No delete permissions --- even for administrators
- Access to the logging platform itself is audited
Best practice: Combine approaches. Write audit logs to both the application database (for querying) and an immutable external store (for evidence integrity). The external store serves as the authoritative record if the application database is disputed.
Odoo Audit Trail Implementation
Odoo provides basic audit logging out of the box through its chatter system and create_uid/write_uid fields, but this is insufficient for most compliance requirements. Here is how to build a comprehensive audit trail in Odoo.
Built-In Odoo Tracking
Odoo's default tracking capabilities:
| Feature | What It Captures | Limitation |
|---------|-----------------|------------|
| create_uid / create_date | Who created the record and when | Only creation, not modifications |
| write_uid / write_date | Who last modified the record and when | Only the last modification, not history |
| Mail tracking (track_visibility) | Field changes logged in chatter | Requires explicit configuration per field |
| mail.message | Chatter messages and system notifications | Not tamper-proof, can be deleted |
Enhancing Odoo Audit Trails
To build compliance-ready audit trails in Odoo:
1. Field-level change tracking. Enable track_visibility on all sensitive fields across all relevant models. This captures old/new values in the chatter.
2. Custom audit log model. Create a dedicated audit log model that captures the four W's for every significant operation:
- User ID, IP address, and session info (who)
- Model, record ID, field, old value, new value (what)
- UTC timestamp with microsecond precision (when)
- Module, method, and request context (where)
3. Database triggers. For critical tables (financial records, user management), implement PostgreSQL triggers that write to a separate audit schema. These triggers fire even if the application layer is bypassed.
4. Immutable storage. Stream audit logs to an external immutable store (S3 with Object Lock, or a dedicated SIEM) in real-time. This provides tamper-proof evidence independent of the Odoo database.
5. Access logging. Log all read access to sensitive records, not just writes. This is particularly important for GDPR (demonstrating who accessed personal data) and HIPAA (tracking ePHI access).
Integration with ECOSIRE
ECOSIRE's Odoo ERP implementations include pre-configured audit trail modules that satisfy GDPR, SOC2, and ISO 27001 requirements. The implementation includes field-level tracking, immutable log storage, automated retention management, and compliance-ready reporting dashboards.
Audit Log Architecture Best Practices
Performance Considerations
Comprehensive audit logging generates significant data volume. A mid-size ERP system processing 10,000 transactions per day can easily generate 500,000+ audit log entries daily. Plan accordingly:
- Separate storage: Keep audit logs in a separate database or schema to avoid impacting application performance
- Asynchronous logging: Use message queues (Redis, RabbitMQ) to decouple log writing from transaction processing
- Tiered storage: Hot storage (SSD) for recent logs (30-90 days), warm storage for 1-2 years, cold/archive storage for long-term retention
- Indexing strategy: Index frequently queried fields (timestamp, user_id, resource_type, action) but not every field
Log Format Standardization
Use a consistent, structured format across all systems:
- JSON format for machine readability and easy parsing
- UTC timestamps to avoid timezone confusion in global operations
- Consistent field names across all log sources
- Correlation IDs that link related log entries across services (e.g., a single user action that triggers events in multiple modules)
- Log levels that distinguish informational logging from security-relevant audit events
Access Control for Audit Logs
The audit log system itself must be secured:
- Only designated compliance officers can access audit logs
- No one can delete audit log entries (including system administrators)
- Access to audit logs is itself logged (meta-audit)
- Audit log queries are logged with the purpose/justification
- Separation of duties: the person who administers the ERP cannot also administer the audit log system
For guidance on how audit trails fit within the broader compliance framework, see our enterprise compliance handbook.
Frequently Asked Questions
How much storage do audit logs require?
Storage requirements depend on transaction volume and log detail level. As a rough guide: a company processing 10,000 ERP transactions per day, with field-level change tracking, generates approximately 2-5 GB of audit log data per month. With 7-year retention (SOX requirement), this translates to 168-420 GB of total audit log storage. Compression typically reduces this by 70-80%. Cloud storage costs for this volume are modest ($50-$200/month), making storage capacity a non-issue.
Can we use the ERP's built-in logging instead of a separate audit system?
For basic compliance, ERP built-in logging may suffice. However, for robust compliance, a separate audit system is recommended for three reasons: immutability (application-level logs can be modified by admin users), separation of duties (audit log administration should be independent from ERP administration), and performance (heavy audit queries should not impact ERP transaction processing).
What happens during system migrations --- do we lose our audit trail?
Audit trail continuity during system migrations is a critical planning consideration. Before migration, archive all existing audit logs in an immutable, regulation-compliant format. During migration, maintain a clear mapping between old and new record identifiers. After migration, verify that audit logging is active in the new system and that historical logs remain accessible. Document the migration itself in the audit trail, including data transformation logic.
How do we handle audit logs for deleted records?
This is a common tension between GDPR (right to erasure) and other regulations (audit trail retention). The recommended approach is to anonymize audit log entries related to deleted records rather than deleting the audit log entries themselves. Replace personal identifiers with anonymous tokens while retaining the record of the action, timestamp, and business context. This satisfies GDPR's privacy requirements while preserving the audit trail for financial and security compliance.
What Is Next
Audit trails are the unsung foundation of compliance. Without them, every other compliance control is unverifiable. Investing in comprehensive, immutable, and well-architected audit logging now saves enormous effort during audits, investigations, and regulatory inquiries.
ECOSIRE builds compliance-ready ERP systems with enterprise-grade audit trails from day one. Our Odoo ERP implementations include field-level change tracking, immutable log storage, and compliance reporting dashboards. For AI-powered audit log analysis and anomaly detection, explore our OpenClaw AI platform. Contact us to discuss your audit trail requirements.
Published by ECOSIRE — helping businesses scale with AI-powered solutions across Odoo ERP, Shopify eCommerce, and OpenClaw AI.
Rédigé par
ECOSIRE Research and Development Team
Création de produits numériques de niveau entreprise chez ECOSIRE. Partage d'analyses sur les intégrations Odoo, l'automatisation e-commerce et les solutions d'entreprise propulsées par l'IA.
Articles connexes
Account Hierarchy Management: Parent-Child Organizations in CRM
Master B2B account hierarchy management with parent-child organization structures, consolidated billing, territory assignment, and CRM best practices in Odoo.
Advanced Production Scheduling: APS, Constraint Theory & Bottleneck Analysis
Master production scheduling with APS, Theory of Constraints & bottleneck analysis. Finite capacity planning, scheduling heuristics & Odoo integration.
API Security Best Practices: Authentication, Authorization & Rate Limiting
Master API security with OAuth2, JWT best practices, RBAC vs ABAC, input validation, rate limiting, and OWASP API Top 10 defenses for business applications.
Plus de Compliance & Regulation
Breach Notification & Incident Response: A Step-by-Step Playbook
Complete incident response playbook with breach notification timelines by regulation, communication templates, forensics fundamentals, and post-incident review.
Carbon Footprint Tracking for Manufacturers: Scope 1, 2 & 3 Emissions
How manufacturers can measure and reduce carbon emissions across Scope 1, 2, and 3 with practical tracking methods, emission factors, and reporting frameworks.
Contract Lifecycle Management: Renewals, Amendments & Compliance
Master contract lifecycle management with automated renewals, amendment tracking, compliance monitoring, and Odoo CLM integration for B2B operations.
Data Privacy Across Regions: CCPA, PDPA, LGPD & PIPEDA Compared
Side-by-side comparison of five major global privacy laws including GDPR, CCPA, PDPA, LGPD, and PIPEDA covering scope, consent, rights, and penalties.
Data Residency & Localization: Where Your Data Lives Matters
Complete guide to data residency and localization requirements covering country-specific rules, cloud region selection, data sovereignty, and transfer mechanisms.
The Enterprise Compliance Handbook: GDPR, SOC2, PCI-DSS & Beyond
Complete enterprise compliance guide covering GDPR, SOC2, PCI-DSS, ISO 27001, and global privacy laws with implementation roadmaps and prioritization frameworks.