kubearmor / KubeArmor

Runtime Security Enforcement System. Workload hardening/sandboxing and implementing least-permissive policies made easy leveraging LSMs (BPF-LSM, AppArmor).
https://kubearmor.io/
Apache License 2.0
1.5k stars 345 forks source link

Generate SBOM #1012

Open achrefbensaad opened 1 year ago

achrefbensaad commented 1 year ago

We would like to generate SBOM (Software Bill Of Materials) for KubeArmor for each release.

We can use syft github action for that purpose link

slayer321 commented 1 year ago

Hey @achrefbensaad , I did like to work on this issue. can you assign it to me As you mentioned that we need to update the CI .. but after seeing the current CI setup for the project I think we will need a different file for SBOM(ci-release-sbom.yaml) .. something like below

name: SBOM

on:
  release:
    types: [published]

jobs:
  sbom:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          ref: ${{ github.ref_name }}
      - name: Anchore SBOM Action
        uses: anchore/sbom-action@v0.12.0
        with:
          format: cyclonedx-json

can you confirm if this is a correct way of doing it?

achrefbensaad commented 1 year ago

Hi @slayer321 , Can you please try the CI on your GH fork ?

slayer321 commented 1 year ago

@achrefbensaad , I checked it on my fork and it works .. you can check it here https://github.com/slayer321/KubeArmor/releases/tag/v0.2

branch with CI changes https://github.com/slayer321/KubeArmor/tree/slayer321/add-SBOM

kranurag7 commented 1 year ago

Hey @achrefbensaad and @slayer321 In the last meeting we decided that we will use bom for generating SBOMs.

cc @daemon1024

daemon1024 commented 1 year ago

We should just in case compare the SBOMs generated by both Syft and BOM and see if there are any differences that should be considered for the choice of tooling. In general BOM would be preferred due to being used by k8s as well. But still....

achrefbensaad commented 1 year ago

Hi @slayer321, Can you please compare the result of the the two tools, so we can select the one that suits us the best.

Ankurk99 commented 1 year ago

Hey @slayer321, are you working on this issue?

slayer321 commented 1 year ago

Hey @Ankurk99 , No..I was busy with some other stuff and was not able to work on this issue. But now I can start looking into this issue.