Overview
The invariant: no request reaches a response without authentication, per-object authorization, and the security headers that block the exploit class the surface introduces. Proactive threat modeling, automated API security defense, fine-grained access control (BOLA/IDOR) enforcement, strict HTTP security header hardening, and continuous CIS compliance benchmarking all serve that rule.
[Phase 1: Threat Modeling & Surface Recon] ──► [Phase 2: Access & Auth Gate Audit] ──► [Phase 3: Vulnerability Remediation]
│
[Phase 5: Continuous Defense & CIS] ◄── [Phase 4: Defensive Hardening] ◄──────┘
The security engineer operates on the principle of defense-in-depth, enforcing least privilege, zero trust boundaries, and parameter validation across all internal and public attack surfaces.
When to Use
- When conducting end-to-end application security reviews and defensive threat modeling.
- When evaluating and mitigating OWASP Top 10 vulnerabilities (SQLi, XSS, SSRF, BOLA/IDOR).
- When implementing or auditing RBAC/ABAC authorization barriers across API endpoints.
- When hardening web applications with strict Content Security Policy (CSP), HSTS, and CORS rules.
- When assessing AWS, GCP, or Azure environments against CIS Security Benchmarks.
- When reviewing third-party dependency vulnerabilities and automated SAST/DAST scanner outputs.
When NOT to Use
- When conducting external offensive penetration tests or red team exploits (use
cybersecurity/role-penetration-tester).
- When fixing general application logic bugs unrelated to security or auth (use
development/role-software-engineer).
- When managing general CI/CD deployment pipelines or Docker build caches (use
devops/role-devops-sre-engineer).
- When performing financial risk modeling or quantitative trading (use
trading/role-quantitative-trader).
Deterministic Dispatch Matrix
| Security Challenge / Attack Vector |
Delegated Child Skill |
Primary Defensive Artifact |
| Comprehensive cybersecurity routing and triage across 790+ playbooks |
cybersecurity/cybersecurity-router |
Triage classification and specialized playbook assignment |
| Aggressive API vulnerability fuzzing, rate limit evasion, and injection defense |
cybersecurity/api-destroyer |
API threat report, rate limiting rules, and parameter sanitization |
| Insecure direct object references, cross-tenant data leaks, BOLA/BFLA |
cybersecurity/testing-for-broken-access-control |
Object-level auth matrix and tenant isolation unit tests |
| Automated vulnerability assessment, CVE triage, and patch prioritization |
cybersecurity/vulnerability-scanner |
Vulnerability assessment ledger with verified EPSS/CVSS ranking |
| Defensive Boundary Hardening |
cybersecurity/developing-security-headers |
Hardened reverse proxy / web framework security header config |
| Comprehensive blue team defensive tooling catalog |
cybersecurity/blue-team-tools-catalog |
Selected tool capabilities mapped to defensive requirements |
| Blue team threat hunting operations |
cybersecurity/blue-team-threat-hunting-tools |
Hunt infrastructure tracking, validated detections |
| Digital forensics and incident response |
cybersecurity/blue-team-digital-forensics-and-incident-response |
Forensic reports, disk image evidence, timeline reconstruction |
| Vulnerability scanning report lifecycle and documentation |
cybersecurity/vulnerability-scanner-report |
Vulnerability assessment report with remediation plan |
| Continuous vulnerability monitoring and triage workflow |
cybersecurity/vulnerability-monitoring-workflow |
Live vulnerability dashboard with SLAs |
| Comprehensive threat modeling for application risk |
cybersecurity/threat-modeling |
Threat model diagram, STRIDE mapping, control gaps |
Workflow
Phase 1: Attack Surface Reconnaissance & Threat Modeling
- Map exposed ingress routes, unauthenticated endpoints, and external webhook receivers.
- For broad, multi-vector investigations, dispatch to
cybersecurity/cybersecurity-router to assign specialized domain sub-playbooks.
- Classify sensitive assets (PII, tokens, payment data, cryptographic secrets).
Phase 2: Authentication & Authorization Gate Audit
- Audit session lifetimes, token signatures, and role-based permissions.
- Dispatch to
cybersecurity/testing-for-broken-access-control to verify tenant scoping and prevent cross-account IDOR vulnerabilities.
- Validate that every database mutation explicitly checks
where userId = currentUser.id.
Phase 3: Vulnerability Scanning & Exploit Mitigation
- Execute automated SAST/DAST sweeps using
cybersecurity/vulnerability-scanner.
- Subject external endpoints to stress and parameter tampering tests via
cybersecurity/api-destroyer.
- Eliminate injection paths by requiring parameterized SQL queries and typed ORM bindings.
- Block SSRF vectors by enforcing IP allowlists and disabling loopback/private subnet requests (127.0.0.1, 10.0.0.0/8, 169.254.169.254).
Phase 4: Defensive Boundary Hardening
- Implement hardened HTTP security headers using
development/security-headers (strict CSP, HSTS, X-Frame-Options: DENY, X-Content-Type-Options: nosniff).
- Enforce
HttpOnly, SameSite=Strict, and Secure attributes on all session cookies.
- Configure API Gateway rate limiting and burst throttling.
Phase 5: Cloud Posture & Compliance Benchmarking
- Run infrastructure posture audits via
cybersecurity/auditing-cloud-with-cis-benchmarks.
- Verify zero public S3/Blob storage buckets, enforce KMS encryption at rest, and rotate stale access keys.
- Generate signed security compliance audit receipt with zero high/critical unmitigated findings.
Anti-Rationalization Table
| Security Excuse |
Flawed Rationalization |
Required AppSec Discipline |
| "The endpoint is hidden; nobody will guess the URL" |
"Security through obscurity is sufficient for internal tools." |
Obscurity is zero protection. Implement explicit authentication and authorization on every route. |
| "We trust our internal network and microservices" |
"Requests behind the firewall do not need authentication." |
Zero Trust architecture requires mutual authentication (mTLS/JWT) at every service boundary. |
| "A WAF will block any SQL injections" |
"We don't need to rewrite legacy queries if Cloudflare is on." |
WAFs can be bypassed via encoding tricks. Parameterize queries at the application level. |
"CORS with * is fine for quick frontend dev" |
"It prevents frontend connection errors." |
Wildcard CORS exposes authenticated user data to malicious origins. Explicitly whitelist exact origins. |
| "Fixing low/medium CVEs can wait for next quarter" |
"Only critical CVEs are actively exploited." |
Attackers chain low-severity info disclosures and misconfigurations into critical RCEs. Remediate systematically. |
Implementation Examples
Automated Security Headers Auditor (Python)
import urllib.request
import sys
from typing import Dict, List
REQUIRED_HEADERS: Dict[str, str] = {
"X-Frame-Options": "DENY",
"X-Content-Type-Options": "nosniff",
"Strict-Transport-Security": "max-age=",
"Content-Security-Policy": "default-src",
"Referrer-Policy": "strict-origin-when-cross-origin",
}
def audit_security_headers(target_url: str) -> List[str]:
"""Audits a live HTTP endpoint for mandatory security headers."""
print(f"Auditing security headers for: {target_url}")
req = urllib.request.Request(target_url, headers={"User-Agent": "SecurityAuditor/1.0"})
try:
with urllib.request.urlopen(req, timeout=5) as resp:
headers = {k.title(): v for k, v in resp.headers.items()}
except Exception as e:
print(f"Connection failed: {e}")
return ["Target unreachable"]
violations: List[str] = []
for header, expected_snippet in REQUIRED_HEADERS.items():
val = headers.get(header.title())
if not val:
violations.append(f"MISSING: Header '{header}' not present in response.")
elif expected_snippet not in val:
violations.append(f"WEAK: Header '{header}: {val}' lacks required '{expected_snippet}'.")
return violations
if __name__ == "__main__":
print("Security header auditing framework initialized.")
Automated CIS Bucket Permission Audit (Bash)
#!/usr/bin/env bash
set -euo pipefail
BUCKET_NAME="${1:-production-assets-bucket}"
echo "=== Auditing S3 Bucket Public Access Block: $BUCKET_NAME ==="
PUBLIC_BLOCK=$(aws s3api get-public-access-block --bucket "$BUCKET_NAME" --query "PublicAccessBlockConfiguration" --output json)
BLOCK_PUBLIC_ACLS=$(echo "$PUBLIC_BLOCK" | grep -o '"BlockPublicAcls": true' || true)
IGNORE_PUBLIC_ACLS=$(echo "$PUBLIC_BLOCK" | grep -o '"IgnorePublicAcls": true' || true)
BLOCK_PUBLIC_POLICY=$(echo "$PUBLIC_BLOCK" | grep -o '"BlockPublicPolicy": true' || true)
RESTRICT_PUBLIC_BUCKETS=$(echo "$PUBLIC_BLOCK" | grep -o '"RestrictPublicBuckets": true' || true)
if [ -n "$BLOCK_PUBLIC_ACLS" ] && [ -n "$IGNORE_PUBLIC_ACLS" ] && [ -n "$BLOCK_PUBLIC_POLICY" ] && [ -n "$RESTRICT_PUBLIC_BUCKETS" ]; then
echo "SUCCESS: Bucket $BUCKET_NAME complies with CIS public access block benchmark."
else
echo "ERROR: Bucket $BUCKET_NAME has exposed public access settings!"
exit 1
fi
Verification Checklist
npm install -g cli-tool
1---2name: role-security-engineer3description: Use when orchestrating application security defenses, threat modeling,4 API vulnerability mitigation, access control enforcement, security headers, and5 cloud compliance.6domain: cybersecurity7author: oyi778version: 1.0.09category: cybersecurity10tags:11- security12- appsec13- cybersecurity14- threat-modeling15- access-control16license: MIT17subdomain: security-engineering18triggers:19- security engineer role20- threat model21- security headers audit22- idor bola audit23- cis benchmark24- cloud hardening25- access control audit26- api vulnerability27metadata:28 source: https://skillmd.com/skills/oyi77/role-security-engineer29---303132## Overview3334The invariant: no request reaches a response without authentication, per-object authorization, and the security headers that block the exploit class the surface introduces. Proactive threat modeling, automated API security defense, fine-grained access control (BOLA/IDOR) enforcement, strict HTTP security header hardening, and continuous CIS compliance benchmarking all serve that rule.3536```37[Phase 1: Threat Modeling & Surface Recon] ──► [Phase 2: Access & Auth Gate Audit] ──► [Phase 3: Vulnerability Remediation]38 │39 [Phase 5: Continuous Defense & CIS] ◄── [Phase 4: Defensive Hardening] ◄──────┘40```4142The security engineer operates on the principle of defense-in-depth, enforcing least privilege, zero trust boundaries, and parameter validation across all internal and public attack surfaces.4344## When to Use4546- When conducting end-to-end application security reviews and defensive threat modeling.47- When evaluating and mitigating OWASP Top 10 vulnerabilities (SQLi, XSS, SSRF, BOLA/IDOR).48- When implementing or auditing RBAC/ABAC authorization barriers across API endpoints.49- When hardening web applications with strict Content Security Policy (CSP), HSTS, and CORS rules.50- When assessing AWS, GCP, or Azure environments against CIS Security Benchmarks.51- When reviewing third-party dependency vulnerabilities and automated SAST/DAST scanner outputs.5253## When NOT to Use5455- When conducting external offensive penetration tests or red team exploits (use `cybersecurity/role-penetration-tester`).56- When fixing general application logic bugs unrelated to security or auth (use `development/role-software-engineer`).57- When managing general CI/CD deployment pipelines or Docker build caches (use `devops/role-devops-sre-engineer`).58- When performing financial risk modeling or quantitative trading (use `trading/role-quantitative-trader`).5960## Deterministic Dispatch Matrix6162| Security Challenge / Attack Vector | Delegated Child Skill | Primary Defensive Artifact |63|---|---|---|64| Comprehensive cybersecurity routing and triage across 790+ playbooks | `cybersecurity/cybersecurity-router` | Triage classification and specialized playbook assignment |65| Aggressive API vulnerability fuzzing, rate limit evasion, and injection defense | `cybersecurity/api-destroyer` | API threat report, rate limiting rules, and parameter sanitization |66| Insecure direct object references, cross-tenant data leaks, BOLA/BFLA | `cybersecurity/testing-for-broken-access-control` | Object-level auth matrix and tenant isolation unit tests |67| Automated vulnerability assessment, CVE triage, and patch prioritization | `cybersecurity/vulnerability-scanner` | Vulnerability assessment ledger with verified EPSS/CVSS ranking |68| Defensive Boundary Hardening | `cybersecurity/developing-security-headers` | Hardened reverse proxy / web framework security header config |69| Comprehensive blue team defensive tooling catalog | `cybersecurity/blue-team-tools-catalog` | Selected tool capabilities mapped to defensive requirements |70| Blue team threat hunting operations | `cybersecurity/blue-team-threat-hunting-tools` | Hunt infrastructure tracking, validated detections |71| Digital forensics and incident response | `cybersecurity/blue-team-digital-forensics-and-incident-response` | Forensic reports, disk image evidence, timeline reconstruction |72| Vulnerability scanning report lifecycle and documentation | `cybersecurity/vulnerability-scanner-report` | Vulnerability assessment report with remediation plan |73| Continuous vulnerability monitoring and triage workflow | `cybersecurity/vulnerability-monitoring-workflow` | Live vulnerability dashboard with SLAs |74| Comprehensive threat modeling for application risk | `cybersecurity/threat-modeling` | Threat model diagram, STRIDE mapping, control gaps |7576## Workflow7778### Phase 1: Attack Surface Reconnaissance & Threat Modeling79801. Map exposed ingress routes, unauthenticated endpoints, and external webhook receivers.812. For broad, multi-vector investigations, dispatch to `cybersecurity/cybersecurity-router` to assign specialized domain sub-playbooks.823. Classify sensitive assets (PII, tokens, payment data, cryptographic secrets).8384### Phase 2: Authentication & Authorization Gate Audit85861. Audit session lifetimes, token signatures, and role-based permissions.872. Dispatch to `cybersecurity/testing-for-broken-access-control` to verify tenant scoping and prevent cross-account IDOR vulnerabilities.883. Validate that every database mutation explicitly checks `where userId = currentUser.id`.8990### Phase 3: Vulnerability Scanning & Exploit Mitigation91921. Execute automated SAST/DAST sweeps using `cybersecurity/vulnerability-scanner`.932. Subject external endpoints to stress and parameter tampering tests via `cybersecurity/api-destroyer`.943. Eliminate injection paths by requiring parameterized SQL queries and typed ORM bindings.954. Block SSRF vectors by enforcing IP allowlists and disabling loopback/private subnet requests (127.0.0.1, 10.0.0.0/8, 169.254.169.254).9697### Phase 4: Defensive Boundary Hardening98991. Implement hardened HTTP security headers using `development/security-headers` (strict CSP, HSTS, X-Frame-Options: DENY, X-Content-Type-Options: nosniff).1002. Enforce `HttpOnly`, `SameSite=Strict`, and `Secure` attributes on all session cookies.1013. Configure API Gateway rate limiting and burst throttling.102103### Phase 5: Cloud Posture & Compliance Benchmarking1041051. Run infrastructure posture audits via `cybersecurity/auditing-cloud-with-cis-benchmarks`.1062. Verify zero public S3/Blob storage buckets, enforce KMS encryption at rest, and rotate stale access keys.1073. Generate signed security compliance audit receipt with zero high/critical unmitigated findings.108109## Anti-Rationalization Table110111| Security Excuse | Flawed Rationalization | Required AppSec Discipline |112|---|---|---|113| "The endpoint is hidden; nobody will guess the URL" | "Security through obscurity is sufficient for internal tools." | Obscurity is zero protection. Implement explicit authentication and authorization on every route. |114| "We trust our internal network and microservices" | "Requests behind the firewall do not need authentication." | Zero Trust architecture requires mutual authentication (mTLS/JWT) at every service boundary. |115| "A WAF will block any SQL injections" | "We don't need to rewrite legacy queries if Cloudflare is on." | WAFs can be bypassed via encoding tricks. Parameterize queries at the application level. |116| "CORS with `*` is fine for quick frontend dev" | "It prevents frontend connection errors." | Wildcard CORS exposes authenticated user data to malicious origins. Explicitly whitelist exact origins. |117| "Fixing low/medium CVEs can wait for next quarter" | "Only critical CVEs are actively exploited." | Attackers chain low-severity info disclosures and misconfigurations into critical RCEs. Remediate systematically. |118119## Implementation Examples120121### Automated Security Headers Auditor (Python)122123```python124import urllib.request125import sys126from typing import Dict, List127128REQUIRED_HEADERS: Dict[str, str] = {129 "X-Frame-Options": "DENY",130 "X-Content-Type-Options": "nosniff",131 "Strict-Transport-Security": "max-age=",132 "Content-Security-Policy": "default-src",133 "Referrer-Policy": "strict-origin-when-cross-origin",134}135136def audit_security_headers(target_url: str) -> List[str]:137 """Audits a live HTTP endpoint for mandatory security headers."""138 print(f"Auditing security headers for: {target_url}")139 req = urllib.request.Request(target_url, headers={"User-Agent": "SecurityAuditor/1.0"})140 141 try:142 with urllib.request.urlopen(req, timeout=5) as resp:143 headers = {k.title(): v for k, v in resp.headers.items()}144 except Exception as e:145 print(f"Connection failed: {e}")146 return ["Target unreachable"]147148 violations: List[str] = []149 for header, expected_snippet in REQUIRED_HEADERS.items():150 val = headers.get(header.title())151 if not val:152 violations.append(f"MISSING: Header '{header}' not present in response.")153 elif expected_snippet not in val:154 violations.append(f"WEAK: Header '{header}: {val}' lacks required '{expected_snippet}'.")155156 return violations157158if __name__ == "__main__":159 print("Security header auditing framework initialized.")160```161162### Automated CIS Bucket Permission Audit (Bash)163164```bash165#!/usr/bin/env bash166set -euo pipefail167168BUCKET_NAME="${1:-production-assets-bucket}"169170echo "=== Auditing S3 Bucket Public Access Block: $BUCKET_NAME ==="171PUBLIC_BLOCK=$(aws s3api get-public-access-block --bucket "$BUCKET_NAME" --query "PublicAccessBlockConfiguration" --output json)172173BLOCK_PUBLIC_ACLS=$(echo "$PUBLIC_BLOCK" | grep -o '"BlockPublicAcls": true' || true)174IGNORE_PUBLIC_ACLS=$(echo "$PUBLIC_BLOCK" | grep -o '"IgnorePublicAcls": true' || true)175BLOCK_PUBLIC_POLICY=$(echo "$PUBLIC_BLOCK" | grep -o '"BlockPublicPolicy": true' || true)176RESTRICT_PUBLIC_BUCKETS=$(echo "$PUBLIC_BLOCK" | grep -o '"RestrictPublicBuckets": true' || true)177178if [ -n "$BLOCK_PUBLIC_ACLS" ] && [ -n "$IGNORE_PUBLIC_ACLS" ] && [ -n "$BLOCK_PUBLIC_POLICY" ] && [ -n "$RESTRICT_PUBLIC_BUCKETS" ]; then179 echo "SUCCESS: Bucket $BUCKET_NAME complies with CIS public access block benchmark."180else181 echo "ERROR: Bucket $BUCKET_NAME has exposed public access settings!"182 exit 1183fi184```185186## Verification Checklist187188- [ ] All public endpoints protected by authenticated session and object-level authorization (IDOR/BOLA free).189- [ ] Database queries parameterized with zero dynamic SQL string concatenations.190- [ ] SSRF defense blocks local loopbacks and internal cloud metadata endpoints.191- [ ] HTTP responses enforce strict CSP, HSTS, X-Frame-Options, and secure cookie attributes.192- [ ] Cloud storage and compute resources comply with CIS Benchmark hardening baselines.193- [ ] Formal security audit report emitted with zero unmitigated high/critical vulnerabilities.194195`npm install -g cli-tool`