Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Test Witness for build attestations #135

Draft
wants to merge 12 commits into
base: victor/slsa
Choose a base branch
from

Conversation

colek42
Copy link

@colek42 colek42 commented Apr 7, 2023

Pull request check list

  • Proper tests/regressions included?
  • Documentation updated?

Affected functionality

Description of change

Which issue this pull requests fixes

@colek42 colek42 changed the title [WIP[ Test Witness for build attestations [WIP] Test Witness for build attestations Apr 7, 2023
@colek42
Copy link
Author

colek42 commented Apr 7, 2023

Working test run is viewable here: https://github.com/testifysec/galadriel/actions/runs/4636814805


- name: Run GoReleaser
id: run-goreleaser
uses: goreleaser/goreleaser-action@8f67e590f2d095516493f017008adc464e63adb1 # v4.1.0
uses: testifysec/witness-run-action@main

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
distribution: goreleaser
version: latest
args: release --rm-dist
uses: testifysec/witness-run-action@main

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
distribution: goreleaser
version: latest
args: release --rm-dist
uses: testifysec/witness-run-action@main

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
sudo apt-get install trivy -y

- name: Run Trivy vulnerability scanner with Witness
uses: testifysec/witness-run-action@main

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build Server
uses: testifysec/witness-run-action@main

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
command: ko build --tarball server.tar --tags=ghcr.io/${{ github.repository }}:${{ github.sha }} --platform=all --sbom-dir . ./cmd/server

- name: Build Harvestor
uses: testifysec/witness-run-action@main

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue

- name: Install KO
run: go install github.com/google/ko/cmd/ko@latest

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: goCommand not pinned by hash Click Remediation section below to solve this issue
# command: goreleaser release --clean --snapshot

- name: Setup KO
uses: imjasonh/[email protected]

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
uses: imjasonh/[email protected]

- name: Build Server
uses: testifysec/[email protected]

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
- name: Generate subject
id: hash
- name: Build Harvestor
uses: testifysec/[email protected]

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
# command: goreleaser release --clean --snapshot

- name: Setup KO
uses: imjasonh/[email protected]

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
# command: goreleaser release --clean --snapshot

- name: Setup KO
uses: imjasonh/[email protected]

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
- name: Generate subject
id: hash
- name: Build Harvestor
uses: testifysec/[email protected]

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
command: goreleaser release --clean --snapshot

- name: Setup KO
uses: imjasonh/[email protected]

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
sudo apt-get install trivy -y

- name: Run Trivy vulnerability scanner with Witness
uses: testifysec/[email protected]

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
echo "${AUTH_TOKEN}" | ko login ghcr.io --username dummy --password-stdin

- name: Build Server
uses: testifysec/witness-run-action@fix-output

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 5: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----

Check failure

Code scanning / Trivy

Asymmetric Private Key

Artifact: .witness/policy.key Type: Secret Asymmetric Private Key Severity: HIGH Match: -----BEGIN PRIVATE KEY-----*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************-----END PRIVATE KEY
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----

Check failure

Code scanning / Trivy

Asymmetric Private Key

Artifact: .witness/policy.key Type: Secret Asymmetric Private Key Severity: HIGH Match: -----BEGIN PRIVATE KEY-----*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************-----END PRIVATE KEY
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----

Check failure

Code scanning / Trivy

Asymmetric Private Key

Artifact: .witness/policy.key Type: Secret Asymmetric Private Key Severity: HIGH Match: -----BEGIN PRIVATE KEY-----*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************-----END PRIVATE KEY
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----

Check failure

Code scanning / Trivy

Asymmetric Private Key

Artifact: .witness/policy.key Type: Secret Asymmetric Private Key Severity: HIGH Match: -----BEGIN PRIVATE KEY-----*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************-----END PRIVATE KEY
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----

Check failure

Code scanning / Trivy

Asymmetric Private Key

Artifact: .witness/policy.key Type: Secret Asymmetric Private Key Severity: HIGH Match: -----BEGIN PRIVATE KEY-----*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************-----END PRIVATE KEY
dependabot bot and others added 5 commits April 18, 2023 03:46
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.2.0 to 3.3.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@537aa19...0ad9a09)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
provenance artifact with signature and sboms

Signed-off-by: Victor Vieira Barros Leal da Silveira <[email protected]>
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.3.1 to 3.4.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@0ad9a09...08e2f20)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@colek42 colek42 force-pushed the cole/witness branch 2 times, most recently from 1b04d08 to 69d694c Compare April 18, 2023 08:54
Cole Kennedy and others added 2 commits April 19, 2023 13:50
Signed-off-by: Cole Kennedy <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Apr 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Signed-off-by: Cole Kennedy <[email protected]>
Signed-off-by: Cole Kennedy <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Aug 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

2 participants