Compliance frameworks (SOC2, HIPAA, GDPR, PCI DSS) with control mappings and implementation guidance
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Compliance frameworks (SOC2, HIPAA, GDPR, PCI DSS) with control mappings and implementation guidance
Compliance & Security Standards Skill
Framework-specific compliance guidance for regulated industries: SOC2 Type II, HIPAA, GDPR, and PCI DSS. Includes control mappings, audit logging patterns, data residency rules, and scope reduction strategies.
Overview
Compliance is a multi-layer problem: legal obligations (what must be done), technical controls (how to implement), and operational processes (who does it). This skill focuses on technical controls and their code-level implementation.
PCI DSS (Payment Card Industry Data Security Standard)
Scope Reduction Strategy
Golden Rule: Don't store card data. Use a payment processor (Stripe, Square, PayPal) to tokenize and store; keep only the token.
Minimal Implementation (Scope Reduced)
Control
Implementation
No card storage
All card data goes directly to Stripe; you store only token
No PAN (Primary Account Number) in logs
Never log or error-message card numbers
TLS for all card transmissions
HTTPS only; no cleartext HTTP
Access control
Only backend can request card tokens; frontend never sees raw data
Code Pattern
Stripe Tokenization (Recommended):
// Frontend: Use Stripe Elements (handles PCI compliance)const stripe = require('@stripe/stripe-js');
const card = elements.create('card');
card.mount('#card-element');
// When user submits formconst { token } = await stripe.createToken(card);
// Token is sent to backend, NOT card numberawaitfetch('/api/payment', {
method: 'POST',
body: JSON.stringify({ token: token.id })
});
Backend: Process Token (Not Card Data):
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
app.post('/api/payment', async (req, res) => {
// req.body.token is a Stripe token, not card dataconst charge = await stripe.charges.create({
amount: 9999, // in centscurrency: 'usd',
source: req.body.token, // Token, not cardmetadata: {
order_id: req.body.orderId,
user_id: req.user.id
}
});
// Log transaction (NO card data logged)
auditLog.record({
action: 'PAYMENT',
user_id: req.user.id,
amount: 9999,
charge_id: charge.id,
timestamp: newDate()
});
res.json({ success: true, charge_id: charge.id });
});
What NOT to Do (PCI Violations)
// ❌ DO NOT store card data
app.post('/api/payment', async (req, res) => {
await db.payment.create({
cardNumber: req.body.cardNumber, // ❌ VIOLATIONcvv: req.body.cvv, // ❌ VIOLATIONexpiryDate: req.body.expiryDate// ❌ VIOLATION
});
});
// ❌ DO NOT log card data
logger.info(`Payment for user ${userId} with card ${cardNumber}`); // ❌ VIOLATION// ❌ DO NOT send card data over HTTP
app.post('http://api.example.com/payment', { cardNumber: '...' }); // ❌ VIOLATION (HTTP not HTTPS)
Compliance Audit Checklist
Pre-Audit Preparation
Data classification complete (mark all fields as PII, PHI, payment data, etc.)
Audit logging implemented (immutable, tamper-proof, all access logged)
Encryption enabled (at rest: database; in transit: TLS 1.2+)
Access control implemented (RBAC, MFA for admin, session management)