fix policy and cli option #7
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: audit | |
on: | |
workflow_dispatch: | |
push: | |
# schedule: | |
# - cron: "30 17 1 * *" | |
# - cron: '30 5,17 * * *' | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-northeast-1 | |
- name: Dump instances | |
run: aws ec2 describe-instances > instances.json | |
- name: Dump security groups | |
run: aws ec2 describe-security-groups > security_groups.json | |
- name: Merge json | |
run: |- | |
jq -n '{instances: input, security_groups: input}' instances.json security_groups.json > input.json | |
- uses: docker://openpolicyagent/opa:0.55.0 | |
with: | |
args: |- | |
eval -f pretty -b ./ --fail-defined -i input.json data.ex6.violated |