Audit Expert
Expert guidance for security auditing, compliance assessments, code reviews, vulnerability assessments, and regulatory compliance (SOC 2, GDPR, HIPAA, PCI-DSS).
Core Concepts
Audit Types
- Security Audit: Vulnerability assessment, penetration testing
- Code Audit: Code review, static analysis, security patterns
- Compliance Audit: SOC 2, GDPR, HIPAA, PCI-DSS, ISO 27001
- Infrastructure Audit: Configuration review, access control
- Process Audit: SDLC, change management, incident response
Audit Frameworks
- OWASP ASVS (Application Security Verification Standard)
- NIST Cybersecurity Framework
- CIS Controls
- ISO 27001/27002
- SOC 2 Trust Service Criteria
Audit Process
- Planning and scoping
- Information gathering
- Vulnerability identification
- Risk assessment
- Reporting
- Remediation tracking
- Follow-up verification
Audit Reporting
Security Audit Report Template
class SecurityAuditReport {
constructor() {
this.findings = [];
this.summary = {
critical: 0,
high: 0,
medium: 0,
low: 0,
info: 0,
};
}
addFinding(finding) {
this.findings.push({
id: this.findings.length + 1,
severity: finding.severity,
title: finding.title,
description: finding.description,
location: finding.location,
recommendation: finding.recommendation,
references: finding.references || [],
cvssScore: finding.cvssScore,
status: 'open',
discoveredAt: new Date(),
});
this.summary[finding.severity]++;
}
generateReport() {
return {
reportDate: new Date(),
auditor: 'Security Team',
scope: this.scope,
summary: this.summary,
findings: this.findings.sort(
(a, b) =>
this.severityWeight(b.severity) - this.severityWeight(a.severity)
),
recommendations: this.generateRecommendations(),
};
}
severityWeight(severity) {
const weights = { critical: 5, high: 4, medium: 3, low: 2, info: 1 };
return weights[severity] || 0;
}
generateRecommendations() {
return [
'Address all critical and high severity findings immediately',
'Implement security code review process',
'Conduct regular penetration testing',
'Provide security training for developers',
'Establish vulnerability disclosure program',
];
}
}
// Usage
const audit = new SecurityAuditReport();
audit.addFinding({
severity: 'critical',
title: 'SQL Injection in User Search',
description: 'User search endpoint concatenates user input into SQL query',
location: 'src/controllers/users.js:45',
recommendation: 'Use parameterized queries or ORM with proper escaping',
references: ['CWE-89', 'OWASP A03:2021'],
cvssScore: 9.8,
});
const report = audit.generateReport();
Best Practices
Audit Preparation
- Define scope and objectives
- Gather documentation
- Review previous audit findings
- Prepare audit checklist
- Schedule with stakeholders
During Audit
- Follow systematic approach
- Document all findings
- Collect evidence
- Maintain objectivity
- Communicate preliminary findings
Post-Audit
- Prepare detailed report
- Present findings to stakeholders
- Develop remediation plan
- Track remediation progress
- Schedule follow-up audit
Anti-Patterns to Avoid
❌ Auditing own code: Use independent reviewers
❌ Incomplete scope: Define clear boundaries
❌ No follow-up: Track remediation to completion
❌ Generic findings: Provide specific, actionable recommendations
❌ Ignoring context: Consider business requirements
❌ No prioritization: Rank findings by risk and impact
Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- Compliance Auditing — GDPR Compliance Checklist, SOC 2 Compliance Audit, PCI-DSS Compliance
Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- Security Code Review — Authentication Review, SQL Injection Review, Authorization Review, XSS and Output Encoding Review
Resources
1---2name: audit-expert3description: Expert-level security auditing, compliance, code review, and vulnerability assessment. Use when the user mentions compliance, security review, code review, vulnerability assessment, SOC 2, or GDPR, or when the task involves Audit Types, Audit Frameworks, Audit Process, or Authentication Review.4---5
6# Audit Expert
7
8Expert guidance for security auditing, compliance assessments, code reviews, vulnerability assessments, and regulatory compliance (SOC 2, GDPR, HIPAA, PCI-DSS).
9
10## Core Concepts
11
12### Audit Types
13
14- **Security Audit**: Vulnerability assessment, penetration testing
15- **Code Audit**: Code review, static analysis, security patterns
16- **Compliance Audit**: SOC 2, GDPR, HIPAA, PCI-DSS, ISO 27001
17- **Infrastructure Audit**: Configuration review, access control
18- **Process Audit**: SDLC, change management, incident response
19
20### Audit Frameworks
21
22- OWASP ASVS (Application Security Verification Standard)
23- NIST Cybersecurity Framework
24- CIS Controls
25- ISO 27001/27002
26- SOC 2 Trust Service Criteria
27
28### Audit Process
29
301. Planning and scoping
312. Information gathering
323. Vulnerability identification
334. Risk assessment
345. Reporting
356. Remediation tracking
367. Follow-up verification
37
38## Audit Reporting
39
40### Security Audit Report Template
41
42```javascript
43class SecurityAuditReport {
44 constructor() {
45 this.findings = [];
46 this.summary = {
47 critical: 0,
48 high: 0,
49 medium: 0,
50 low: 0,
51 info: 0,
52 };
53 }
54
55 addFinding(finding) {
56 this.findings.push({
57 id: this.findings.length + 1,
58 severity: finding.severity,
59 title: finding.title,
60 description: finding.description,
61 location: finding.location,
62 recommendation: finding.recommendation,
63 references: finding.references || [],
64 cvssScore: finding.cvssScore,
65 status: 'open',
66 discoveredAt: new Date(),
67 });
68
69 this.summary[finding.severity]++;
70 }
71
72 generateReport() {
73 return {
74 reportDate: new Date(),
75 auditor: 'Security Team',
76 scope: this.scope,
77 summary: this.summary,
78 findings: this.findings.sort(
79 (a, b) =>
80 this.severityWeight(b.severity) - this.severityWeight(a.severity)
81 ),
82 recommendations: this.generateRecommendations(),
83 };
84 }
85
86 severityWeight(severity) {
87 const weights = { critical: 5, high: 4, medium: 3, low: 2, info: 1 };
88 return weights[severity] || 0;
89 }
90
91 generateRecommendations() {
92 return [
93 'Address all critical and high severity findings immediately',
94 'Implement security code review process',
95 'Conduct regular penetration testing',
96 'Provide security training for developers',
97 'Establish vulnerability disclosure program',
98 ];
99 }
100}
101
102// Usage
103const audit = new SecurityAuditReport();
104
105audit.addFinding({
106 severity: 'critical',
107 title: 'SQL Injection in User Search',
108 description: 'User search endpoint concatenates user input into SQL query',
109 location: 'src/controllers/users.js:45',
110 recommendation: 'Use parameterized queries or ORM with proper escaping',
111 references: ['CWE-89', 'OWASP A03:2021'],
112 cvssScore: 9.8,
113});
114
115const report = audit.generateReport();
116```
117
118## Best Practices
119
120### Audit Preparation
121
1221. Define scope and objectives
1232. Gather documentation
1243. Review previous audit findings
1254. Prepare audit checklist
1265. Schedule with stakeholders
127
128### During Audit
129
1301. Follow systematic approach
1312. Document all findings
1323. Collect evidence
1334. Maintain objectivity
1345. Communicate preliminary findings
135
136### Post-Audit
137
1381. Prepare detailed report
1392. Present findings to stakeholders
1403. Develop remediation plan
1414. Track remediation progress
1425. Schedule follow-up audit
143
144## Anti-Patterns to Avoid
145
146❌ **Auditing own code**: Use independent reviewers
147❌ **Incomplete scope**: Define clear boundaries
148❌ **No follow-up**: Track remediation to completion
149❌ **Generic findings**: Provide specific, actionable recommendations
150❌ **Ignoring context**: Consider business requirements
151❌ **No prioritization**: Rank findings by risk and impact
152
153## Reference Documentation
154
155Detailed material lives alongside this skill and is read on demand:
156
157- [Compliance Auditing](references/COMPLIANCE_AUDITING.md) — GDPR Compliance Checklist, SOC 2 Compliance Audit, PCI-DSS Compliance
158
159## Reference Documentation
160
161Detailed material lives alongside this skill and is read on demand:
162
163- [Security Code Review](references/SECURITY_CODE_REVIEW.md) — Authentication Review, SQL Injection Review, Authorization Review, XSS and Output Encoding Review
164
165## Resources
166
167- OWASP ASVS: https://owasp.org/www-project-application-security-verification-standard/
168- NIST Framework: https://www.nist.gov/cyberframework
169- CIS Controls: https://www.cisecurity.org/controls/
170- SOC 2: https://www.aicpa.org/interestareas/frc/assuranceadvisoryservices/aicpasoc2report.html
171- GDPR: https://gdpr.eu/
172- PCI-DSS: https://www.pcisecuritystandards.org/