Security Audit Logging

Security Audit Logging

Guides an AI agent to build security audit logging for compliance and forensics, with structured logs, retention and SIEM integration.

Skill files5 files

references/

scripts/

SKILL.md97 lines
1
---
2
name: security-audit-logging
3
description: >
4
Implement comprehensive security audit logging for compliance, forensics, and
5
SIEM integration. Use when building audit trails, compliance logging, or
6
security monitoring systems.
7
---
8
9
# Security Audit Logging
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement comprehensive audit logging for security events, user actions, and system changes with structured logging, retention policies, and SIEM integration.
22
23
## When to Use
24
25
- Compliance requirements (SOC 2, HIPAA, PCI-DSS)
26
- Security monitoring
27
- Forensic investigations
28
- User activity tracking
29
- System change auditing
30
- Breach detection
31
32
## Quick Start
33
34
Minimal working example:
35
36
```javascript
37
// audit-logger.js
38
const winston = require("winston");
39
const { ElasticsearchTransport } = require("winston-elasticsearch");
40
41
class AuditLogger {
42
constructor() {
43
this.logger = winston.createLogger({
44
level: "info",
45
format: winston.format.combine(
46
winston.format.timestamp(),
47
winston.format.json(),
48
),
49
transports: [
50
// File transport
51
new winston.transports.File({
52
filename: "logs/audit.log",
53
maxsize: 10485760, // 10MB
54
maxFiles: 30,
55
tailable: true,
56
}),
57
58
// Elasticsearch transport for SIEM
59
new ElasticsearchTransport({
60
level: "info",
61
clientOpts: {
62
// ... (see reference guides for full implementation)
63
```
64
65
## Reference Guides
66
67
Detailed implementations in the `references/` directory:
68
69
| Guide | Contents |
70
|---|---|
71
| [Node.js Audit Logger](references/nodejs-audit-logger.md) | Node.js Audit Logger |
72
| [Python Audit Logging System](references/python-audit-logging-system.md) | Python Audit Logging System |
73
| [Java Audit Logging](references/java-audit-logging.md) | Java Audit Logging |
74
75
## Best Practices
76
77
### ✅ DO
78
79
- Log all security events
80
- Use structured logging
81
- Include timestamps (UTC)
82
- Log user context
83
- Implement log retention
84
- Encrypt sensitive logs
85
- Monitor log integrity
86
- Send to SIEM
87
- Include request IDs
88
89
### ❌ DON'T
90
91
- Log passwords/secrets
92
- Log sensitive PII unnecessarily
93
- Skip failed attempts
94
- Allow log tampering
95
- Store logs insecurely
96
- Ignore log analysis
97

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…