Update Chainguard Content #78
This file contains 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: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v2 # checkout the repository content | |
- name: setup python | |
uses: actions/setup-python@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@v3 | |
with: | |
repository: "PaloAltoNetworks/pan-chainguard" | |
path: pan-chainguard | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clean Up | |
run: | | |
mv latest-certs old-certs | |
- name: Download DBs | |
run: | | |
curl -sOJ --create-dirs --output-dir latest-certs https://ccadb.my.salesforce-sites.com/ccadb/AllCertificateRecordsCSVFormatv2 | |
curl -sOJ --output-dir latest-certs https://ccadb.my.salesforce-sites.com/mozilla/MozillaIntermediateCertsCSVReport | |
curl -sOJ --output-dir latest-certs https://ccadb.my.salesforce-sites.com/mozilla/PublicAllIntermediateCertsWithPEMCSV | |
- name: Sprocket | |
run: | | |
cp old-certs/policy.json latest-certs/policy.json | |
pan-chainguard/bin/sprocket.py --verbose --ccadb latest-certs/AllCertificateRecordsReport.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 -i latest-certs/intermediate-fingerprints.csv --tree latest-certs/certificate-tree.json | |
- name: Chainring to HTML | |
run: | | |
pan-chainguard/bin/chainring.py --test-collisions --tree latest-certs/certificate-tree.json --format html > index.html | |
- name: Link | |
run: | | |
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 | |
- name: commit files | |
run: | | |
git config --local user.email "action@github.com" | |
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@v0.6.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |