Skip to content
Skills Library
Security · Review & audit

database-security

/database-security

Secure database access in SaaS applications — SQL/NoSQL injection prevention with prepared statements, least-privilege DB accounts, encryption, Redis/MongoDB hardening, backups and migrations. Use for MySQL, MariaDB, PostgreSQL, MongoDB and Redis reviews.

Licence
MIT
Last repository change
07.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 07.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Secure database access in SaaS applications — SQL/NoSQL injection prevention with prepared statements, least-privilege DB accounts, encryption, Redis/MongoDB hardening, backups and migrations. Use for MySQL, MariaDB, PostgreSQL, MongoDB and Redis reviews.

Original author description

Secure database access in SaaS applications — SQL/NoSQL injection prevention with prepared statements, least-privilege DB accounts, encryption, Redis/MongoDB hardening, backups and migrations. Use for MySQL, MariaDB, PostgreSQL, MongoDB and Redis reviews.

How it works

  1. Objectives
  2. Steps
  3. Security rules
  4. Validation criteria
Original SKILL.md headings · 49 lines, 386 words
SKILL.md preview
---
name: database-security
description: Secure database access in SaaS applications — SQL/NoSQL injection prevention with prepared statements, least-privilege DB accounts, encryption, Redis/MongoDB hardening, backups and migrations. Use for MySQL, MariaDB, PostgreSQL, MongoDB and Redis reviews.
---

# Database security

Part of saas-blind-security — created and maintained by IbrahimCodeur.

## Objectives

- No query can be altered by user input.
- Database credentials and network exposure follow least privilege.
- Sensitive data is encrypted where required and backups are protected.

## Steps

1. **Inventory data access**: ORM (Eloquent, Django ORM, Prisma, TypeORM, Sequelize, Mongoose,
   SQLAlchemy), query builders, raw SQL, stored procedures, migrations, reporting queries.
2. **Injection review.** Search raw-query APIs: `DB::raw/select/statement`, `whereRaw/orderByRaw`,
   `->query()`, `mysqli_query`, `cursor.execute`, `.raw()`, `.extra()`, `text()`, `$queryRawUnsafe`,
   `sequelize.query`, template literals in SQL. All values must be bound parameters. Identifiers (column
   names, sort direction) cannot be bound: validate against an allow-list. Semgrep rules
   `sbs-*-sqli-*` give leads.
3. **NoSQL.** Mongo filters must not accept raw request objects (`{$ne: null}`, `$where`, `$regex`
   injection). Cast types or validate with a schema; set `sanitizeFilter` in Mongoose ≥ 6 where suitable.
4. **Accounts & network.** Application user without SUPER/DDL rights in production (migrations with a
   separate account where practical); DB not exposed publicly (bind to private network, firewall);
   TLS for remote connections; strong unique passwords from the environment; Redis with `requirepass`/ACLs,
   `protected-mode yes`, not bound to `0.0.0.0` on a public interface; MongoDB authentication enabled.
5. **Data protection.** Hash passwords (never encrypt); encrypt highly sensitive columns (API tokens of
   integrations, OAuth refresh tokens, personal identifiers) with framework encryption (Laravel
   `encrypted` cast, Django field encryption libraries) with keys outside the DB; consider PostgreSQL
   Row-Level Security for multi-tenant tables.
6. **Errors & logging.** No SQL errors shown to users; slow-query logs must not contain secrets.
7. **Backups.** Encrypted at rest, access-restricted, tested restore, retention policy, deleted-tenant data
   handled according to the deletion policy.
8. **Migrations.** Reversible, no data loss without approval, no default credentials or seed admin accounts
   in production seeds.

## Security rules

- Never run destructive SQL or migrations on shared/production databases during an audit.
- Never paste real connection strings or data samples into reports.
- Fix injection with parameterisation, not with escaping functions or blacklist filters.

## Validation criteria

- [ ] No string-built query with external input remains (Semgrep rules clean or justified).
- [ ] Tests with injection payloads (`' OR 1=1 --`, `{"$ne": null}`) return normal "not found"/validation errors.
- [ ] DB/Redis not reachable from the internet (config reviewed; verified if environment is available).
- [ ] Backup and restore procedure documented.

Versions

RepositoryScoreLicence
This page · IbrahimCodeur/saas-blind-security90MIT
redhatproductsecurity/prodsec-skills100Apache-2.0
jeremymorgan/code-review-skills90CC0-1.0

Database snapshot: 13.11.2026 · package version f92c40ed3d35 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90database-engineer
    Database architecture design, schema optimization, query performance tuning, and data migration. Handles PostgreSQL, MySQL, MongoDB, Redis. Use when user asks to design database, optimize queries, create migrations, or improve database performance. Do NOT use for frontend or application logic.
  • 95database-expert
    Advanced database design and administration for PostgreSQL, MongoDB, and Redis. Use when designing schemas, optimizing queries, managing database performance, or implementing data patterns.
  • 98db-audit-logging
    Configure and use database audit logging for security — PostgreSQL pgaudit, MySQL/MariaDB audit plugins, SQL Server Audit, Oracle Unified Auditing, cloud database audit (RDS, Azure SQL, Cloud SQL), MongoDB auditing — capturing logins, privilege changes, schema changes and…
  • 100agent-database-expert
    Specialist subagent: Expert database architect and engineer for PostgreSQL, MongoDB, Redis, and all major databases. Use when designing schemas, optimizing queries, planning migrations, implementing caching, or troubleshooting database performance.
  • 95data-storage-migrations
    Use this capability for database schema design, SQL/NoSQL selection, migrations, indexing, query review, connection pooling, backups, object storage, event storage, data retention, and data lifecycle planning. Trigger on database, schema, migration, index, SQL, PostgreSQL,…
  • 90redis-elasticache-security
    Secure Redis and Amazon ElastiCache for Redis deployments with authentication, encryption, and network isolation. Use when building, reviewing, or auditing Redis cache configuration, ElastiCache clusters, or application-to-cache connectivity.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.