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

feat: add an option to skip the files greater than a particular size #7190

Open
DmitriyLewen opened this issue Jul 19, 2024 Discussed in #7151 · 2 comments
Open

feat: add an option to skip the files greater than a particular size #7190

DmitriyLewen opened this issue Jul 19, 2024 Discussed in #7151 · 2 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@DmitriyLewen
Copy link
Contributor

DmitriyLewen commented Jul 19, 2024

Description

Add --max-file-size flag to skip files greater than a particular size.
See #7151 for more context

requirements:

  1. Update analyzers logic:
    1.1. Add Description() string function into analyzer and PostAnalyzer interfaces. (see Add an option to skip the files greater than a particular size #7151 (reply in thread))
    1.2. Add AllAnalyzersTypes() map[Type]string (type -> description (see 1.1)) function to show all analyzers ( see Add an option to skip the files greater than a particular size #7151 (reply in thread))
  2. add --max-file-size flag.
    2.1. flag format is <analyzer_type>:<max_size> (e.g. --max-file-size jar:200mb --max-file-size secret:5mb)
    2.2. flag should support size with prefix (i mean mb, kb, etc.). I saw that https://github.com/docker/go-units supports that (https://github.com/docker/go-units/blob/16e18b2861ca6fd622e7042ffeb9a3ebe8a9dff9/size.go#L78-L80)
    2.3. ??? i am not sure about this - cli error is supposed to show list of all analyzers when unsupported analyzer is used.
  3. use list of all analyzers (see 1.2) to create/update docs page using mage docs:generate (see Add an option to skip the files greater than a particular size #7151 (reply in thread))

Discussed in #7151

@DmitriyLewen DmitriyLewen added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 19, 2024
@zesiar0
Copy link

zesiar0 commented Jul 19, 2024

please assign to me, I want to contribute.

@DmitriyLewen
Copy link
Contributor Author

DmitriyLewen commented Jul 22, 2024

Hello @zesiar0

I assigned this task to you.

Thanks for your help!

See this discussion for more information about this issue - #7151 (comment)

Some info about contributing to Trivy - https://aquasecurity.github.io/trivy/v0.53/community/contribute/pr/

UPD:
@zesiar0 I've updated the description of this issue with the steps required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants