Dangling DNS record check #77
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: Dangling DNS record check | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 13 * * *' | |
permissions: | |
contents: read | |
jobs: | |
check-dns-records: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Get DNS records from Terraform | |
run: | | |
./bin/get-dns-records.sh ./terraform | sort | uniq > domains.txt | |
- name: Check DNS records | |
uses: maxneuvians/dns-hijack-check-action@main | |
- name: Notify if dangling records found | |
if: ${{ hashFiles('critical.json') != '' || hashFiles('potential.json') != '' }} | |
run: | | |
json='{"text":":dumpster-fire: Dangling DNS records found in `cds-snc/dns`: <https://github.com/cds-snc/dns/actions/workflows/dangling-dns-record.yml|view workflow>"}' | |
curl -X POST -H 'Content-type: application/json' --data "$json" ${{ secrets.SLACK_INTERNAL_SRE_ALERTS }} |