Issue
How to do mass action with identified malicious files?
Environment
- Imunify products
Solution
1) A command for bulk removal malicious files that were identified during the scan:
for i in {1..100}; do imunify360-agent malware malicious list --limit 100 --json | jq '.items' | jq '.[] | .id' | xargs imunify360-agent malware malicious delete; done
Note: make sure that jq (Command-line JSON processor) is installed ( available in the epel repo).
2) A command to clean up malicious files:
imunify360-agent malware malicious cleanup-all
3) A command to cleanup JUST the files from ONE user:
imunify360-agent malware malicious cleanup --user USER
where USER is an actual username.
4) A command to delete JUST the files from ONE user:
imunify360-agent malware malicious list --user <USERNAME> | jq '.items[].id' | xargs imunify360-agent malware malicious delete;
where USERNAME is an actual username.
Note: make sure that jq (Command-line JSON processor) is installed (available in the EPEL repo).
Comments
2 comments
Just for reference, you don't need to pipe to jq twice in the examples above. The following...
...can be replaced with:
Will, thank you for the suggestion! This has been corrected.
Please sign in to leave a comment.