Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Security Audit Logging

  • 508 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

security-audit-logging is a Claude Code skill that implements structured security audit logging with retention policies and SIEM integration for developers who need compliance-ready audit trails and forensic visibility.

About

security-audit-logging is an aj-geddes/useful-ai-prompts agent skill for implementing comprehensive security audit logging across user actions, security events, and system changes. The skill covers structured log schemas, retention policies, and SIEM integration for compliance frameworks including SOC 2, HIPAA, and PCI-DSS, plus security monitoring and forensic investigation support. Reference guides and best practices walk agents through audit trail design from quick start through production hardening. Developers reach for security-audit-logging when building compliance logging, wiring events to a SIEM, or adding forensic-grade audit trails to APIs and backend services before launch.

  • Implements structured security audit logging for user actions, system changes, and security events
  • Supports compliance frameworks including SOC 2, HIPAA, and PCI-DSS
  • Includes file rotation, 30-day retention, and Elasticsearch SIEM transport
  • Provides forensic-ready JSON logs with timestamps for breach detection
  • Hard-gate: must be added before exposing any authenticated endpoints

Security Audit Logging by the numbers

  • 508 all-time installs (skills.sh)
  • Ranked #508 of 2,203 Security skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill security-audit-logging

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs508
repo stars305
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you implement compliant security audit logging?

Add structured, compliant audit logging that feeds SIEM systems and supports forensic investigations.

Who is it for?

Backend developers shipping regulated services who need SOC 2, HIPAA, or PCI-DSS audit trails with SIEM-ready structured logging.

Skip if: Applications without compliance requirements that only need basic application debug logging without security audit semantics.

When should I use this skill?

A developer asks to build audit trails, add compliance logging, integrate security events with a SIEM, or meet SOC 2 or HIPAA logging requirements.

What you get

Structured audit log schemas, retention policy configuration, and SIEM-integrated security event streams

  • audit log schema
  • retention policy config
  • SIEM integration hooks

By the numbers

  • Covers 3 compliance frameworks: SOC 2, HIPAA, and PCI-DSS

Files

SKILL.mdMarkdownGitHub ↗

Security Audit Logging

Table of Contents

Overview

Implement comprehensive audit logging for security events, user actions, and system changes with structured logging, retention policies, and SIEM integration.

When to Use

  • Compliance requirements (SOC 2, HIPAA, PCI-DSS)
  • Security monitoring
  • Forensic investigations
  • User activity tracking
  • System change auditing
  • Breach detection

Quick Start

Minimal working example:

// audit-logger.js
const winston = require("winston");
const { ElasticsearchTransport } = require("winston-elasticsearch");

class AuditLogger {
  constructor() {
    this.logger = winston.createLogger({
      level: "info",
      format: winston.format.combine(
        winston.format.timestamp(),
        winston.format.json(),
      ),
      transports: [
        // File transport
        new winston.transports.File({
          filename: "logs/audit.log",
          maxsize: 10485760, // 10MB
          maxFiles: 30,
          tailable: true,
        }),

        // Elasticsearch transport for SIEM
        new ElasticsearchTransport({
          level: "info",
          clientOpts: {
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Node.js Audit LoggerNode.js Audit Logger
Python Audit Logging SystemPython Audit Logging System
Java Audit LoggingJava Audit Logging

Best Practices

✅ DO

  • Log all security events
  • Use structured logging
  • Include timestamps (UTC)
  • Log user context
  • Implement log retention
  • Encrypt sensitive logs
  • Monitor log integrity
  • Send to SIEM
  • Include request IDs

❌ DON'T

  • Log passwords/secrets
  • Log sensitive PII unnecessarily
  • Skip failed attempts
  • Allow log tampering
  • Store logs insecurely
  • Ignore log analysis

Related skills

How it compares

Choose security-audit-logging for compliance-grade audit trails and SIEM wiring; use a general observability skill when only metrics and traces are needed.

FAQ

Which compliance frameworks does security-audit-logging address?

security-audit-logging addresses SOC 2, HIPAA, and PCI-DSS compliance requirements for audit logging. The skill implements structured logs for security events, user actions, and system changes with retention policies and SIEM integration.

What events should security-audit-logging capture?

security-audit-logging captures security events, user actions, and system changes in structured audit logs. The skill guides retention policy design and SIEM forwarding so teams can support security monitoring and forensic investigations.

Securityauditcomplianceappsec

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.