Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux trash dir artifact to find recycled files #3039

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions artifacts/definitions/Linux/Sys/Trash.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Linux.Sys.Trash
description: Find files in trash bin for all users
author: Whitney Champion (@shortxstack)
parameters:
- name: trashFiles
default: '.local/share/Trash/**/*'
description: Glob of trash bin files relative to a user's home directory.

sources:
- precondition: |
SELECT OS From info() where OS = 'linux'

query: |
LET trash = SELECT * from foreach(
row={
SELECT Uid, User, Homedir from Artifact.Linux.Sys.Users()
},
query={
SELECT OSPath, Size, Mtime, Ctime, User, Uid
FROM glob(root=Homedir, globs=trashFiles)
})

SELECT * from foreach(
row=trash)
Loading