Generate Secure and Compliant Audit Logs
A skill that designs and generates tamper-evident audit logs meeting SOX, GDPR, HIPAA, and PCI-DSS compliance requirements.
Why it matters
Automate the generation of comprehensive, secure, and compliant audit logs to meet regulatory requirements and enhance operational monitoring.
Outcomes
What it gets done
Define and enforce essential log elements including timestamps, event IDs, actors, actions, resources, sources, results, and risk levels.
Implement structured log formats like JSON and CEF with specific fields for compliance (GDPR, SOX, HIPAA).
Ensure log integrity through immutability, cryptographic signatures, and separate storage.
Generate real-time alerts and regular reports based on audit log data.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-audit-log-generator | bash Overview
Audit Log Generator агент
This skill generates structured, tamper-evident audit log entries with a fixed schema and regulation-specific context blocks for SOX, GDPR, and HIPAA, plus retention, encryption, and alerting policy. Use it when building audit logging that must survive regulatory review, not routine application debug logging.
What it does
This skill designs, implements, and generates security and compliance audit logs, covering regulatory requirements (SOX, GDPR, HIPAA, PCI-DSS), structured log formats, retention policies, and security best practices for audit trails. Every log entry follows a fixed schema: a millisecond-precision UTC timestamp, a unique event ID for correlation, the actor (user ID or service account), the action (CREATE, READ, UPDATE, DELETE), the resource affected (table, file, or record ID), the source (IP address, application, or system), the result (success, failure, or partial completion), and a risk-level classification (critical, high, medium, low). Log integrity requirements mandate append-only immutability after write, cryptographic signatures for tamper detection, storage separated from operational systems, regular integrity verification, and chain-of-custody documentation.
When to use - and when NOT to
Use it when designing or generating audit logs that must hold up under regulatory review - SOX financial-data tracking, GDPR lawful-basis and cross-border-transfer context, or HIPAA PHI handling. It is not a general application-logging skill: audit logs generated this way are deliberately immutable, tamper-evident, and stored separately from operational systems, which adds overhead not appropriate for routine debug logging.
Inputs and outputs
Given an event to log, it outputs a structured entry in one of two formats: a recommended JSON format (nested actor, resource, context, result, and metadata objects including compliance tags, retention years, and a checksum) or CEF (Common Event Format) for SIEM ingestion. It classifies events into four categories: authentication (login attempts, password changes, MFA activations, account lockouts, privilege escalations), data access (with data classification, access method, record count, and a query hash), administrative (configuration changes, access grants and revocations, permission changes, maintenance, backup and restore), and security (failed authorization attempts, anomalous access patterns, policy violations, incident response actions). For state-changing operations it also supports before/after state tracking with a change reason and approver, and batch-operation logging with total, successful, and failed record counts plus processing duration.
{
"timestamp": "2024-01-15T14:30:45.123Z",
"event_id": "evt_7f4a9b2c8e1d",
"version": "1.0",
"actor": {
"user_id": "john.doe@company.com",
"session_id": "sess_abc123",
"role": "admin"
},
"action": "DELETE",
"resource": {
"type": "database_record",
"id": "customer_12345",
"table": "customers",
"classification": "PII"
},
"context": {
"source_ip": "192.168.1.100",
"user_agent": "Mozilla/5.0...",
"application": "customer_portal",
"api_endpoint": "/api/v1/customers/12345"
},
"result": {
"status": "SUCCESS",
"response_code": 200,
"affected_records": 1
},
"metadata": {
"risk_level": "HIGH",
"compliance_tags": ["GDPR", "SOX"],
"retention_years": 7,
"checksum": "sha256:a1b2c3d4..."
}
}
Integrations
Adds compliance-specific context blocks per regulation: GDPR (lawful basis, data subject ID, processing purpose, retention justification, cross-border transfer flag), SOX (financial-data access tracking, segregation of duties, change-management documentation, executive access monitoring), and HIPAA (PHI involvement, minimum-necessary standard, covered entity, business associate, patient authorization). Security controls layer on top: AES-256 encryption at rest and TLS 1.3 in transit with per-log-type keys rotated at least quarterly, role-based log access policies (separate read, search, export, and retention-management permissions), and tamper detection via Merkle trees, PKI digital signatures, and immutable timestamp services.
Who it's for
Security, compliance, and platform engineering teams who need audit logs built for regulatory review from the start - with defined retention policies (for example, authentication logs kept 3 years with 90 days hot storage, security incidents kept 10 years with 1095 days hot storage), performance practices like async and buffered writes with graceful degradation on logging failure, and real-time alerting on failed-authentication spikes, privileged-access patterns, and data-exfiltration indicators, plus daily, weekly, monthly, and quarterly compliance reporting.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.