db-hardening
Skill0 starsChanged 11 days agoMITView on GitHub
Harden database servers and managed databases — network exposure, TLS, authentication methods (pg_hba, SQL auth vs. Windows/Entra), dangerous features (xp_cmdshell, COPY PROGRAM, LOAD DATA LOCAL), encryption at rest/TDE, patching, backups encryption — against CIS benchmarks. Use when deploying or reviewing a database, after finding an internet-exposed database, or remediating database benchmark findings.
In this repository273 other files it gives its agents.
- ad-attack-path-analysisSkill
- adcs-security-reviewSkill
- ad-privileged-access-reviewSkill
- dcsync-detectionSkill
- gpo-security-reviewSkill
- kerberos-attack-detectionSkill
- agent-tool-permission-reviewSkill
- ai-incident-responseSkill
- llm-gateway-controlsSkill
- llm-security-evaluationSkill
- mcp-server-security-reviewSkill
- model-artifact-securitySkill
- prompt-injection-reviewSkill
- rag-security-reviewSkill
- api-abuse-detectionSkill
- api-authorization-testingSkill
- api-inventorySkill
- api-schema-securitySkill
- dast-baselineSkill
- sast-triageSkill
- sca-dependency-riskSkill
- secure-code-reviewSkill
- security-requirementsSkill
- threat-modelingSkill
- asset-criticality-tieringSkill
- asset-inventory-reconciliationSkill
- external-attack-surface-reviewSkill
- shadow-it-discoverySkill
- aws-credential-compromiseSkill
- aws-iam-reviewSkill
- aws-org-guardrailsSkill
- cloudtrail-investigationSkill
- guardduty-triageSkill
- s3-exposure-reviewSkill
- azure-activity-investigationSkill
- azure-rbac-reviewSkill
- conditional-access-reviewSkill
- entra-audit-investigationSkill
- entra-signin-investigationSkill
- backup-assuranceSkill
- critical-service-mappingSkill
- ransomware-recoverySkill
- recovery-exerciseSkill
- cloud-exposure-reviewSkill
- cloud-incident-responseSkill
- cloud-logging-baselineSkill
- cloud-posture-assessmentSkill
- audit-evidence-packageSkill
- continuous-control-monitoringSkill
- control-mappingSkill
- control-testing-samplingSkill
- container-incidentSkill
- dockerfile-hardeningSkill
- image-scanningSkill
- runtime-detection-falcoSkill
- db-audit-loggingSkill
- db-exfiltration-investigationSkill
- db-privilege-reviewSkill
- data-classificationSkill
- data-discoverySkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Not internet-reachable; private subnets/endpoints only (cloud-exposure-review: PubliclyAccessible, public IP on Azure SQL/Cloud SQL, open …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Database Hardening
Exposure and network
- Not internet-reachable; private subnets/endpoints only (
cloud-exposure-review:PubliclyAccessible, public IP on Azure SQL/Cloud SQL, open 1433/3306/5432/27017/6379/9200). - Host firewall / security groups restrict to app tiers and admin jump hosts.
- NoSQL/search engines: authentication enabled (MongoDB
security.authorization: enabled, Redisrequirepass/ACLs +protected-mode yes, Elasticsearch security features on) — unauthenticated instances are mass-scanned and ransomed within hours.
Authentication & transport
- PostgreSQL
pg_hba.conf:hostssl+scram-sha-256, notrust, no0.0.0.0/0for admin roles;ssl = on;password_encryption = scram-sha-256. - SQL Server: Windows/Entra authentication preferred; if SQL auth, enforce policy; disable
saor rename + strong secret; force encryption. - MySQL:
require_secure_transport=ON,caching_sha2_password, no anonymous users.
Dangerous features
| Engine | Disable/restrict |
| SQL Server | xp_cmdshell, Ole Automation Procedures, CLR (clr enabled/clr strict security), Ad Hoc Distributed Queries, cross-db ownership chaining — check with SELECT name, value_in_use FROM sys.configurations WHERE name IN ('xp_cmdshell','clr enabled','Ole Automation Procedures','Ad Hoc Distributed Queries'); |
| PostgreSQL | pg_execute_server_program/pg_read_server_files grants, untrusted languages (plpython3u) for non-admins, COPY ... PROGRAM |
| MySQL | local_infile=OFF, secure_file_priv set to a dedicated dir or NULL, FILE privilege |
| Oracle | Default accounts locked, UTL_* package grants to PUBLIC revoked |
Data protection
Encryption at rest (TDE / managed storage encryption with KMS keys), encrypted backups with restricted access, masking in non-prod copies, audit logging (db-audit-logging).
Patch & version
Supported major versions only; track CVEs for the engine; managed services' maintenance windows enabled.
Related skills
db-privilege-review, db-audit-logging, cloud-exposure-review, linux-hardening
References
- CIS Benchmarks for PostgreSQL, MySQL, SQL Server, Oracle, MongoDB: https://www.cisecurity.org/cis-benchmarks
- PostgreSQL client authentication (pg_hba.conf): https://www.postgresql.org/docs/current/auth-pg-hba-conf.html
- MongoDB security checklist: https://www.mongodb.com/docs/manual/administration/security-checklist/
- Redis security: https://redis.io/docs/latest/operate/oss_and_stack/management/security/
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.

