agentleFS
dennisonbertramdennisonbertram/claude-mac-guardian/skills/machine-security-check/SKILL.md

machine-security-check

Skill1 starsChanged 7 months agoMITView on GitHub

This skill should be used when the user asks to "check machine security", "run a security audit", "is my mac secure", "scan my machine", "audit my mac", or mentions SIP, Gatekeeper, FileVault, firewall, login items, launch agents, SSH keys, or authorized_keys. Performs a read-only macOS security posture audit and writes a structured JSON result to ~/.mac-guardian/data/.

  • Pipes a download into a shell
  • Reads credentials

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 3 are distinctive, and 5 are 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.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run each check as a read-only shell command.

    line 16
  2. Distinctive:

    After collection, construct a single JSON envelope matching the shared schema:

    line 47
  3. Very specific:

    Write it to ~/.mac-guardian/data/machine-security-check-<ISOdate>.json.

    line 62
  4. Very specific:

    If invoked directly by the user (not by daily-health-report), also render and open a standalone mini HTML report: bash …

    line 68
  5. Very specific:

    If invoked by daily-health-report, return the JSON path only.

    line 70
  6. Distinctive:

    Read-only. Never modify files.

    line 74
  7. Very specific:

    Do not request sudo. If elevation would be required for a check, record it as informational.

    line 75
  8. Distinctive:

    Never print private key contents — only report their existence and encryption state.

    line 76

≈ “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

machine-security-check

Performs a read-only posture audit of a macOS machine across system protections, persistence points, and credential surfaces, then writes the result to the shared data directory.

When to invoke

Trigger on phrases like: "check machine security", "security audit", "is my mac secure", "scan my machine", "audit my mac".

What to check

Run each check as a read-only shell command. Never prompt for or request sudo. If a command needs elevation and is not available without it, record the check with severity info and a detail of "not available without elevation" rather than requesting privileges.

System protections (severity guidance in parens)

  1. SIP — csrutil status. Expect "enabled". If disabled, severity critical.
  2. Gatekeeper — spctl --status. Expect "assessments enabled". If disabled, warn.
  3. FileVault — fdesetup status. Expect "On". If "Off", critical. If not determinable, info.
  4. Application Firewall — defaults read /Library/Preferences/com.apple.alf globalstate 2>/dev/null. 0 = off (warn), 1 or 2 = on (ok).
  5. Automatic Software Updates — defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled 2>/dev/null and related keys. Off is info.
  6. Screen-lock — defaults read com.apple.screensaver askForPassword 2>/dev/null. Unset or 0 is warn.

Persistence and startup

  1. Login items — osascript -e 'tell application "System Events" to get the name of every login item' 2>/dev/null. List names; if any look unfamiliar, mark individual findings info.
  2. User LaunchAgents — ls -la ~/Library/LaunchAgents 2>/dev/null. Report count and any with very recent mtime (<7 days) as info. Any unsigned binary target = warn.
  3. System LaunchAgents / Daemons — ls /Library/LaunchAgents /Library/LaunchDaemons 2>/dev/null. Report counts only (avoid flooding findings).
  4. Cron / at — crontab -l 2>/dev/null and atq 2>/dev/null. Any entries = info with the content in raw.

Credential surfaces

  1. SSH keys — enumerate ~/.ssh/id_* (not .pub). For each, report type and whether it is encrypted (grep -q "ENCRYPTED" <key> or ssh-keygen -y -P "" -f <key> >/dev/null 2>&1). Unencrypted private keys = warn.
  2. authorized_keys — ~/.ssh/authorized_keys. Report line count. >0 entries = info with the comment fields (last field) listed.
  3. Keychain — security list-keychains. Just report names as raw, no severity.

Recent filesystem activity

  1. Modifications in sensitive dirs in last 7 days — find /Library/LaunchAgents /Library/LaunchDaemons ~/Library/LaunchAgents ~/.ssh -type f -mtime -7 2>/dev/null. Any result = info, list up to 20 paths.
  2. Shell rc suspicious patterns — grep ~/.zshrc ~/.bashrc ~/.bash_profile ~/.profile for curl | sh, wget | sh, eval \"\$(curl, or base64-decoded eval. Matches = warn.

Output contract

After collection, construct a single JSON envelope matching the shared schema:

{
  "skill": "machine-security-check",
  "timestamp": "<ISO8601 UTC>",
  "severity": "<highest finding severity: ok|info|warn|critical>",
  "summary": "<one-line human summary, e.g. 'All protections on. 2 informational items.'>",
  "findings": [
    { "id": "sip", "severity": "ok", "title": "SIP enabled", "detail": "System Integrity Protection: enabled." }
  ],
  "raw": { "<key>": "<trimmed raw output>" }
}

Write it to ~/.mac-guardian/data/machine-security-check-<ISOdate>.json. Use the helpers in ${CLAUDE_PLUGIN_ROOT}/scripts/_common.sh when scripting; or write directly using date +%Y-%m-%d for the filename.

Handoff

After writing JSON:

  • If invoked directly by the user (not by daily-health-report), also render and open a standalone mini HTML report: bash ${CLAUDE_PLUGIN_ROOT}/scripts/render-single.sh machine-security-check
  • If invoked by daily-health-report, return the JSON path only.

Safety

  • Read-only. Never modify files. Never toggle SIP, FileVault, or firewall.
  • Do not request sudo. If elevation would be required for a check, record it as informational.
  • Never print private key contents — only report their existence and encryption state.

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.