Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

feat(terraform): add tfsec to terraform scanner rules #128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions pkg/rulesConfig/defaultRules/11-ensure-terraform-scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
gitlabConnector "github.com/allero-io/allero/pkg/connectors/gitlab"
)

// EnsureTerraformScanner is a function which checks pipelines for the presence of a terraform scanner
func EnsureTerraformScanner(githubData map[string]*githubConnector.GithubOwner, gitlabData map[string]*gitlabConnector.GitlabGroup) ([]*SchemaError, error) {
schemaErrors := make([]*SchemaError, 0)
var err error
Expand Down Expand Up @@ -36,12 +37,14 @@ func githubErrorsRule11(githubData map[string]*githubConnector.GithubOwner) ([]*
".*tenable/terrascan-action@.*",
".*snyk/actions/iac@.*",
".*aquasecurity/trivy-action@.*",
".*aquasecurity/tfsec-action@(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
".*checkmarx/kics-github-action@.*",
".*kubescape/github-action@.*",
}

runRegexExpressions := []string{
".*^[\\S]*trivy.*|.*docker .* run .*(aquasec/)?trivy.*",
".*^[\\S]*tfsec.*",
".*docker .* run .*checkmarx/kics scan.*",
".*kubescape scan.*",
}
Expand Down