Skip to content

sbom: remove elf-package cataloger during .apk scan#1420

Merged
xnox merged 1 commit intowolfi-dev:mainfrom
xnox:remove-elf-package
Feb 9, 2025
Merged

sbom: remove elf-package cataloger during .apk scan#1420
xnox merged 1 commit intowolfi-dev:mainfrom
xnox:remove-elf-package

Conversation

@xnox
Copy link
Member

@xnox xnox commented Jan 25, 2025

With this change .apk which contain ELF package notes scan the same
way as they did before. This unblocks enabling ELF package notes,
whilst design on how to incorporate them into wolfictl scan can then
iterate on that at a later point.

$ ./wolfictl --log-level=debug  scan scanelf-1.3.8-r2.apk
2025/01/25 22:10:38 DEBU checking cache for SBOM expectedPath=/home/xnox/.cache/wolfictl/sbom/apk/scanelf-1.3.8-r2-sha256-8f340707e80c5a4159c41ef40ed6d3e2dc052f806b5cfbf906b1ade9b575ab14.syft.json
2025/01/25 22:10:38 DEBU SBOM cache miss cachedPath=/home/xnox/.cache/wolfictl/sbom/apk/scanelf-1.3.8-r2-sha256-8f340707e80c5a4159c41ef40ed6d3e2dc052f806b5cfbf906b1ade9b575ab14.syft.json
2025/01/25 22:10:38 INFO generating SBOM for APK file path=scanelf-1.3.8-r2.apk distroID=wolfi
2025/01/25 22:10:38 DEBU created temp directory to unpack APK path=/tmp/wolfictl-sbom-2146823426
2025/01/25 22:10:38 DEBU unpacked APK file to temp directory apkFilePath=scanelf-1.3.8-r2.apk
2025/01/25 22:10:38 DEBU apk temp directory item path=.
2025/01/25 22:10:38 DEBU apk temp directory item path=.PKGINFO
2025/01/25 22:10:38 DEBU apk temp directory item path=.melange.yaml
2025/01/25 22:10:38 DEBU apk temp directory item path=usr
2025/01/25 22:10:38 DEBU apk temp directory item path=usr/bin
2025/01/25 22:10:38 DEBU apk temp directory item path=usr/bin/scanelf
2025/01/25 22:10:38 DEBU apk temp directory item path=var
2025/01/25 22:10:38 DEBU apk temp directory item path=var/lib
2025/01/25 22:10:38 DEBU apk temp directory item path=var/lib/db
2025/01/25 22:10:38 DEBU apk temp directory item path=var/lib/db/sbom
2025/01/25 22:10:38 DEBU apk temp directory item path=var/lib/db/sbom/scanelf-1.3.8-r2.spdx.json
2025/01/25 22:10:38 DEBU synthesized APK package for SBOM name=scanelf version=1.3.8-r2 id=0b4aac8b80c2df13
2025/01/25 22:10:38 DEBU created Syft source from directory description="{fae5e479007d6102592372c66694727566238f1264d6deafd13639209ca07b7e /tmp/wolfictl-sbom-2146823426  {/tmp/wolfictl-sbom-2146823426 }}"
2025/01/25 22:10:39 INFO finished Syft SBOM generation packageCount=1
2025/01/25 22:10:39 DEBU cleaning up temp directory path=/tmp/wolfictl-sbom-2146823426
🔎 Scanning "scanelf-1.3.8-r2.apk"
2025/01/25 22:10:40 DEBU scanning APK SBOM for vulnerabilities packageCount=1
2025/01/25 22:10:40 INFO converted packages to grype packages packageCount=1
2025/01/25 22:10:40 DEBU grype matching finished matchCount=0
✅ No vulnerabilities found

Fixes: #1409

@xnox xnox requested a review from luhring January 25, 2025 22:12
Copy link
Contributor

@luhring luhring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

holding for offline discussion

@xnox xnox marked this pull request as draft January 25, 2025 22:48
With this change .apk which contain ELF package notes scan the same
way as they did before. This unblocks enabling ELF package notes,
whilst design on how to incorporate them into `wolfictl scan` can then
iterate on that at a later point.

```
$ ./wolfictl --log-level=debug  scan scanelf-1.3.8-r2.apk
2025/01/25 22:10:38 DEBU checking cache for SBOM expectedPath=/home/xnox/.cache/wolfictl/sbom/apk/scanelf-1.3.8-r2-sha256-8f340707e80c5a4159c41ef40ed6d3e2dc052f806b5cfbf906b1ade9b575ab14.syft.json
2025/01/25 22:10:38 DEBU SBOM cache miss cachedPath=/home/xnox/.cache/wolfictl/sbom/apk/scanelf-1.3.8-r2-sha256-8f340707e80c5a4159c41ef40ed6d3e2dc052f806b5cfbf906b1ade9b575ab14.syft.json
2025/01/25 22:10:38 INFO generating SBOM for APK file path=scanelf-1.3.8-r2.apk distroID=wolfi
2025/01/25 22:10:38 DEBU created temp directory to unpack APK path=/tmp/wolfictl-sbom-2146823426
2025/01/25 22:10:38 DEBU unpacked APK file to temp directory apkFilePath=scanelf-1.3.8-r2.apk
2025/01/25 22:10:38 DEBU apk temp directory item path=.
2025/01/25 22:10:38 DEBU apk temp directory item path=.PKGINFO
2025/01/25 22:10:38 DEBU apk temp directory item path=.melange.yaml
2025/01/25 22:10:38 DEBU apk temp directory item path=usr
2025/01/25 22:10:38 DEBU apk temp directory item path=usr/bin
2025/01/25 22:10:38 DEBU apk temp directory item path=usr/bin/scanelf
2025/01/25 22:10:38 DEBU apk temp directory item path=var
2025/01/25 22:10:38 DEBU apk temp directory item path=var/lib
2025/01/25 22:10:38 DEBU apk temp directory item path=var/lib/db
2025/01/25 22:10:38 DEBU apk temp directory item path=var/lib/db/sbom
2025/01/25 22:10:38 DEBU apk temp directory item path=var/lib/db/sbom/scanelf-1.3.8-r2.spdx.json
2025/01/25 22:10:38 DEBU synthesized APK package for SBOM name=scanelf version=1.3.8-r2 id=0b4aac8b80c2df13
2025/01/25 22:10:38 DEBU created Syft source from directory description="{fae5e479007d6102592372c66694727566238f1264d6deafd13639209ca07b7e /tmp/wolfictl-sbom-2146823426  {/tmp/wolfictl-sbom-2146823426 }}"
2025/01/25 22:10:39 INFO finished Syft SBOM generation packageCount=1
2025/01/25 22:10:39 DEBU cleaning up temp directory path=/tmp/wolfictl-sbom-2146823426
🔎 Scanning "scanelf-1.3.8-r2.apk"
2025/01/25 22:10:40 DEBU scanning APK SBOM for vulnerabilities packageCount=1
2025/01/25 22:10:40 INFO converted packages to grype packages packageCount=1
2025/01/25 22:10:40 DEBU grype matching finished matchCount=0
✅ No vulnerabilities found
```

Fixes: wolfi-dev#1409

Follow up TODO to consider turning it on:
- chainguard-dev/internal-dev#8731
@xnox xnox force-pushed the remove-elf-package branch from e6b91c6 to b58af8b Compare February 9, 2025 01:39
@xnox xnox requested a review from luhring February 9, 2025 01:39
@xnox xnox marked this pull request as ready for review February 9, 2025 01:40
@xnox xnox merged commit e032031 into wolfi-dev:main Feb 9, 2025
7 of 8 checks passed
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.

scan: expected exactly one APK package, found 2

2 participants