Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

refactor(defsec): Refactor defsec into components #1460

Merged
merged 9 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
13 changes: 0 additions & 13 deletions .github/actions/setup-opa/action.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/adapter-lint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
cache-dependency-path: go.sum
- uses: golangci/golangci-lint-action@v3
with:
version: v1.48
version: v1.54
skip-cache: true
args: --timeout 10m --verbose
39 changes: 0 additions & 39 deletions .github/workflows/outdated-api-update.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/release.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/test-bundle.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/workflows/test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ jobs:
go-version-file: go.mod
cache: false

- name: Run non-localstack tests
if: matrix.os != 'ubuntu-latest'
run: make test-no-localstack
shell: bash
- name: Run full tests
if: matrix.os == 'ubuntu-latest'
run: make test
shell: bash
39 changes: 0 additions & 39 deletions .github/workflows/test-rego.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/verify-schema.yml

This file was deleted.

67 changes: 0 additions & 67 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
DYNAMIC_REGO_FOLDER=./rules/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 rules/cloud/policies

.PHONY: test-rego
test-rego:
go test --run Test_AllRegoRules ./test

.PHONY: typos
typos:
which codespell || pip3 install codespell
Expand All @@ -37,49 +16,3 @@ fix-typos:
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: docs-test
docs-test:
go test -v ./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
cp bundle.tar.gz scripts/bundle.tar.gz
go run ./scripts/verify-bundle.go
rm scripts/bundle.tar.gz

.PHONY: build
build:
go build -o bin/defsec ./cmd/defsec

This file was deleted.

21 changes: 0 additions & 21 deletions avd_docs/aws/accessanalyzer/AVD-AWS-0175/docs.md

This file was deleted.

21 changes: 0 additions & 21 deletions avd_docs/aws/apigateway/AVD-AWS-0001/CloudFormation.md

This file was deleted.

30 changes: 0 additions & 30 deletions avd_docs/aws/apigateway/AVD-AWS-0001/Terraform.md

This file was deleted.

13 changes: 0 additions & 13 deletions avd_docs/aws/apigateway/AVD-AWS-0001/docs.md

This file was deleted.

Loading