Skip to content

Integrate SLSA Level 3 provenance, isolated container builds, and code coverage reporting - #2839

Open
asmit27rai wants to merge 6 commits into
kubearmor:mainfrom
asmit27rai:slsal3
Open

Integrate SLSA Level 3 provenance, isolated container builds, and code coverage reporting#2839
asmit27rai wants to merge 6 commits into
kubearmor:mainfrom
asmit27rai:slsal3

Conversation

@asmit27rai

Copy link
Copy Markdown
Contributor

Description

This PR addresses the supply-chain security and CII Best Practices criteria on the LFX security checklist:

  1. SLSA Level 3 Provenance Generation:

    • Integrated slsa-framework/slsa-github-generator reusable workflow into .github/workflows/ci-latest-release.yml.
    • Generates non-falsifiable .intoto.jsonl attestation provenance files and uploads them as release assets alongside container & binary releases.
  2. Network-Isolated Container Compilation:

    • Updated Dockerfile and pkg/KubeArmorController/Dockerfile to copy go.mod/go.sum and run go mod download && go mod verify prior to copying full source code.
    • Enforced GOPROXY=off during make and go build steps to guarantee zero outbound network calls during compilation.
  3. Continuous SLSA Provenance Verification:

    • Created .github/workflows/slsa-verify.yml to automatically verify release artifacts against .intoto.jsonl attestations using slsa-verifier verify-artifact.
  4. Code Coverage Reporting:

    • Updated .github/workflows/ci-test-go.yml to execute go test -coverprofile=coverage.txt -covermode=atomic ./... and report results via codecov/codecov-action.
  5. Badges:

    • Added SLSA Level 3 badge and Codecov coverage badge to README.md.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 4.18%. Comparing base (9ecd20a) to head (3241f9a).
⚠️ Report is 628 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##           main   #2839      +/-   ##
=======================================
+ Coverage      0   4.18%   +4.18%     
=======================================
  Files         0      63      +63     
  Lines         0   15420   +15420     
=======================================
+ Hits          0     646     +646     
- Misses        0   14709   +14709     
- Partials      0      65      +65     
Flag Coverage Δ
unittests 4.18% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…overage

Signed-off-by: asmit27rai <raiasmit10@gmail.com>
Comment thread .github/workflows/slsa-verify.yml Outdated
verify:
name: Verify SLSA Provenance
if: github.repository == 'kubearmor/kubearmor'
runs-on: ubuntu-22.04

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's use ubuntu-latest

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread Dockerfile
WORKDIR /usr/src/KubeArmor

COPY KubeArmor/go.mod KubeArmor/go.sum ./KubeArmor/
COPY pkg/ ./pkg/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why are we copying pkg directory?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In kubearmor/go.mod, there is local replacement replace github.com/kubearmor/KubeArmor/pkg/KubeArmorController => ../pkg/KubeArmorController
In dependency caching step go mod download and go mod verify validate all module replacements.
COPY pkg/ ./pkg/ is needed so Go can resolve the local relative path without throwing a missing error

asmit27rai and others added 4 commits August 17, 2026 20:23
Signed-off-by: asmit27rai <raiasmit10@gmail.com>
Signed-off-by: asmit27rai <raiasmit10@gmail.com>
…OpenSSF Silver badge

Signed-off-by: asmit27rai <raiasmit10@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants