forked from aquasecurity/defsec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·74 lines (57 loc) · 1.76 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
DYNAMIC_REGO_FOLDER=./internal/rules/policies/kubernetes/policies/dynamic
.PHONY: test
test:
go test -race ./...
.PHONY: test-no-localstack
test-no-localstack:
go test $$(go list ./... | grep -v internal/adapters/cloud/aws | awk -F'github.com/aquasecurity/defsec/' '{print "./"$$2}')
.PHONY: rego
rego: fmt-rego test-rego
.PHONY: schema
schema:
go run ./cmd/schema generate
.PHONY: fmt-rego
fmt-rego:
opa fmt -w internal/rules/policies
.PHONY: test-rego
test-rego:
go test --run Test_AllRegoRules ./test
.PHONY: typos
typos:
which codespell || pip3 install codespell
codespell -S funcs,.terraform,.git --ignore-words .codespellignore -f
.PHONY: fix-typos
fix-typos:
which codespell || pip3 install codespell
codespell -S funcs,.terraform --ignore-words .codespellignore -f -w -i1
.PHONY: quality
quality:
which golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.2
golangci-lint run --timeout 3m --verbose
.PHONY: update-loader
update-loader:
python3 scripts/update_loader_rules.py
@goimports -w pkg/rules/rules.go
.PHONY: metadata_lint
metadata_lint:
go run ./cmd/lint
.PHONY: docs
docs:
go run ./cmd/avd_generator
.PHONY: id
id:
@go run ./cmd/id
.PHONY: update-aws-deps
update-aws-deps:
@grep aws-sdk-go-v2 go.mod | grep -v '// indirect' | sed 's/^[\t\s]*//g' | sed 's/\s.*//g' | xargs go get
@go mod tidy
.PHONY: adapter-lint
adapter-lint:
go run ./cmd/adapter-lint/main.go ./internal/adapters/...
go run ./cmd/adapter-lint/main.go ./pkg/providers/...
.PHONY: outdated-api-updated
outdated-api-updated:
sed -i.bak "s|recommendedVersions :=.*|recommendedVersions := $(OUTDATE_API_DATA)|" $(DYNAMIC_REGO_FOLDER)/outdated_api.rego && rm $(DYNAMIC_REGO_FOLDER)/outdated_api.rego.bak
.PHONY: bundle
bundle:
./scripts/bundle.sh