skills/transparent-encrypted-storage-pattern/SKILL.md
Security pattern for full-disk or database-level encryption at rest. Use when implementing Transparent Data Encryption (TDE), full-disk encryption, or when storage infrastructure should handle encryption without application changes. Addresses "Leak data at rest" problem.
npx skillsauth add igbuend/grimbard transparent-encrypted-storage-patternInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Storage infrastructure automatically encrypts all data before writing to disk and decrypts when reading. Application is unaware of encryption—it happens transparently at the storage layer.
Leak data at rest: All stored data could be exposed through physical theft, backup compromise, or unauthorized storage access.
| Role | Type | Responsibility | |------|------|----------------| | Application | Entity | Reads/writes data normally | | Storage Manager | Entity | Intercepts I/O, manages encryption | | Cryptographer | Cryptographic Primitive | Performs encryption/decryption | | Physical Storage | Storage | Stores encrypted data | | Key Manager | Entity | Manages encryption keys |
Application → [write(data)] → Storage Manager
Storage Manager → [encrypt(data)] → Cryptographer
Cryptographer → [{data}_k] → Storage Manager
Storage Manager → [write({data}_k)] → Physical Storage
Application → [read()] → Storage Manager
Storage Manager → [read()] → Physical Storage
Physical Storage → [{data}_k] → Storage Manager
Storage Manager → [decrypt({data}_k)] → Cryptographer
Cryptographer → [data] → Storage Manager
Storage Manager → [data] → Application
Most databases support Transparent Data Encryption:
✓ Physical disk theft ✓ Decommissioned disk exposure ✓ Backup media theft ✓ Unauthorized file system access
✗ Authorized database access (data decrypted for queries) ✗ SQL injection (attacker queries through application) ✗ Application vulnerabilities ✗ Compromised database credentials ✗ Memory attacks (data decrypted in memory)
Important: TDE is ONE layer of defense, not complete protection.
Critical: Key security determines encryption security
Considerations:
Cloud providers offer:
TDE typically encrypts backups automatically:
| Aspect | Transparent | Selective | |--------|-------------|-----------| | Application changes | None | Required | | Granularity | All data | Specific fields | | Protection scope | Storage layer | End-to-end possible | | Query on encrypted | Yes (decrypted for query) | No (unless special techniques) | | Key management | Infrastructure | Application |
Recommendation: Use both when appropriate
development
Security anti-pattern for Cross-Site Scripting vulnerabilities (CWE-79). Use when generating or reviewing code that renders HTML, handles user input in web pages, uses innerHTML/document.write, or builds dynamic web content. Covers Reflected, Stored, and DOM-based XSS. AI code has 86% XSS failure rate.
development
Security anti-pattern for XPath injection vulnerabilities (CWE-643). Use when generating or reviewing code that queries XML documents, constructs XPath expressions, or handles user input in XML operations. Detects unescaped quotes and special characters in XPath queries.
development
Security anti-pattern for weak password hashing (CWE-327, CWE-759). Use when generating or reviewing code that stores or verifies user passwords. Detects use of MD5, SHA1, SHA256 without salt, or missing password hashing entirely. Recommends bcrypt, Argon2, or scrypt.
development
Security anti-pattern for weak encryption (CWE-326, CWE-327). Use when generating or reviewing code that encrypts data, handles encryption keys, or uses cryptographic modes. Detects DES, ECB mode, static IVs, and custom crypto implementations.