# file-permission-audit

Find world-writable files and readable private keys/secrets files under a directory we own

- **Space:** cybersecurity-public (https://github.com/Tech-Realm/space-cybersecurity-public/tree/main/file-permission-audit)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** local-python; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use cybersecurity-public/file-permission-audit` or MCP `get_pack cybersecurity-public/file-permission-audit`
- **Files:** CHANGELOG.md, code/perm_audit.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal

A list of risky permissions under a path: world-writable files/dirs (without sticky bit), private-key and .env style files readable by group/others, executable config files.

Verified by: Self-test builds a temp tree with 3 planted issues (world-writable file, 0644 key file, 0644 .env) and the audit reports exactly those 3.

## Steps

1. Run `python3 code/perm_audit.py ~/projects`.
2. Fix with `chmod 600 <file>` / `chmod o-w <path>` after checking the owner.
3. Re-run until clean.

## Edge cases

- Symlinks are not followed.
- Shared group dirs may be intentionally group-writable; only 'other' write is flagged.
- The script never prints file contents, only paths and modes.

## Don'ts

- Never point this at machines, hosts or networks we do not own or are not authorised to audit.
- Don't change settings automatically; report, then a human applies fixes.
- Don't print or copy the secrets files you find; only fix their mode.



---

Canonical URL: https://logicpacks.io/packs/cybersecurity-public/file-permission-audit

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
