Update Chainguard Content #322
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Chainguard Content | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "00 11 * * *" # once a day at 11:00 UTC / 6:00 EST | |
| jobs: | |
| build: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout repo content | |
| uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2 # checkout the repository content | |
| - name: setup python | |
| uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 | |
| with: | |
| python-version: "3.x" # install the python version needed | |
| - name: install python packages | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install aiohttp | |
| pip install pan-python | |
| pip install treelib | |
| - name: download pan-chainguard | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
| with: | |
| repository: "PaloAltoNetworks/pan-chainguard" | |
| path: pan-chainguard | |
| - name: Clean Up | |
| run: | | |
| mv latest-certs old-certs | |
| - name: Download DBs | |
| run: | | |
| curl -sOJ --create-dirs --output-dir latest-certs --write-out "%{filename_effective}\n" https://ccadb.my.salesforce-sites.com/ccadb/AllCertificateRecordsCSVFormatv4 | |
| curl -sOJ --output-dir latest-certs --write-out "%{filename_effective}\n" https://ccadb.my.salesforce-sites.com/mozilla/MozillaIntermediateCertsCSVReport | |
| curl -sOJ --output-dir latest-certs --write-out "%{filename_effective}\n" https://ccadb.my.salesforce-sites.com/mozilla/PublicAllIntermediateCertsWithPEMCSV | |
| curl -sOJ --output-dir latest-certs --write-out "%{filename_effective}\n" https://ccadb.my.salesforce-sites.com/mozilla/IntermediateCertsInOneCRLReportCSV | |
| curl -sOJ --output-dir latest-certs --write-out "%{filename_effective}\n" https://ccadb.my.salesforce-sites.com/ccadb/AllIncludedRootCertsCSV | |
| - name: Sprocket | |
| run: | | |
| cp old-certs/policy.json latest-certs/policy.json | |
| pan-chainguard/bin/sprocket.py --verbose \ | |
| --ccadb latest-certs/AllCertificateRecordsReport.csv \ | |
| --trust-settings latest-certs/AllIncludedRootCertsCSV.csv \ | |
| --fingerprints latest-certs/root-fingerprints.csv \ | |
| --policy old-certs/policy.json | |
| - name: Chain | |
| run: | | |
| pan-chainguard/bin/chain.py --verbose \ | |
| -c latest-certs/AllCertificateRecordsReport.csv \ | |
| -r latest-certs/root-fingerprints.csv \ | |
| -o latest-certs/IntermediateCertsInOneCRL.csv \ | |
| -i latest-certs/intermediate-fingerprints.csv \ | |
| --tree latest-certs/certificate-tree.json | |
| - name: Chainring to HTML | |
| run: | | |
| pan-chainguard/bin/chainring.py --verbose \ | |
| --title 'Root Store: Union of Mozilla, Apple, Chrome, Microsoft' \ | |
| --test-collisions \ | |
| --tree latest-certs/certificate-tree.json --format html > index.html | |
| - name: Link | |
| run: | | |
| set +e # disable immediate exit on error | |
| pan-chainguard/bin/link.py --verbose \ | |
| -f latest-certs/root-fingerprints.csv \ | |
| -f latest-certs/intermediate-fingerprints.csv \ | |
| -m latest-certs/MozillaIntermediateCerts.csv \ | |
| -m latest-certs/PublicAllIntermediateCertsWithPEMReport.csv \ | |
| --certs-old old-certs/certificates-new.tgz \ | |
| --certs-new latest-certs/certificates-new.tgz | |
| status=$? | |
| set -e # re-enable "exit on error" for the rest of the step | |
| if [ "$status" -ne 0 ] && [ "$status" -ne 2 ]; then | |
| echo "link.py failed with exit code: $status" | |
| exit $status | |
| fi | |
| - name: commit files | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| git add -A latest-certs/* | |
| git add -A index.html | |
| git diff-index --quiet HEAD || (git commit -a -m "updated files" --allow-empty) | |
| - name: push changes | |
| uses: ad-m/github-push-action@40bf560936a8022e68a3c00e7d2abefaf01305a6 # v0.6.0 | |
| with: | |
| branch: main | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |