Hi @danvuong0514 thanks for the post. These are great questions!
That depends. The main difference is that packages that are added in one layer and then later removed, so that they’re not in the final image, will show up in the scan with all-layers but not with squashed.
No. CycloneDX is lossy compared to Syft’s native format. syft -o json > mysbom.json ; grype mysbom.jsondoes result in equivalent scans right now.
It can increase false positives, but may also decrease false negatives.
You should scan a syft -o json SBOM, in which case syft will detect the distro from /etc/os-release and similar. I don’t know off the top of my head why --distro auto does with CycloneDX.
We try to make the defaults be as good as we can.
Syft by default will try top guess what it’s input is and try to fetch it however it can. If you pass --from docker it will only try to use the local docker daemon.
Let me know if you have any questions! I hope that helps!
For the shipped image, squashed is the relevant view; all-layers can include packages removed in later layers. SBOM scanning can match a direct image scan only to the extent that the SBOM preserves the package identities and distro metadata Grype needs. --add-cpes-if-none may broaden matches, so compare findings with and without it before treating them as actionable. For local-image selection, specify Syft’s Docker source explicitly rather than relying on provider discovery.