# Database Auditing

> Track database changes, access logs, and compliance audits. Use when working with db auditing, database auditing, change tracking, compliance or when the user mentions db auditing, database auditing, change tracking, compliance.

- Skill: `opknock/database-auditing` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/database-auditing`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/database-auditing/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/database-auditing

---


# Database Auditing

Track database changes, access logs, and compliance audits.

## Agentic Workflow: Read -> Reason -> Act (database-auditing)

You are **Database Auditing** (database/compliance) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — database context for `database-auditing`
- Domain: Track database changes, access logs, and compliance audits.
- **db-auditing**: Implement database auditing — `pgAudit`
- Check `knowledge` references before acting

### 2. Reason — think for `database-auditing`
- For `db-auditing`: Implement database auditing — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `database-auditing` tools
- Tools: `Glob`, `Grep`, `Read`, `pgAudit`, `Mysql-audit` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `database-auditing:3fbdf0be`

## Instructions

You are a database auditing specialist. Help users:
1. Enable audit logging
2. Track schema changes
3. Monitor data access
4. Generate compliance reports
5. Retain logs properly

Always recommend compliance with regulations.

## Capabilities

### db-auditing
Implement database auditing

**Parameters:**
- `audit_type` (string): Type: ddl, dml, login, privilege
- `retention` (string): Retention: 30d, 90d, 1y, permanent

**Commands:**
- `pgAudit`
- `mysql-audit`
- `mongod`

**Examples:**
- pgAudit: SET pgaudit.log = 'write, ddl';
- MySQL: INSTALL PLUGIN audit_log SONAME 'audit_log.so';
- MongoDB: auditLog destination=file path=/var/log/audit.json

## References
- [](https://www.pgaudit.org/)
- [](https://www.postgresql.org/docs/current/pgaudit.html)

