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

An option to limit to a single filesystem (like -xdev) #674

Closed
richlv opened this issue Dec 13, 2021 · 9 comments
Closed

An option to limit to a single filesystem (like -xdev) #674

richlv opened this issue Dec 13, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@richlv
Copy link

richlv commented Dec 13, 2021

What would you like to be added:
An option to limit to a single filesystem would be great. To borrow from find's manpage:

-xdev  Don't descend directories on other filesystems.

Why is this needed:
Scanning a directory like / ends up in /proc/, /dev/ and other places.
Sometimes that leads to a hang, like in #665.

@richlv richlv added the enhancement New feature or request label Dec 13, 2021
@spiffcs
Copy link
Contributor

spiffcs commented Dec 13, 2021

Nice! Thanks for the request @richlv.

We're actively working on a fix so we don't hit these paths and hang as reported. We'll also see if we can add specific options for inclusion vs exclusion in the future.

See #667 for PR progress on the hang fixes.

@stefan123t
Copy link

+1 for an -x<exclude_path> option.
I have Syft running through my /home/.ecryptfs/ folder which will do no harm, but does not yield any tangible results either.
syft packages dir:/ --scope all-layers -o table | grep log4j

@richlv
Copy link
Author

richlv commented Dec 20, 2021

One filesystem option and excludes are a bit different features - should they be split out as different feature requests?

@kzantow
Copy link
Contributor

kzantow commented Dec 20, 2021

FYI - an --exclude flag was just merged (for #221). Once released, in the case you're doing a directory scan - as @stefan123t's example, you should now be able exclude a sub-path explicitly, for example:

syft --exclude ./home/.ecryptfs dir:/

This, of course, doesn't directly address the issue of excluding a filesystem.

@richlv
Copy link
Author

richlv commented Dec 24, 2021

Thank you, --exclude looks great.
To clarify, this issue is not about excluding a filesystem, but about limiting to the filesystem, on which the scanning start point is - pretty much the same as for find.

While --exclude could be used for this by explicitly listing all other filesystems below the starting point, that's not flexible (depends on the target system) and less convenient.

@ajvpot
Copy link

ajvpot commented Feb 12, 2022

I opened a draft pull request in #816 that implements this.

@spiffcs
Copy link
Contributor

spiffcs commented Jul 8, 2022

Hey everyone! With #667 merged and the base ability to ignore proc/dev as well as the configuration options here #221 for specific files we're going to consider this issue closed for now. If anyone has other ideas or features tag me and I can look at the PR or reopen this issue. Thanks!

@spiffcs spiffcs closed this as completed Jul 8, 2022
@richlv
Copy link
Author

richlv commented Jul 12, 2022

Heya @spiffcs, thank you for looking into this.
The added features look great, although limiting to a single filesystem is different - it could still be useful when, for example, / has OS related files, and some other filesystem has a lot of huge application files (that are rarely updated).
The root filesystem would be useful to scan more often, while the more static app one would only be of interest after any changes there.
If usecases like that make sense, could this issue please be reopened?

@richlv
Copy link
Author

richlv commented Oct 30, 2023

Hi, still very much interested in this feature - should I create a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants