Project retention
Customer and project data on your machine should not outlive its purpose. The Pentest operation rules suggests a dedicated directory for local pentest files. Delete anything you no longer need.
Project Sense
Project Sense is a small tool for Windows, Linux, and macOS that watches configured directories and deletes stale content. It runs on a schedule and writes a log of what it deleted, skipped, or kept.
Each direct child folder of an observation root counts as one project folder. The tool deletes a project folder when all files inside are older than MaxAgeDays (90 by default), or when the folder is empty.
To keep a project longer, place an empty SKIP_DELETION file in the project folder root. The folder is then skipped until you remove that file. Delete this flag file if the project is no longer needed.
Setup (Windows)
- Clone the repository and open
config.json. - Set
ObservationRootsto the directory where you store pentest projects (absolute path). - Set
Logfileto an absolute path where you want the run log (e.g.C:\Logs\ProjectSense.log). - Leave
MaxAgeDaysat90unless agreed otherwise with the team. - Test without deleting:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\ProjectSense.ps1 -ConfigPath config.json -WhatIf- Run once manually to confirm the log looks right:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\ProjectSense.ps1 -ConfigPath config.json- Register automatic runs at login: open
shell:startup, create a shortcut with this target (adjust paths):
powershell.exe -ep Bypass -WindowStyle hidden C:\Path\To\ProjectSense\scripts\ProjectSense.ps1 -ConfigPath C:\Path\To\ProjectSense\config.jsonCheck the log file after the first scheduled run. Full configuration options and troubleshooting are in the repository README.
Setup (Linux / macOS)
Prerequisites: bash, jq, and optionally notify-send (Linux) for desktop notifications.
chmod +x scripts/project-sense.sh
./scripts/project-sense.sh --config config.json --what-if # dry run
./scripts/project-sense.sh --config config.json # run for realRegister a daily cron job, for example at 11:00:
0 11 * * * /full/path/to/scripts/project-sense.sh --config /full/path/to/config.jsonSee config.unix.example.json in the repository for path examples.
Before you rely on it
- Store pentest files only under your configured observation root(s).
- Run with
-WhatIf/--what-ifafter changingconfig.jsonor moving projects. - Review the log when a project you expected to keep was deleted (usually the newest file was still within 90 days, or
SKIP_DELETIONwas missing). - Remove customer data from other locations manually; Project Sense only watches the paths you configure.