skills/security-compliance/financial-compliance-sox/SKILL.md
Implement SOX-compliant financial controls for ecommerce with audit trails, segregation of duties, access controls, and compliance-ready transaction logging
npx skillsauth add finsilabs/awesome-ecommerce-skills financial-compliance-soxInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
SOX (Sarbanes-Oxley Act) Section 302 and 404 require publicly traded companies to maintain documented internal controls over financial reporting (ICFR). For e-commerce, this means implementing controls across the order-to-cash and procure-to-pay cycles: segregation of duties (no single person can initiate and approve a financial transaction), approval workflows for high-value transactions, automated reconciliation, and immutable audit evidence. SOX compliance is primarily a process and documentation challenge, not a software challenge — but the systems you build must generate auditable evidence that controls are operating.
Before any configuration or code, document which systems contain financial data and what controls apply. SOX auditors want to see this documentation:
Order-to-Cash control points:
Procure-to-Pay control points:
Document each control with:
Shopify does not provide SOX-specific tooling, but you can implement key controls using platform features and third-party integrations.
Access controls (segregation of duties):
Approval workflows for high-value orders: Shopify does not have native approval workflows. Use Shopify Flow (Shopify/Plus) to create a hold-and-notify workflow:
Reconciliation:
Change management evidence: For Shopify theme and app changes:
WooCommerce gives you more control over role-based access and custom approval workflows.
Role-based access (segregation of duties):
High-value order approval workflow: Install WooCommerce Order Approval (free) or YITH WooCommerce Order Approval (~$70/year):
Audit logging: Install Simple History (free plugin) to capture all WooCommerce admin actions with user attribution, timestamps, and before/after values.
Monthly reconciliation:
User access controls:
Approval workflows: BigCommerce does not have native approval workflows. Options:
Reconciliation: Use the BigCommerce Analytics → Revenue report and compare against your payment processor settlement. Export both as CSV and document the comparison monthly.
For custom storefronts, implement the controls programmatically. The three most critical controls for a SOX audit are: segregation of duties enforcement, approval workflows with evidence capture, and automated reconciliation.
Segregation of duties — role model:
enum FinancialRole {
ORDER_ENTRY = 'order_entry',
ORDER_APPROVER = 'order_approver',
CASH_RECEIPTS = 'cash_receipts',
PO_REQUESTER = 'po_requester',
PO_APPROVER = 'po_approver',
PAYMENT_INITIATOR = 'payment_initiator',
PAYMENT_APPROVER = 'payment_approver',
AUDITOR = 'auditor', // Read-only — zero transaction capability
}
// SOD conflicts — these role combinations are prohibited
const SOD_CONFLICTS: [FinancialRole, FinancialRole][] = [
[FinancialRole.PO_REQUESTER, FinancialRole.PO_APPROVER],
[FinancialRole.PAYMENT_INITIATOR, FinancialRole.PAYMENT_APPROVER],
[FinancialRole.PO_REQUESTER, FinancialRole.PAYMENT_APPROVER],
[FinancialRole.ORDER_ENTRY, FinancialRole.ORDER_APPROVER],
];
function hasSodConflict(roles: FinancialRole[]): { conflict: boolean; pairs: [FinancialRole, FinancialRole][] } {
const conflicts = SOD_CONFLICTS.filter(([a, b]) => roles.includes(a) && roles.includes(b));
return { conflict: conflicts.length > 0, pairs: conflicts };
}
// Enforce SOD when assigning roles
async function assignRoles(userId: string, newRoles: FinancialRole[], assignedBy: string) {
const { conflict, pairs } = hasSodConflict(newRoles);
if (conflict) {
throw new Error(`SOD conflict: ${pairs.map(([a, b]) => `${a} + ${b}`).join(', ')}`);
}
await db.userRoles.setRoles(userId, newRoles);
// Log to immutable audit trail
await auditLog.record({ eventType: 'user_roles_changed', actorId: assignedBy, aggregateId: userId,
afterState: { roles: newRoles }, controlRef: 'SOX-ITGC-AC-001' });
}
High-value order approval control:
const HIGH_VALUE_THRESHOLD_CENTS = 1_000_000; // $10,000
async function processOrderApproval(orderId: string, approverId: string) {
const order = await db.orders.findById(orderId);
const approver = await db.users.findById(approverId);
if (order.total_cents >= HIGH_VALUE_THRESHOLD_CENTS) {
const hasRole = approver.roles.includes(FinancialRole.ORDER_APPROVER);
await auditLog.record({
eventType: 'high_value_order_approval_check',
aggregateId: orderId,
actorId: approverId,
afterState: { orderTotal: order.total_cents, hasApprovalRole: hasRole, outcome: hasRole ? 'pass' : 'fail' },
controlRef: 'SOX-OTC-001',
});
if (!hasRole) throw new Error('ORDER_APPROVER role required for orders above $10,000');
}
}
Monthly reconciliation automation:
async function runMonthlyReconciliation(month: Date) {
const [ordersRevenue, processorSettlements] = await Promise.all([
db.orders.sumRevenue(month),
paymentProcessor.getSettlementsForMonth(month),
]);
const varianceCents = ordersRevenue.totalCents - processorSettlements.totalCents;
const outcome = Math.abs(varianceCents) <= 100 ? 'pass' : 'exception'; // $1 tolerance
await auditLog.record({
eventType: 'monthly_revenue_reconciliation',
aggregateId: month.toISOString().slice(0, 7),
actorId: 'system_recon_job',
afterState: { ordersRevenue: ordersRevenue.totalCents, processorSettlements: processorSettlements.totalCents, varianceCents, outcome },
controlRef: 'SOX-OTC-RECON-001',
});
if (outcome === 'exception') {
await alertFinanceTeam(`Reconciliation exception: ${varianceCents / 100} variance for ${month.toISOString().slice(0, 7)}`);
}
}
Quarterly user access review:
async function generateQuarterlyAccessReview(quarter: string) {
const financialUsers = await db.users.findWithFinancialRoles();
const report = {
quarter,
generatedAt: new Date().toISOString(),
users: financialUsers.map(u => ({
userId: u.id, email: u.email,
roles: u.financialRoles,
lastLogin: u.lastLoginAt,
dormant: !u.lastLoginAt || u.lastLoginAt < new Date(Date.now() - 90 * 86400000),
sodConflict: hasSodConflict(u.financialRoles).conflict,
})),
};
report.exceptions = report.users.filter(u => u.dormant || u.sodConflict);
// Route to manager for sign-off with 30-day deadline
await routeForManagerApproval(report);
await auditLog.record({ eventType: 'quarterly_access_review_generated', aggregateId: quarter,
actorId: 'system', afterState: { exceptionCount: report.exceptions.length }, controlRef: 'SOX-ITGC-AC-002' });
return report;
}
control_ref should return all evidence| Problem | Solution |
|---------|----------|
| SOD conflicts exist because role enforcement was added after users were onboarded | Run a one-time SOD scan on all existing user-role assignments; generate exception tickets and remediate before the audit period begins |
| Audit log is mutable — DBA can delete rows | Revoke DELETE from all database roles; use a separate log aggregation service (CloudWatch Logs, Datadog) as a tamper-evident secondary copy |
| Control evidence is missing for weekends and holidays | Controls must operate every day the financial system processes transactions; reconciliation jobs must run 7 days a week |
| Approval controls bypassed via a direct API call | Every financial mutation endpoint must check the control in the service layer, not just the UI; the control function is called in service code, never only in the controller |
| Change management evidence missing for hotfixes | All production changes — including hotfixes — must go through code review; create a hotfix branch type with the same review requirements as main |
tools
Let shoppers save products to a wishlist, share it with friends, and get notified when saved items come back in stock or drop in price
development
Build a themeable storefront with design tokens and CSS custom properties that supports white-labeling, multi-brand variants, and dark mode
development
Speed up product discovery with instant search suggestions, fuzzy typo matching, and category-aware results powered by Algolia or Elasticsearch
development
Build a mobile-first storefront with thumb-friendly navigation, sticky add-to-cart buttons, and touch-optimized components for high mobile conversion