mcpField
S
security-audit-logging

security-audit-logging

github.com/aj-geddesSecurity373563 installsUpdated 34w ago
Repository

About security-audit-logging

A security audit logging skill for teams tracking security events, user actions, and system changes. It describes structured logs, retention, integrity practices, and SIEM integration, with implementation guides for Node.js, Python, and Java.

Key features

  1. 01Structured security event logging
  2. 02User and system change auditing
  3. 03Log retention and encryption practices
  4. 04SIEM integration guidance
  5. 05Node.js, Python, and Java guides

Use cases

  1. 01Meet audit and compliance requirements
  2. 02Monitor security events
  3. 03Investigate incidents and breaches
  4. 04Track user activity and system changes

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill security-audit-logging

After installing, type/security-audit-loggingin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
java-audit-logging.md
nodejs-audit-logger.md
python-audit-logging-system.md
scripts/
security-checklist.sh

Details

From the project README

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

Comments

Markdown supported