Cybersecurity

From erikstmartin/dotfiles · View interactive version

Cybersecurity is an AI agent skill from the GitHub repository erikstmartin/dotfiles. Use for security audits, vulnerability remediation, hardening configs, and secure coding patterns. Not for compliance frameworks or policy writing.

How to use this skill

Skill file

Cybersecurity

When to Use

Workflow

1. Threat Model First

Before writing code, identify:

2. Audit

Systematic check in priority order:

Secrets & Credentials:

Authentication & Authorization:

Input Validation:

# WRONG: trusting user input
query = f"SELECT * FROM users WHERE id = {request.args['id']}"

# RIGHT: parameterized queries
cursor.execute("SELECT * FROM users WHERE id = %s", (request.args['id'],))

Dependency Security:

# Check for known vulnerabilities
npm audit --production
pip-audit
cargo audit
trivy image myapp:latest

Transport & Encryption:

3. Harden

Container hardening:

# Non-root user
RUN adduser -D appuser
USER appuser

# Minimal base image
FROM gcr.io/distroless/static:nonroot

# No secrets in layers
# Use multi-stage builds, copy only artifacts

Network hardening:

Application hardening:

# Security headers (nginx example)
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options DENY;
add_header Content-Security-Policy "default-src 'self'";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";

4. Verify

Common Pitfalls

| Pitfall | Fix |

|---------|-----|

| SQL injection via string concat | Always use parameterized queries |

| Secrets in Docker layers | Multi-stage build, copy only artifacts |

| JWT validated client-side only | Always verify server-side with secret |

| CORS wildcard (*) in production | Explicit allowed origins list |

| Running containers as root | USER directive + read-only filesystem |

| Logging sensitive data | Sanitize logs, never log tokens/passwords |

| Outdated dependencies with CVEs | Automated audit in CI pipeline |

Output Expectations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.