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

Filter extractors by actual capabilities #443

Open
cuixq opened this issue Feb 7, 2025 · 3 comments
Open

Filter extractors by actual capabilities #443

cuixq opened this issue Feb 7, 2025 · 3 comments

Comments

@cuixq
Copy link
Collaborator

cuixq commented Feb 7, 2025

We should filter extractors by actual capabilities. For example, only enable an extractor requiring network access when network access is available.

@erikvarga
Copy link
Collaborator

In the binary there's a flag to only enable plugins whose capabilities are met:

filterByCapabilities := flag.Bool("filter-by-capabilities", true, "If set, plugins whose requirements (network access, OS, etc.) aren't satisfied by the scanning environment will be silently disabled instead of throwing a validation error.")

And in the library the user can specify their capacities and call list.FilterByCapabilities to enable only those extractors -

func FilterByCapabilities(exs []filesystem.Extractor, capabs *plugin.Capabilities) []filesystem.Extractor {

Is there anything more we should add?

@cuixq
Copy link
Collaborator Author

cuixq commented Feb 9, 2025

Should this function to return false by default for capabilities?

@erikvarga
Copy link
Collaborator

erikvarga commented Feb 10, 2025

Well that's the capability setup for the SCALIBR binary wrapper. When wrapped into a binary, SCALIBR always runs on a real filesystem so it makes sense to set all capabilities to true (unless --remote-image is specified which we take into account in the code).

The one assumption the binary wrapper does make is that we can connect to the internet. If we want we can introduce an --offline flag or similar that would set this capability to false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants