scanning-database-security
БесплатноЗапускает вложенные скриптыНе проверенProcess use when you need to work with security and compliance. This skill provides security scanning and vulnerability detection with comprehensive guidance…
от jeremylongshore★ 2 961 звезда на GitHubОб этом скилле
Database Security Scanner
Overview
Audit database security configurations, user privileges, network exposure, and data protection controls for PostgreSQL, MySQL, and MongoDB. This skill scans for common vulnerabilities including excessive privileges, missing encryption, default passwords, exposed network ports, unpatched versions, and SQL injection vectors in application code.
Prerequisites
- Database admin credentials for querying system catalogs and security settings
psql,mysql, ormongoshCLI tools installed- Access to database configuration files (
postgresql.conf,pg_hba.conf,my.cnf,mongod.conf) - Application source code access for SQL injection scanning (using Grep/Glob tools)
- Knowledge of applicable compliance frameworks (SOC 2, HIPAA, PCI-DSS, GDPR)
Instructions
Check authentication configuration by reviewing
pg_hba.conf(PostgreSQL) ormysql.usertable. Flag any entries usingtrustauthentication, allowing connections without passwords. Verifypassword_encryption = scram-sha-256(notmd5) in PostgreSQL.Audit user privileges by querying role memberships and grants:
- PostgreSQL:
SELECT r.rolname, r.rolsuper, r.rolinherit, r.rolcreaterole, r.rolcreatedb FROM pg_roles r WHERE r.rolcanlogin = true - MySQL:
SELECT user, host, Super_priv, Grant_priv, File_priv FROM mysql.user - Flag users with superuser/SUPER privilege, excessive grants, or
GRANT OPTION
- PostgreSQL:
Scan for default or weak credentials. Check for accounts with no password: PostgreSQL
SELECT rolname FROM pg_roles WHERE rolpassword IS NULL AND rolcanlogin = true. Check for well-known default accounts (postgres with default password, root without password, admin/admin).Verify network security:
- Check
listen_addressesin postgresql.conf (should not be*in production without firewall) - Verify SSL/TLS is enforced:
SHOW sslshould returnon;pg_hba.confshould usehostsslinstead ofhost - Confirm database port is not exposed to the public internet
- Check
Check encryption at rest:
- Verify tablespace encryption or volume-level encryption is enabled
- Scan for sensitive data stored in plaintext:
SELECT column_name, data_type FROM information_schema.columns WHERE column_name ILIKE '%password%' OR column_name ILIKE '%ssn%' OR column_name ILIKE '%credit_card%' - Flag columns storing PII without encryption or hashing
Scan application source code for SQL injection vulnerabilities using Grep:
- Search for string concatenation in SQL queries: patterns like
"SELECT * FROM " + variableor Python f-strings with interpolated table names - Search for missing parameterized queries: raw SQL construction without bind parameters
- Flag ORM
raw()orexecute()calls with string interpolation
- Search for string concatenation in SQL queries: patterns like
Review database object permissions:
- Check for PUBLIC grants on sensitive tables:
SELECT grantee, table_name, privilege_type FROM information_schema.table_privileges WHERE grantee = 'PUBLIC' - Verify functions are created with
SECURITY DEFINERonly when necessary - Check for world-readable backup files on the filesystem
- Check for PUBLIC grants on sensitive tables:
Audit logging configuration:
- Verify
log_connections = on,log_disconnections = onin PostgreSQL - Check
log_statement = 'ddl'or'all'for sensitive databases - Confirm audit logs are shipped to a tamper-proof location
- Verify
Check for known CVEs by comparing the database version against the latest security advisories. Flag databases running versions with known critical vulnerabilities.
Generate a security findings report with severity levels (Critical, High, Medium, Low), affected components, evidence (query output showing the vulnerability), and specific remediation commands.
Output
- Security findings report with severity-ranked vulnerabilities and evidence
- Remediation scripts (SQL) for revoking excessive privileges, fixing authentication, enabling SSL
- Hardened configuration templates for postgresql.conf, pg_hba.conf, or my.cnf
- SQL injection findings listing vulnerable code locations with fix suggestions
- Compliance checklist mapping findings to SOC 2, HIPAA, or PCI-DSS controls
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Permission denied querying pg_roles or mysql.user | Scanner account lacks privilege to read user metadata | Grant pg_read_all_settings and pg_read_all_stats roles; or run scan with superuser credentials in a controlled session |
| Cannot access postgresql.conf from SQL | File-system access restricted; pg_file_settings view not available |
Use SHOW ALL to check runtime settings; request file access from ops team; use pg_settings catalog view |
| SSL certificate errors during scan | Self-signed certificates or expired certificates on database | Note as a finding; generate new certificates with openssl; configure ssl_cert_file and ssl_key_file |
| Source code scan produces false positives | Dynamic |
Установить scanning-database-security в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditGrepGlobBash(psql:*)Bash(mysql:*)Bash(mongosh:*)Вложенные файлы
FAQ
Что делает скилл scanning-database-security?
Process use when you need to work with security and compliance. This skill provides security scanning and vulnerability detection with comprehensive guidance and automation. Trigger with phrases like "scan for vulnerabilities", "implement security controls", or "audit security".
Как установить скилл scanning-database-security?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл scanning-database-security запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic