Skip to content

Commit

Permalink
Merge pull request #1968 from ratify-project/dev
Browse files Browse the repository at this point in the history
chore: automated PR to main 2024-12-08
  • Loading branch information
binbin-li authored Dec 9, 2024
2 parents 3f148e5 + 78b2eba commit 001af63
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jobs:
with:
go-version: "1.22"
- name: Initialize CodeQL
uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # tag=v3.27.5
uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # tag=v3.27.6
with:
languages: go
- name: Run tidy
run: go mod tidy
- name: Build CLI
run: make build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # tag=v3.27.5
uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # tag=v3.27.6
42 changes: 42 additions & 0 deletions .github/workflows/publish-dev-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
az version
# Key Vault:
az account get-access-token --scope https://vault.azure.net/.default --output none
- name: Prepare notation certificate
run: |
mkdir -p truststore/x509/ca/ratify-verify
cp ./.well-known/pki-validation/ratify-verification.crt truststore/x509/ca/ratify-verify
- name: prepare
id: prepare
run: |
Expand Down Expand Up @@ -138,6 +142,44 @@ jobs:
cosign sign --yes ${{ steps.prepare.outputs.ref }}:${{ steps.prepare.outputs.version }}
cosign sign --yes ${{ steps.prepare.outputs.chartrepo }}/ratify:${{ steps.prepare.outputs.semversionrolling }}
cosign sign --yes ${{ steps.prepare.outputs.chartrepo }}/ratify:${{ steps.prepare.outputs.semversion }}
- name: Verify with Notation
uses: notaryproject/notation-action/verify@03242349f62aeddc995e12c6fbcea3b87697873f # v1.2.0
with:
target_artifact_reference: |-
${{ steps.prepare.outputs.crdref }}:${{ steps.prepare.outputs.version }}
${{ steps.prepare.outputs.baseref }}:${{ steps.prepare.outputs.version }}
${{ steps.prepare.outputs.ref }}:${{ steps.prepare.outputs.version }}
${{ steps.prepare.outputs.chartrepo }}/ratify:${{ steps.prepare.outputs.semversionrolling }}
${{ steps.prepare.outputs.chartrepo }}/ratify:${{ steps.prepare.outputs.semversion }}
trust_policy: ./.well-known/pki-validation/trustpolicy.json
trust_store: truststore
- name: Verify with Cosign
run: |
cosign verify \
--certificate-identity-regexp "https://github.com/ratify-project/ratify/.github/workflows/publish-dev-assets.yml@*" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-github-workflow-repository ratify-project/ratify \
${{ steps.prepare.outputs.crdref }}:${{ steps.prepare.outputs.version }}
cosign verify \
--certificate-identity-regexp "https://github.com/ratify-project/ratify/.github/workflows/publish-dev-assets.yml@*" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-github-workflow-repository ratify-project/ratify \
${{ steps.prepare.outputs.baseref }}:${{ steps.prepare.outputs.version }}
cosign verify \
--certificate-identity-regexp "https://github.com/ratify-project/ratify/.github/workflows/publish-dev-assets.yml@*" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-github-workflow-repository ratify-project/ratify \
${{ steps.prepare.outputs.ref }}:${{ steps.prepare.outputs.version }}
cosign verify \
--certificate-identity-regexp "https://github.com/ratify-project/ratify/.github/workflows/publish-dev-assets.yml@*" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-github-workflow-repository ratify-project/ratify \
${{ steps.prepare.outputs.chartrepo }}/ratify:${{ steps.prepare.outputs.semversionrolling }}
cosign verify \
--certificate-identity-regexp "https://github.com/ratify-project/ratify/.github/workflows/publish-dev-assets.yml@*" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-github-workflow-repository ratify-project/ratify \
${{ steps.prepare.outputs.chartrepo }}/ratify:${{ steps.prepare.outputs.semversion }}
- name: clear
if: always()
run: |
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,34 @@ jobs:
permissions:
packages: write
contents: read
id-token: write
environment: azure-publish
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Install Notation
uses: notaryproject/notation-action/setup@03242349f62aeddc995e12c6fbcea3b87697873f # v1.2.0
- name: Install cosign
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
- name: Az CLI login
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Cache AAD tokens
run: |
az version
# Key Vault:
az account get-access-token --scope https://vault.azure.net/.default --output none
- name: Prepare notation certificate
run: |
mkdir -p truststore/x509/ca/ratify-verify
cp ./.well-known/pki-validation/ratify-verification.crt truststore/x509/ca/ratify-verify
- name: prepare
id: prepare
run: |
Expand Down Expand Up @@ -83,6 +104,49 @@ jobs:
--label org.opencontainers.image.revision=${{ github.sha }} \
-t ${{ steps.prepare.outputs.ref }} \
--push .
- name: Sign with Notation
uses: notaryproject/notation-action/sign@03242349f62aeddc995e12c6fbcea3b87697873f # v1.2.0
with:
plugin_name: azure-kv
plugin_url: ${{ vars.AZURE_KV_PLUGIN_URL }}
plugin_checksum: ${{ vars.AZURE_KV_CHECKSUM }}
key_id: ${{ secrets.AZURE_KV_KEY_ID }}
target_artifact_reference: |-
${{ steps.prepare.outputs.crdref }}
${{ steps.prepare.outputs.baseref }}
${{ steps.prepare.outputs.ref }}
signature_format: cose
- name: Sign with Cosign
run: |
cosign sign --yes ${{ steps.prepare.outputs.crdref }}
cosign sign --yes ${{ steps.prepare.outputs.baseref }}
cosign sign --yes ${{ steps.prepare.outputs.ref }}
- name: Verify with Notation
uses: notaryproject/notation-action/verify@03242349f62aeddc995e12c6fbcea3b87697873f # v1.2.0
with:
target_artifact_reference: |-
${{ steps.prepare.outputs.crdref }}
${{ steps.prepare.outputs.baseref }}
${{ steps.prepare.outputs.ref }}
trust_policy: ./.well-known/pki-validation/trustpolicy.json
trust_store: truststore
- name: Verify with Cosign
run: |
cosign verify \
--certificate-identity-regexp "https://github.com/ratify-project/ratify/.github/workflows/publish-package.yml@*" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-github-workflow-repository ratify-project/ratify \
${{ steps.prepare.outputs.crdref }}
cosign verify \
--certificate-identity-regexp "https://github.com/ratify-project/ratify/.github/workflows/publish-package.yml@*" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-github-workflow-repository ratify-project/ratify \
${{ steps.prepare.outputs.baseref }}
cosign verify \
--certificate-identity-regexp "https://github.com/ratify-project/ratify/.github/workflows/publish-package.yml@*" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-github-workflow-repository ratify-project/ratify \
${{ steps.prepare.outputs.ref }}
- name: clear
if: always()
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ jobs:
retention-days: 5

- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # tag=v3.27.5
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # tag=v3.27.6
with:
sarif_file: results.sarif
24 changes: 24 additions & 0 deletions .well-known/pki-validation/trustpolicy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "1.0",
"trustPolicies": [
{
"name": "ratify-images",
"registryScopes": [
"ghcr.io/ratify-project/ratify",
"ghcr.io/ratify-project/ratify-base",
"ghcr.io/ratify-project/ratify-crds",
"ghcr.io/ratify-project/ratify-dev",
"ghcr.io/ratify-project/ratify-base-dev",
"ghcr.io/ratify-project/ratify-crds-dev",
"ghcr.io/ratify-project/ratify-chart-dev/ratify"
],
"signatureVerification": {
"level" : "strict"
},
"trustStores": [ "ca:ratify-verify" ],
"trustedIdentities": [
"x509.subject: CN=ratify.dev,O=ratify-project,L=Seattle,ST=WA,C=US"
]
}
]
}
2 changes: 1 addition & 1 deletion httpserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM --platform=$BUILDPLATFORM golang:1.23@sha256:73f06be4578c9987ce560087e2e2ea6485fb605e3910542cadd8fa09fc5f3e31 as builder
FROM --platform=$BUILDPLATFORM golang:1.23@sha256:574185e5c6b9d09873f455a7c205ea0514bfd99738c5dc7750196403a44ed4b7 as builder

ARG TARGETPLATFORM
ARG TARGETOS
Expand Down

0 comments on commit 001af63

Please sign in to comment.