feat: aguara check and aguara clean commands#39
Merged
Conversation
Incident response commands for compromised Python packages. aguara check: - Discovers Python site-packages (virtualenv, system, or --path) - Detects known compromised package versions (litellm 1.82.7/1.82.8) - Scans .pth files for executable content - Checks for persistence artifacts (systemd, sysmon backdoor) - Reports credential files at risk with rotation guidance - JSON and terminal output aguara clean: - Uninstalls compromised packages (pip/uv) - Quarantines malicious .pth files to /tmp/aguara-quarantine/ - Disables systemd persistence services - Supports --dry-run and --purge-caches - Requires confirmation (--yes to skip) - Prints credential rotation checklist 574 tests, 0 lint issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two new incident response commands for detecting and cleaning compromised Python packages.
Built in response to the litellm supply chain attack (March 24, 2026). Detection rules alone aren't enough - users need to check if they're affected and clean up.
aguara check
Scans installed Python environments for compromised packages and persistence artifacts.
Detects:
aguara clean
Removes compromised packages and quarantines malicious files.
Actions:
Files added
cmd/aguara/commands/check.go- check command (terminal + JSON output)cmd/aguara/commands/clean.go- clean command (dry-run, quarantine, confirmation)internal/incident/compromised.go- embedded known-bad package listinternal/incident/checker.go- package detection, .pth scanning, persistence checkinternal/incident/cleaner.go- removal, quarantine, cache purgeinternal/incident/checker_test.go- 9 testsinternal/incident/cleaner_test.go- 5 testsTest plan