sbomnix icon indicating copy to clipboard operation
sbomnix copied to clipboard

Example or documentation on how to use it via an API

Open drupol opened this issue 6 months ago • 4 comments

Hello,

I'm currently investigating how I could potentially embed SBOMs in OCI containers made with Nix. I would like to use this project which seems quite mature, but I wish I could use it through a Nix API, it would make sense to use it through it when building the container.

I have opened an issue at https://discourse.nixos.org/t/generate-sbom-from-oci-container-made-with-nix/39430, and I'm currently able to do what I want, but I wish I could also evaluate the use of this project too.

Thanks for shedding some lights on this!

drupol avatar Feb 08 '24 12:02 drupol

Thanks, this is a valid reguest. I'll look into this as soon as possible.

henrirosten avatar Feb 09 '24 03:02 henrirosten

Cool looking forward to it !!!

drupol avatar Feb 09 '24 08:02 drupol

@drupol: Sorry for the delay in response.

Re-visiting the discussion here: https://discourse.nixos.org/t/generate-sbom-from-oci-container-made-with-nix/39430/14 I believe what you are trying to do cannot be done with sbomnix since it uses nix-store internally, and using nix-store inside nix-build (in runCommand) will not work due to nix build sandbox.

Changing sbomnix so that it could be used during buildtime would require a major refactor.

If you (or anyone else reading this) have ideas how to workaround this limitation we certainly appreciate any suggestions or contributions.

henrirosten avatar Mar 18 '24 06:03 henrirosten

So sad, thanks for the clear explanation.

drupol avatar Mar 18 '24 07:03 drupol