2022-09-21 04:47:38 -04:00
|
|
|
name: Fetch, validate and report SNP report data.
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 14 * * 0"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-snp-reporter:
|
|
|
|
name: "Build SNP-reporter container"
|
2022-11-10 10:55:24 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2023-01-30 10:11:27 -05:00
|
|
|
permissions:
|
|
|
|
packages: write
|
2022-09-21 04:47:38 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-05-05 08:42:20 -04:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-11-10 11:22:26 -05:00
|
|
|
with:
|
2022-12-19 09:21:28 -05:00
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
2022-09-21 04:47:38 -04:00
|
|
|
|
|
|
|
- name: Build and upload azure SNP reporter container image
|
|
|
|
id: build-and-upload
|
|
|
|
uses: ./.github/actions/build_micro_service
|
|
|
|
with:
|
|
|
|
name: azure-snp-reporter
|
|
|
|
dockerfile: ./hack/azure-snp-report-verify/Dockerfile
|
|
|
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
fetch-snp-report:
|
|
|
|
needs: build-snp-reporter
|
|
|
|
name: "Fetch SNP report"
|
|
|
|
runs-on: [self-hosted, azure-cvm]
|
|
|
|
env:
|
|
|
|
SHELL: /bin/bash
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-05-05 08:42:20 -04:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-11-10 11:22:26 -05:00
|
|
|
with:
|
2022-12-19 09:21:28 -05:00
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
2022-09-21 04:47:38 -04:00
|
|
|
|
|
|
|
- name: Fetch SNP report
|
|
|
|
uses: ./.github/actions/azure_snp_reporter
|
|
|
|
with:
|
|
|
|
outputPath: ${{ github.workspace }}/maa-report.jwt
|
|
|
|
|
|
|
|
- name: Upload report JWT
|
2023-01-06 11:35:54 -05:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2022-09-21 04:47:38 -04:00
|
|
|
with:
|
|
|
|
name: maa-report.jwt
|
|
|
|
path: "${{ github.workspace }}/maa-report.jwt"
|
|
|
|
|
|
|
|
validate-snp-report:
|
|
|
|
needs: fetch-snp-report
|
2023-06-02 06:10:22 -04:00
|
|
|
name: "Validate SNP report and update Attestation API"
|
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
contents: read
|
2022-11-10 10:55:24 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2022-09-21 04:47:38 -04:00
|
|
|
env:
|
|
|
|
SHELL: /bin/bash
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-05-05 08:42:20 -04:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-09-21 04:47:38 -04:00
|
|
|
with:
|
2022-12-19 09:21:28 -05:00
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
2022-09-21 04:47:38 -04:00
|
|
|
|
|
|
|
- name: Set up Go
|
2023-04-04 05:06:30 -04:00
|
|
|
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
|
2022-09-21 04:47:38 -04:00
|
|
|
with:
|
2023-06-09 04:53:17 -04:00
|
|
|
go-version: 1.20.5
|
2023-06-01 09:16:00 -04:00
|
|
|
cache: false
|
2022-09-21 04:47:38 -04:00
|
|
|
|
|
|
|
- name: Download report JWT
|
2023-01-06 11:35:54 -05:00
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
2022-09-21 04:47:38 -04:00
|
|
|
with:
|
|
|
|
name: "maa-report.jwt"
|
|
|
|
path: "."
|
|
|
|
|
|
|
|
- name: Verify report
|
|
|
|
shell: bash
|
2023-06-02 06:10:22 -04:00
|
|
|
run: go run ./hack/azure-snp-report-verify/verify.go --report "$(cat ./maa-report.jwt)" --export-path azure-snp-version.json
|
|
|
|
|
|
|
|
- name: Login to AWS
|
|
|
|
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
|
|
|
|
with:
|
|
|
|
role-to-assume: arn:aws:iam::795746500882:role/GitHubConstellationImagePipeline
|
|
|
|
aws-region: eu-central-1
|
|
|
|
|
|
|
|
- name: Update Attestation API
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
|
|
|
|
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
|
|
|
|
run: |
|
|
|
|
go run ./hack/configapi/main.go --version-file azure-snp-version.json
|