aj-geddes avatar

Security Audit Logging

This gives you structured audit logging with compliance in mind. It covers the essentials like Winston for Node.js with Elasticsearch transport, retention policies, and proper formatting with timestamps and request IDs. The best practices section is solid on the obvious stuff like never logging passwords and always logging failed attempts. If you're dealing with SOC 2, HIPAA, or PCI-DSS requirements, this gets you most of the way there. The reference guides show implementations across Node.js, Python, and Java, which is helpful if you're working in a polyglot environment. The main value is having the SIEM integration patterns ready to go rather than figuring out the transport configuration yourself.

skills.sh installs
568
GitHub stars
379
last updated
Aug 21, 2026

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill security-audit-logging --agent claude-code

Installs into .claude/skills of the current project.

Files

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,
        }),

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Security, DevOps & CI/CD, AI & Agent Building
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258

Recommended

More Security
1longbridge avatarlongbridge-security-listlongbridge/skillsUS overnight-eligible securities directory and HK broker participant directory via Longbridge Securities. `security-list` covers the US overnight-trading catalo524skills.sh installs
2smartchainark avatarskill-security-auditsmartchainark/skill-security-auditDetect malicious patterns in AI Agent skills — 13 detectors for backdoors, credential theft, data exfiltration, and supply-chain attacks. Based on SlowMist's Cl519skills.sh installs
3aj-geddes avatarcsrf-protectionaj-geddes/useful-ai-promptsImplement Cross-Site Request Forgery (CSRF) protection using tokens, SameSite cookies, and origin validation. Use when building forms and state-changing operati477skills.sh installs
4aj-geddes avatarnetwork-security-groupsaj-geddes/useful-ai-promptsConfigure network security groups and firewall rules to control inbound/outbound traffic and implement network segmentation.446skills.sh installs
5davila7 avatarinformation-security-manager-iso27001davila7/claude-code-templatesSenior Information Security Manager specializing in ISO 27001 and ISO 27002 implementation for HealthTech and MedTech companies. Provides ISMS implementation, c428skills.sh installs
6syncfusion avatarsyncfusion-blazor-securitysyncfusion/blazor-ui-components-skillsConfigure Content Security Policy (CSP) for Syncfusion Blazor components across Blazor Server, WebAssembly, and Auto render modes � self-hosted and CDN scenario382skills.sh installs