skills/encrypted-tunnel-pattern/SKILL.md
Security pattern for channel-level encryption (TLS/SSH). Use when implementing HTTPS, securing all communication between endpoints, setting up TLS connections, or when infrastructure should handle encryption transparently. Addresses "Leak action request or data in transit" problem.
npx skillsauth add igbuend/grimbard encrypted-tunnel-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.
Entities set up a communication channel where ALL exchanges are encrypted. The channel infrastructure handles encryption transparently. Common implementations: TLS and SSH.
Leak action request or data in transit: Any data transmitted over the channel could be observed. Encrypt everything at the channel level.
| Role | Type | Responsibility | |------|------|----------------| | Sender | Entity | Initiates communication | | Receiver | Entity | Receives communication | | EndpointS | Entity | Manages sending end of tunnel | | EndpointR | Entity | Manages receiving end of tunnel | | CryptographerS | Cryptographic Primitive | Encrypts for Sender | | CryptographerR | Cryptographic Primitive | Decrypts for Receiver | | EndpointManagerS | Entity | Configures sender endpoint | | EndpointManagerR | Entity | Configures receiver endpoint |
EndpointManagerS → [initialise(config)] → EndpointS
EndpointManagerR → [initialise(config)] → EndpointR
Sender → [action/data] → EndpointS
EndpointS ↔ EndpointR: [negotiate cipher/key] (if needed)
EndpointS → [encrypt] → CryptographerS → [{x}_k] → EndpointS
EndpointS → [{x}_k] → EndpointR (over channel)
EndpointR → [decrypt] → CryptographerR → [data] → EndpointR
EndpointR → [action/data] → Receiver
Use for safe defaults: https://ssl-config.mozilla.org/
Critical: Always validate certificates
Disabling certificate validation defeats TLS security.
For web applications:
| Aspect | Encrypted Tunnel | Selective Encryption | |--------|-----------------|---------------------| | Scope | All communication | Specific data | | Control | Infrastructure | Application | | Complexity | Lower for application | Higher for application | | Flexibility | Less | More |
Recommendation: Use encrypted tunnel (TLS) as baseline. Add selective encryption for data that needs additional protection (e.g., encrypted at rest AND in transit).
| Misconfiguration | Risk | |-----------------|------| | Certificate validation disabled | MITM attacks | | Old TLS versions enabled | Protocol downgrade | | Weak cipher suites | Cryptographic attacks | | Expired certificates | Connection failures, user warnings | | Self-signed certs in production | Trust issues |
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.