agentleFS
AL-JANEFAL-JANEF/janefskills/skills/security/security-logging/SKILL.md

security-logging

Skill1 starsChanged 54 days agoMITView on GitHub

Design and review security audit logging and detection: record who did what and when for auth events, data changes, and admin actions; never log passwords, tokens, or PII; keep logs tamper-evident; add a few high-value alerts such as failed-login thresholds. Use for audit trails, log redaction, monitoring, or incident investigation.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When something goes wrong, logs are how you find out what happened, who did it, and whether it's still happening.

    line 14
  2. Distinctive:

    Use it when adding logging to authentication events, data mutations, admin actions, or permission changes.

    line 25
  3. Very specific:

    Treat IP addresses, device identifiers, and location as sensitive operational data.

    line 48
  4. Distinctive:

    When reviewing, report gaps and leaks separately — both matter:

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Security Logging

When something goes wrong, logs are how you find out what happened, who did it, and whether it's still happening. Yet logging is easy to get wrong in two opposite directions: too little (you can't reconstruct an incident) or too much (the logs themselves become a data leak). This skill gets the balance right.

Two rules run through it: log enough to answer "who did what, when" for anything sensitive — and never log the sensitive thing itself (passwords, tokens, full card numbers, personal data beyond what's needed).

When to reach for this skill

Use it when adding logging to authentication events, data mutations, admin actions, or permission changes; when building an audit trail; when setting up monitoring or alerts; or when investigating an incident and asking what to look for. Also when reviewing existing logging for gaps or for accidental leakage of secrets.

What to do

1. Decide what to log

Security-relevant events worth recording (the "who/what/when"):

  • Authentication: login success and failure, logout, password change/reset, MFA events. Failed logins especially — they're the signal for brute-force.
  • Authorization: access denied events, privilege changes, role assignments.
  • Sensitive data actions: creation/modification/deletion of important records, exports, bulk operations.
  • Admin actions: anything an administrator does that affects others.

Each entry should capture: timestamp, actor (user id — not full PII), action, target (what was affected), source (IP / request id), and outcome (success/failure). For mutations, capturing before/after (or a diff) makes the log genuinely useful for reconstruction.

Treat IP addresses, device identifiers, and location as sensitive operational data. Minimize and retain them only for a defined detection or investigation use case; see references/privacy-and-retention.md.

2. Never leak into the logs

Logs are frequently shipped to third parties, cached, and widely readable — so they must not contain: passwords (even hashed), full tokens or session ids, full payment card numbers, API keys, or personal data beyond what the log needs. Redact or mask before writing. Reference a user by id, not by dumping their whole record. This is the failure mode that turns a helpful audit log into a breach.

3. Make logs trustworthy (anti-repudiation)

For the log to be evidence, it must resist tampering: prefer append-only storage, ship logs off the machine that generates them (so an attacker who compromises a box can't rewrite its own trail), and timestamp consistently (UTC). Without this, a sophisticated attacker just edits the logs.

4. Detect and alert

Logging enables detection only if something watches:

  • Repeated failed logins per account or IP → possible brute-force → alert / throttle (ties into auth-hardening).
  • Access-denied spikes → possible enumeration or privilege probing.
  • Unusual patterns → logins from new geographies, off-hours admin actions, bulk exports. Define a few high-value alerts rather than drowning in noise. An alert nobody acts on is worse than none.

See references/patterns.md for concrete log-entry structure, redaction helpers, and example detection rules.

Output format

When reviewing, report gaps and leaks separately — both matter:

## Logging Review: <target>

### Leaks   (sensitive data in logs — fix now)
- <what's being logged> at <location> → redact <field>

### Gaps   (sensitive actions not logged)
- <action> has no audit entry → log <fields>

### Integrity
- <e.g. logs writable in place / not shipped off-box> → <fix>

### Detection
- <missing high-value alert, e.g. failed-login threshold>

### Verified good
- <events already logged correctly>

Proof before done

Demonstrate it works: perform a sensitive action and show the audit entry appears with the right fields; perform a login with a password and show the password is not in the log; trip the failed-login threshold and show the alert/throttle fires. Evidence, not assertion.

References

  • references/patterns.md — Copyable audit-log entry structure, redaction helpers, and example detection rules (failed-login threshold, etc.). Read it when implementing logging or detection.
  • references/privacy-and-retention.md — Data minimization, retention, access, and verification guidance. Read it when logs include identifiers, IPs, device data, or location.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.