
Security Documentation
- 407 installs
- 305 repo stars
- Updated March 4, 2026
- aj-geddes/useful-ai-prompts
security-documentation is a compliance documentation skill that drafts security policies, control matrices, and audit evidence packages for developers and security teams preparing internal governance or external assessme
About
security-documentation is a useful-ai-prompts skill for producing structured security and compliance documentation. It guides creation of security policies, access-control guidelines, incident response plans, vulnerability disclosure policies, and audit-ready evidence covering authentication, data protection, application security, and infrastructure controls. Reference guides cover password requirements, MFA, RBAC, secure coding practices, security headers, and API security patterns. Developers and security engineers reach for security-documentation when preparing SOC 2, GDPR, or HIPAA documentation, onboarding assessors, or standardizing secure development practices across teams. The skill ships policy templates with version, review schedule, and ownership metadata plus best-practice checklists for least privilege, encryption, logging, and employee training.
- Writes policies aligned to SOC2, ISO, and GDPR expectations
- Documents data flows, access controls, and encryption practices
- Produces control matrices linking requirements to implementations
- Prepares customer security questionnaire responses
Security Documentation by the numbers
- 407 all-time installs (skills.sh)
- Ranked #554 of 2,203 Security skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill security-documentationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 407 |
|---|---|
| repo stars | ★ 305 |
| Last updated | March 4, 2026 |
| Repository | aj-geddes/useful-ai-prompts ↗ |
How do you write SOC 2 security policy docs?
Draft security policies, architecture docs, control matrices, and audit evidence packages for internal teams and external assessors.
Who is it for?
Security engineers and tech leads preparing formal security policies, compliance packets, or assessor-facing documentation for regulated products.
Skip if: Developers who only need automated SAST scanning, penetration test execution, or runtime vulnerability patching without policy authoring.
When should I use this skill?
A developer needs security policies, compliance documentation, control matrices, incident response plans, or audit evidence for SOC 2, GDPR, or HIPAA.
What you get
Security policy documents, compliance control matrices, incident response plans, and audit evidence packages with versioned ownership metadata.
- Security policy documents
- Control matrices
- Incident response plans
By the numbers
- Bundles 5 reference guides covering password rules, MFA, RBAC, secure coding, and security headers
Files
Security Documentation
Table of Contents
Overview
Create comprehensive security documentation including policies, guidelines, compliance requirements, and best practices for secure application development and operations.
When to Use
- Security policies
- Compliance documentation (SOC 2, GDPR, HIPAA)
- Security guidelines and best practices
- Incident response plans
- Access control policies
- Data protection policies
- Vulnerability disclosure policies
- Security audit reports
Quick Start
Minimal working example:
# Security Policy
**Version:** 2.0
**Last Updated:** 2025-01-15
**Review Schedule:** Quarterly
**Owner:** Security Team
**Contact:** security@example.com
## Table of Contents
1. [Overview](#overview)
2. [Scope](#scope)
3. [Authentication & Access Control](#authentication--access-control)
4. [Data Protection](#data-protection)
5. [Application Security](#application-security)
6. [Infrastructure Security](#infrastructure-security)
7. [Incident Response](#incident-response)
8. [Compliance](#compliance)
9. [Security Training](#security-training)
---
## 1. Overview
### Purpose
// ... (see reference guides for full implementation)Reference Guides
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| 1 Password Requirements | 1 Password Requirements |
| 2 Multi-Factor Authentication (MFA) | 2 Multi-Factor Authentication (MFA) |
| 3 Role-Based Access Control (RBAC) | 3 Role-Based Access Control (RBAC) |
| 1 Secure Coding Practices | 1 Secure Coding Practices |
| 2 Security Headers | 2 Security Headers, 3 API Security |
Best Practices
✅ DO
- Follow principle of least privilege
- Encrypt sensitive data
- Implement MFA everywhere
- Log security events
- Regular security audits
- Keep systems updated
- Document security policies
- Train employees regularly
- Have incident response plan
- Test backups regularly
❌ DON'T
- Store passwords in plaintext
- Skip input validation
- Ignore security headers
- Share credentials
- Hardcode secrets in code
- Skip security testing
- Ignore vulnerability reports
1 Password Requirements
1 Password Requirements
Minimum Requirements:
- Length: Minimum 12 characters
- Complexity: Mix of uppercase, lowercase, numbers, and symbols
- History: Cannot reuse last 5 passwords
- Expiration: 90 days (for privileged accounts)
- Lockout: 5 failed attempts triggers 30-minute lockout
Example Strong Password:
Good: MyC0mplex!Pass#2025
Bad: password123
Implementation:
// Password validation
function validatePassword(password) {
const minLength = 12;
const requirements = {
length: password.length >= minLength,
uppercase: /[A-Z]/.test(password),
lowercase: /[a-z]/.test(password),
number: /[0-9]/.test(password),
special: /[!@#$%^&*(),.?":{}|<>]/.test(password)
};
return Object.values(requirements).every(Boolean);
}1 Secure Coding Practices
1 Secure Coding Practices
Input Validation:
// ✅ Good - Validate and sanitize input
const validator = require("validator");
function createUser(req, res) {
const { email, name } = req.body;
// Validate email
if (!validator.isEmail(email)) {
return res.status(400).json({ error: "Invalid email" });
}
// Sanitize name
const sanitizedName = validator.escape(name);
// Use parameterized queries
db.query("INSERT INTO users (email, name) VALUES ($1, $2)", [
email,
sanitizedName,
]);
}
// ❌ Bad - SQL injection vulnerability
function createUserBad(req, res) {
const { email, name } = req.body;
db.query(`INSERT INTO users VALUES ('${email}', '${name}')`);
}XSS Prevention:
// Content Security Policy headers
app.use((req, res, next) => {
res.setHeader(
"Content-Security-Policy",
"default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';",
);
next();
});
// Sanitize output
import DOMPurify from "isomorphic-dompurify";
function renderComment(comment) {
const clean = DOMPurify.sanitize(comment, {
ALLOWED_TAGS: ["b", "i", "em", "strong"],
ALLOWED_ATTR: [],
});
return clean;
}2 Multi-Factor Authentication (MFA)
2 Multi-Factor Authentication (MFA)
Requirements:
- Mandatory for:
- Production system access
- Administrative accounts
- Customer-facing applications
- VPN access
- Source code repositories
Supported Methods:
1. TOTP (Google Authenticator, Authy) 2. SMS (backup only, not primary) 3. Hardware tokens (YubiKey) 4. Biometric (fingerprint, Face ID)
Implementation:
// MFA verification
async function verifyMFA(userId, token) {
const user = await User.findById(userId);
const secret = user.twoFactorSecret;
// Verify TOTP token
const isValid = speakeasy.totp.verify({
secret,
encoding: "base32",
token,
window: 2, // Allow 1 minute time drift
});
if (isValid) {
await logSecurityEvent("mfa_success", userId);
return true;
}
await logSecurityEvent("mfa_failure", userId);
return false;
}2 Security Headers
2 Security Headers
// Security headers middleware
app.use((req, res, next) => {
// Prevent clickjacking
res.setHeader("X-Frame-Options", "DENY");
// XSS protection
res.setHeader("X-Content-Type-Options", "nosniff");
res.setHeader("X-XSS-Protection", "1; mode=block");
// HTTPS enforcement
res.setHeader(
"Strict-Transport-Security",
"max-age=31536000; includeSubDomains",
);
// Referrer policy
res.setHeader("Referrer-Policy", "strict-origin-when-cross-origin");
next();
});3 API Security
Rate Limiting:
const rateLimit = require("express-rate-limit");
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // limit each IP to 100 requests per windowMs
message: "Too many requests from this IP",
standardHeaders: true,
legacyHeaders: false,
});
app.use("/api/", limiter);---
3 Role-Based Access Control (RBAC)
3 Role-Based Access Control (RBAC)
Principle of Least Privilege: Users receive minimum access needed for their role.
Roles:
| Role | Permissions | Access Level |
|---|---|---|
| Admin | Full system access | Read/Write/Delete All |
| Developer | Code, staging env | Read/Write Dev/Staging |
| Support | Customer data (limited) | Read customer data |
| Auditor | Logs, audit trails | Read-only all |
| User | Own data only | Read/Write own data |
Implementation:
// Permission middleware
const requirePermission = (permission) => {
return async (req, res, next) => {
const user = req.user;
const userPermissions = await getUserPermissions(user.role);
if (!userPermissions.includes(permission)) {
await logSecurityEvent("unauthorized_access", user.id, {
permission,
endpoint: req.path,
});
return res.status(403).json({
error: "Insufficient permissions",
required: permission,
});
}
next();
};
};
// Usage
app.delete("/api/users/:id", requirePermission("users:delete"), deleteUser);---
#!/bin/bash
# security-checklist.sh - Generate a security review checklist
# Usage: ./security-checklist.sh [--output checklist.md]
set -euo pipefail
OUTPUT="${{1:-/dev/stdout}}"
cat > "$OUTPUT" << 'CHECKLIST'
# Security Review Checklist
## Authentication & Authorization
- [ ] All endpoints require authentication
- [ ] Role-based access control implemented
- [ ] Session management is secure
## Input Validation
- [ ] All user inputs are validated
- [ ] SQL injection prevention
- [ ] XSS prevention
## Data Protection
- [ ] Sensitive data encrypted at rest
- [ ] Sensitive data encrypted in transit
- [ ] PII handling compliant
## TODO: Add domain-specific security checks
CHECKLIST
echo "Checklist generated: $OUTPUT" >&2
Related skills
How it compares
Pick security-documentation over vulnerability-scanning skills when the deliverable is written policies and compliance evidence rather than automated code findings.
FAQ
What compliance frameworks does security-documentation cover?
security-documentation addresses SOC 2, GDPR, and HIPAA requirements in policy templates. Guides cover authentication, MFA, RBAC, data protection, application and infrastructure security, incident response, and security training sections assessors expect.
What documents does security-documentation produce?
security-documentation produces security policies, access-control guidelines, incident response plans, vulnerability disclosure policies, and audit evidence packages. Templates include version numbers, quarterly review schedules, and named security team ownership.