Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: refactor defsec into components #1461

Merged
merged 16 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

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.

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
41 changes: 0 additions & 41 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +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: typos
typos:
which codespell || pip3 install codespell
Expand All @@ -22,38 +16,3 @@ fix-typos:
quality:
which golangci-lint || go install github.com/golangci/golangci-lint/cmd/[email protected]
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: 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: build
build:
go build -o bin/defsec ./cmd/defsec
10 changes: 0 additions & 10 deletions cmd/adapter-lint/main.go

This file was deleted.

74 changes: 0 additions & 74 deletions cmd/defsec/aws.go

This file was deleted.

55 changes: 0 additions & 55 deletions cmd/defsec/fs.go

This file was deleted.

29 changes: 0 additions & 29 deletions cmd/defsec/main.go

This file was deleted.

38 changes: 0 additions & 38 deletions cmd/defsec/output.go

This file was deleted.

Loading