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

Add command to scan apk files for vulnerabilities #290

Merged
merged 3 commits into from
Jul 13, 2023

Conversation

luhring
Copy link
Contributor

@luhring luhring commented Jul 11, 2023

This builds Grype-based vulnerability scanning directly into wolfictl, enabling the new command:

wolfictl scan <path/to/package.apk>

This is a more accurate means of scanning than the scanning script included in Wolfi, and enables a tight feedback loop for developers working on patching CVEs or adding new packages to the distro.

This implementation also paves the way for more productivity and advisory features, as scan data can be incorporated into advisory discovery and triage workflows.

This is definitely just an initial implementation, and I'm looking forward to usability feedback and suggestions to make it easier to manage CVEs in the distro! 😃

Update (2023-07-13):

  • Now shows location where the package was found to indicate where the patch would need to be applied
  • CVE and GHSA IDs are now hyperlinked in terminals that support hyperlinking to avoid the need for Googling
  • Fixed information is now shown
  • Multiple args (i.e. apk file paths) are now accepted

Preview:

$ wolfictl scan ./packages/aarch64/gradle-8-8.2.0-r0.apk
gradle-8-8.2.0-r0.apk
├── 📄 /usr/share/java/gradle/lib/guava-31.1-jre.jar
│       📦 guava 31.1-jre (java-archive)
│           Medium CVE-2023-2976 GHSA-7g45-4rm6-3mm3 fixed in 32.0.0

├── 📄 /usr/share/java/gradle/lib/h2-2.1.214.jar
│       📦 h2 2.1.214 (java-archive)
│           High CVE-2022-45868 GHSA-22wj-vf5f-wrvj fixed in 2.2.220

└── 📄 /usr/share/java/gradle/lib/plugins/ivy-2.3.0.jar
        📦 ivy 2.3.0 (java-archive)
            High CVE-2022-37866 GHSA-wv7w-rj2x-556x fixed in 2.5.1

@luhring luhring requested a review from a team as a code owner July 11, 2023 17:03
@luhring luhring requested review from imjasonh and jonjohnsonjr and removed request for a team July 11, 2023 17:03
kaniini
kaniini previously approved these changes Jul 11, 2023
@kaniini
Copy link
Contributor

kaniini commented Jul 11, 2023

This is utterly amazing

@joshrwolf
Copy link
Contributor

I think I love you

@rawlingsj rawlingsj merged commit 688e091 into wolfi-dev:main Jul 13, 2023
2 checks passed
@luhring luhring deleted the scan branch July 13, 2023 12:49
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

Successfully merging this pull request may close these issues.

4 participants