goul4rt/lgpd-skills / skills/lgpd-audit-logging
lgpd-audit-logging
VerifiedDesign and implement tamper-evident, transactionally serialized audit logging as a recommended engineering control for LGPD accountability (Art. 6, X) and security (Art. 46). Outputs Prisma schema, concurrency-safe hash-chain writer, DB write-protection triggers, and external WORM/SIEM anchoring verification.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.2 KB |
| assets/audit-log.prisma | other | 1.2 KB |
| assets/audit-log.ts | script | 7.9 KB |
assets/audit-log.prisma
View on GitHub// Trilha de auditoria encadeada (hash chain) — controle técnico recomendado para
// responsabilização (Art. 6º, X) e segurança (Art. 46).
enum ActorType {
USER
ADMIN
SYSTEM
OPERATOR
}
model AuditLogEntry {
id String @id @default(cuid())
seq BigInt @unique @default(autoincrement()) // ordem estrita de encadeamento
actorId String? // null quando ação automática de sistema
actorType ActorType
action String // ex.: "DSAR_FULFILLED", "CONSENT_REVOKED", "PII_EXPORT"
resource String // ex.: "User:usr_123"
subjectId String? // titular afetado (quando aplicável)
legalBasis String?
purpose String?
ipAddress String? @db.Inet
userAgent String?
payloadHash String // SHA-256 canônico de metadados redigidos (NUNCA PII em claro)
prevHash String // "GENESIS" no primeiro registro, ou selfHash do seq anterior
selfHash String // SHA-256(prevHash | timestampIso | actorType | actorId | action | resource | subjectId | payloadHash)
timestamp DateTime @default(now())
@@index([subjectId, timestamp(sort: Desc)])
@@index([actorId, timestamp(sort: Desc)])
@@index([action, timestamp(sort: Desc)])
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |