database-security
Skill15 starsChanged 5 months agoCC0-1.0View on GitHub
Examines all database interactions for injection, access control, encryption, and data-exposure risks. Use when auditing database and data-layer security.
- Reads credentials
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 12 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 14
If no target path is given above, review the entire codebase.
- Very specific: line 26
Ensure all queries use placeholders (?, $1, :param) or ORM bindings.
- Distinctive: line 31
No passwords or secrets hardcoded in code or committed to source control.
- Distinctive: line 32
Use environment variables or a secrets manager.
- Distinctive: line 41
Verify disk-level/database-native encryption.
- Distinctive: line 82
Only whitelisted application servers can connect.
- Very specific: line 92
No static passwords in .env files without protection.
- Very specific: line 101
Avoid SELECT *; fetch only required fields.
- Distinctive: line 111
No unprotected dumps in CI/CD or object storage.
- Distinctive: line 126
Must still use parameterized bindings.
- Distinctive: line 151
Use hashed/indexed tokens or partial indexes where needed.
- Distinctive: line 155
No shared admin accounts.
- Distinctive: line 196
Prefer minimal, drop-in fix snippets over prose.
- Distinctive: line 198
Do not invent files or functions that aren’t present.
- Distinctive: line 200
Write this into a markdown file and place it in the audits/ folder.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Target: $ARGUMENTS
If no target path is given above, review the entire codebase.
Database Security Audit
Examine ALL database interactions
Verify:
Parameterized queries or ORM usage
- Ensure all queries use placeholders (
?,$1,:param) or ORM bindings. - Flag any direct string concatenation in queries as CRITICAL.
- Ensure all queries use placeholders (
Connection string security
- No passwords or secrets hardcoded in code or committed to source control.
- Use environment variables or a secrets manager.
Database user permissions (principle of least privilege)
- Application account has only the rights it needs (e.g., no
SUPERUSER,DROP,GRANT). - Separate accounts for read-only, migrations, and admin.
- Application account has only the rights it needs (e.g., no
Sensitive data encryption at rest
- Verify disk-level/database-native encryption.
- Critical fields (e.g., SSN, tokens) use column-level encryption or tokenization.
PII handling compliance
- Personally identifiable information is minimized, redacted in logs, and handled per GDPR/CCPA.
- Retention/deletion policies exist and are enforced.
Query timeout configurations
- Query/statement timeouts configured at driver and DB server level to prevent runaway queries.
Connection pool settings
- Pool limits configured (min/max); no unbounded connections.
- Idle timeouts enforced to prevent exhaustion.
Transaction handling for consistency
- Transactions wrap multi-step operations.
- Rollback paths tested to prevent partial updates.
Audit logging for sensitive operations
- Log access to sensitive tables/fields, schema changes, permission changes, failed logins.
- Logs are centralized, immutable, and monitored.
NoSQL injection hardening (if applicable)
- User input never passed directly to filters.
$where,$ne,$gt,$oroperators blocked/sanitized.- ORM/driver sanitization enabled (e.g.,
mongoose.set('sanitizeFilter', true)).
Row/Tenant isolation
- Row-level security (Postgres RLS) or server-side ownership/tenant filters enforced.
- Multi-tenant queries scoped by server, not client input.
Least-privilege networking
- Database not publicly exposed; network ACLs, VPC, firewall/security groups in place.
- Only whitelisted application servers can connect.
TLS in transit & certificate validation
- DB connections use TLS (
sslmode=require/verify-fullor equivalent). - Certificates validated and rotated.
- DB connections use TLS (
Secret management & rotation
- Credentials stored in a secrets manager, rotated periodically.
- No static passwords in
.envfiles without protection.
Schema & integrity controls
- Foreign keys, unique constraints, and NOT NULL enforced.
- Ownership/tenant columns marked
NOT NULLand validated.
Field-level minimization
- Avoid
SELECT *; fetch only required fields. - Reduces exposure of sensitive columns.
- Avoid
Pagination & query limits
- Hard caps on
LIMIT/page size; prevent unbounded queries that scan entire tables.
- Hard caps on
Backup/restore security
- Backups encrypted, access-controlled, tested for restoration.
- No unprotected dumps in CI/CD or object storage.
Data retention & deletion
- Clear policies for retention, archival, and deletion of PII.
- Secure erasure when data is removed.
Migrations safety
- Migrations run with controlled privileges.
- Destructive operations reviewed; rollback plans exist.
ORM raw-query escape hatch review
- Any
queryRaw/sequelize.query/knex.rawusage audited. - Must still use parameterized bindings.
- Any
LIKE / regex input handling
- Special characters in user input escaped properly (
%,_, regex metacharacters). - Prevents pattern abuse and heavy queries.
- Special characters in user input escaped properly (
Query timeouts & resource guards
- Resource caps enforced (memory, work_mem, CPU).
- Prevent denial-of-service via expensive queries.
Audit & monitoring depth
- Privileged operations (DDL, GRANT, role changes) logged and alerted.
- Centralized monitoring with anomaly detection.
PII in logs/metrics
- ORM debug or query logs do not leak PII or secrets.
- Redaction/allowlisting enforced.
Indexing of sensitive data
- Sensitive fields (e.g., SSN, tokens) not indexed in plaintext.
- Use hashed/indexed tokens or partial indexes where needed.
Service/account lifecycle
- No shared admin accounts.
- Time-bound, purpose-specific service accounts.
- Periodic review of granted privileges.
Caching layers
- Sensitive data not cached in plaintext unless justified.
- Redis/Memcached require auth, not publicly exposed.
Analytics/ETL exports
- PII masked or de-identified before export.
- Exports encrypted, access-controlled, and scrubbed of secrets.
👉 Critical flags:
- Direct string concatenation in queries = CRITICAL.
- Passing raw user JSON into NoSQL queries without sanitization = CRITICAL.
Provide:
A structured finding report with the following for each issue:
Title, Severity (Critical/High/Medium/Low), CWE (if applicable), Evidence (file, function, line ranges), and a short Why it matters.
Exploitability notes and, where safe, a minimal PoC or reproduction steps (no real secrets).
Remediation: precise code-level fix or config change (snippets welcome), plus defense-in-depth guidance.
A summary risk score (0–10) and top 3–5 prioritized fixes that reduce risk fastest.
A checklist diff: which items from the “Check for” list are Pass/Fail/Not Applicable.
Constraints & style:
Be concrete and cite exact code locations and identifiers.
Prefer minimal, drop-in fix snippets over prose.
Do not invent files or functions that aren’t present; if context is missing, mark as Unable to verify and say what code would prove it.
Write this into a markdown file and place it in the audits/ folder.
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- zhaoxuya520/reverse-skill-private★ 40ksame name
- zhaoxuya520/reverse-skill★ 38ksame name
- lza6/claw-code-tingfeng★ 5same name
- Rootx202/appsec-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- api-and-infrastructureSkill
- authentication-flow-reviewSkill
- authorization-implementationSkill
- business-logic-vulnerabilitiesSkill
- code-duplication-detectionSkill
- code-quality-metrics-standardsSkill
- comprehensive-security-reportSkill
- design-pattern-implementationSkill
- error-handling-resilienceSkill
- exception-flow-analysisSkill
- file-handling-business-logicSkill
- initial-security-analysisSkill
- initial-software-design-analysisSkill
- input-validationSkill
- logging-monitoringSkill
- readability-and-namingSkill
- resilience-fault-toleranceSkill
- secrets-management-auditSkill
- session-cookie-securitySkill
- solid-principlesSkill
- testing-implementationSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

