Skip to content

Commit

Permalink
Merge pull request #2 from nikpivkin/to-trivy
Browse files Browse the repository at this point in the history
chore: migrate to Trivy
  • Loading branch information
simar7 authored May 31, 2024
2 parents 31f3c56 + 45c0b3c commit 6f7d1ee
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/generate-html.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ jobs:
- name: Install Dependencies
run: pip install json-schema-for-humans==0.47

- name: Clone Repository
run: make clone-repo

- name: Generate HTML
run: make generate-html

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.idea

defsec
env

**/.DS_Store
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
SCHEMA_CONFIG_FILE=./config/config.yaml
PATH_TO_SCHEMAS=./defsec/pkg/rego/schemas
SCHEMAS=dockerfile kubernetes cloud rbac
OUT_DIRECTORY=out

generate-html:
@for schema in $(SCHEMAS); do \
mkdir -p out/$$schema; \
generate-schema-doc --config-file $(SCHEMA_CONFIG_FILE) $(PATH_TO_SCHEMAS)/$$schema.json $(OUT_DIRECTORY)/$$schema; \
done

clone-repo:
git clone https://github.com/aquasecurity/defsec
@tmpdep=`mktemp -d`; \
trap 'rm -rf $$tmpdep' EXIT; \
for schema in $(SCHEMAS); do \
wget -q -O $$tmpdep/$$schema.json https://raw.githubusercontent.com/aquasecurity/trivy/main/pkg/iac/rego/schemas/$$schema.json; \
mkdir -p $(OUT_DIRECTORY)/$$schema; \
generate-schema-doc --config-file $(SCHEMA_CONFIG_FILE) $$tmpdep/$$schema.json $(OUT_DIRECTORY)/$$schema; \
done
2 changes: 1 addition & 1 deletion out/cloud/cloud.html

Large diffs are not rendered by default.

0 comments on commit 6f7d1ee

Please sign in to comment.