Skip to content

AB2D WAF IP Sets Sync #10

AB2D WAF IP Sets Sync

AB2D WAF IP Sets Sync #10

name: AB2D WAF IP Sets Sync
on:
workflow_dispatch: # Allow manual trigger
permissions:
contents: read
id-token: write
jobs:
waf-ip-sync:
runs-on: self-hosted
defaults:
run:
shell: bash
strategy:
matrix:
app: [ab2d]
env: [dev, test]
steps:
- name: Checkout Platform Repository
uses: actions/checkout@v4
- name: Get AWS params
uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main
env:
AWS_REGION: ${{ vars.AWS_REGION }}
with:
params: |
OPS_GITHUB_TOKEN=/ci/github/token
- name: Checkout Private Repository
uses: actions/checkout@v4
with:
repository: CMSgov/cdap-private
ref: 'main'
sparse-checkout: |
ip-sets/ab2d/allowed_ips.txt
sparse-checkout-cone-mode: false
path: ./scripts/temp
token: ${{ env.OPS_GITHUB_TOKEN }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets[format('{0}_{1}_ACCOUNT', matrix.app, matrix.env)] }}:role/delegatedadmin/developer/${{ matrix.app }}-${{ matrix.env }}-github-actions
aws-region: ${{ vars.AWS_REGION }}
- name: PWD and LS
run: pwd && ls -alh; ls scripts; head -n 2 scripts/temp/ip-sets/ab2d/allowed_ips.txt
- name: Run WAF Sync Script
working-directory: scripts
run: bash waf-ip-set-sync.sh
env:
APP: ${{ matrix.app }}
ENV: ${{ matrix.env }}