Skip to content

Commit

Permalink
merge json files
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mizutani committed Aug 5, 2023
1 parent c810f97 commit 7bf1a91
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ jobs:
aws-region: ap-northeast-1

- name: Dump instances
run: mkdir -p instances && aws ec2 describe-instances > instances/data.json
run: aws ec2 describe-instances > instances.json
- name: Dump security groups
run: mkdir -p security_groups && aws ec2 describe-security-groups > security_groups/data.json
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 data.ex6.failed"
args: "eval -f pretty -I input.json -b ./ --fail-defined data.ex6.failed"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
*.json
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Security Camp 2023 sample GtiHub Actions
4 changes: 4 additions & 0 deletions policy.rego
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
package ex6

failed[msg] {
print(input)
false
}

0 comments on commit 7bf1a91

Please sign in to comment.