Skip to content

Commit

Permalink
feat(report): added sonarqube report (#4418)
Browse files Browse the repository at this point in the history
Signed-off-by: João Reigota <joao.reigota@checkmarx.com>
  • Loading branch information
joaoReigota1 committed Nov 19, 2021
2 parents 4059b45 + 14e162c commit c2dafc2
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go-ci-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: Checkout Source
uses: actions/checkout@v2.3.4
- uses: actions/setup-python@v2.2.2
- uses: actions/setup-python@v2.3.0
with:
python-version: "3.x"
- name: Run test metrics script
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
value: https://github.com/Checkmarx/kics/actions/runs/${{ github.run_id }}"
- name: View HEAD Commit
value: https://github.com/Checkmarx/kics/commit/${{ github.sha }}
- uses: actions/setup-python@v2.2.2
- uses: actions/setup-python@v2.3.0
with:
python-version: 3.x
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-apispec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
echo "scratch,${COMMIT_SHA8},${DATE},${DIGEST}" >> docs/docker/apispec.csv
echo "alpine,${COMMIT_SHA8},${DATE},${ALPINE_DIGEST}" >> docs/docker/apispec.csv
echo "debian,${COMMIT_SHA8},${DATE},${DEBIAN_DIGEST}" >> docs/docker/apispec.csv
- uses: actions/setup-python@v2.2.2
- uses: actions/setup-python@v2.3.0
with:
python-version: 3.x
- name: Generate .md table
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-dkr-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
echo "${VERSION}-alpine,${ALPINE_DIGEST}" >> docs/docker/digests.csv
echo "${VERSION}-debian,${DEBIAN_DIGEST}" >> docs/docker/digests.csv
echo "${VERSION}-ubi7,${UBI7_DIGEST}" >> docs/docker/digests.csv
- uses: actions/setup-python@v2.2.2
- uses: actions/setup-python@v2.3.0
with:
python-version: 3.x
- name: Generate .md table
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ jobs:
echo "alpine,${COMMIT_SHA8},${DATE},${ALPINE_DIGEST}" >> docs/docker/nightly.csv
echo "debian,${COMMIT_SHA8},${DATE},${DEBIAN_DIGEST}" >> docs/docker/nightly.csv
echo "ubi7,${COMMIT_SHA8},${DATE},${UBI7_DIGEST}" >> docs/docker/nightly.csv
- uses: actions/setup-python@v2.2.2
- uses: actions/setup-python@v2.3.0
with:
python-version: 3.x
- name: Generate .md table
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-docs-queries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: actions/setup-python@v2.2.2
- uses: actions/setup-python@v2.3.0
with:
python-version: "3.x"
- name: Update docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-docs-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
echo "curr tag ${{ steps.version.outputs.ctag }}"
echo "prev ver ${{ steps.version.outputs.pversion }}"
echo "curr ver ${{ steps.version.outputs.cversion }}"
- uses: actions/setup-python@v2.2.2
- uses: actions/setup-python@v2.3.0
with:
python-version: 3.x
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-install-script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
&& chmod +x godownloader \
&& rm -vf $(basename "${FULL_URL}") \
&& cd "${PROJDIR}"
- uses: actions/setup-python@v2.2.2
- uses: actions/setup-python@v2.3.0
with:
python-version: "3.x"
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-cfn-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2.3.4
with:
persist-credentials: false
- uses: actions/setup-python@v2.2.2
- uses: actions/setup-python@v2.3.0
with:
python-version: '3.x'
- name: Get commit changed files
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ USER Checkmarx
HEALTHCHECK CMD wget -q --method=HEAD localhost/system-status.txt

# Runtime image
FROM alpine:3.14.2
FROM alpine:3.14.3

# Install Git
RUN apk add --no-cache \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.apispec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ USER Checkmarx
#Healthcheck the container
HEALTHCHECK CMD wget -q --method=HEAD localhost/system-status.txt
#runtime image
FROM alpine:3.14.2
FROM alpine:3.14.3

RUN addgroup -S Checkmarx && adduser -S Checkmarx -G Checkmarx

Expand Down
18 changes: 9 additions & 9 deletions e2e/utils/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
"golang.org/x/net/html"
)

var availablePlatforms = map[string]string{
"Ansible": "ansible",
"CloudFormation": "cloudFormation",
"Common": "common",
"Dockerfile": "dockerfile",
"Kubernetes": "k8s",
"OpenAPI": "openAPI",
"Terraform": "terraform",
"AzureResourceManager": "azureResourceManager",
var availablePlatforms = initPlatforms()

func initPlatforms() map[string]string {
platforms := make(map[string]string)
for k, v := range constants.AvailablePlatforms {
platforms[k] = v
}
platforms["Common"] = "common"
return platforms
}

// HTMLValidation executes many asserts to validate the HTML Report
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/mailru/easyjson v0.7.7
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/moby/buildkit v0.9.3
github.com/open-policy-agent/opa v0.34.1
github.com/open-policy-agent/opa v0.34.2
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.26.0
github.com/spf13/cobra v1.2.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1145,8 +1145,8 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA=
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/open-policy-agent/opa v0.34.1 h1:u+x9Y1ynLv9w7GilJdtOrnM5PfQfOJYZg9eY1LPDAAQ=
github.com/open-policy-agent/opa v0.34.1/go.mod h1:buysXn+6zB/b+6JgLkP4WgKZ9+UgUtFAgtemYGrL9Ik=
github.com/open-policy-agent/opa v0.34.2 h1:asRmfDRUSd8gwPNRrpUsDxwOUkxLgc1x1FYkwjcnag4=
github.com/open-policy-agent/opa v0.34.2/go.mod h1:buysXn+6zB/b+6JgLkP4WgKZ9+UgUtFAgtemYGrL9Ik=
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
Expand Down
6 changes: 3 additions & 3 deletions internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ var (
// AvailablePlatforms - All platforms available
AvailablePlatforms = map[string]string{
"Ansible": "ansible",
"CloudFormation": "cloudformation",
"CloudFormation": "cloudFormation",
"Dockerfile": "dockerfile",
"Kubernetes": "k8s",
"OpenAPI": "openAPI",
"Terraform": "terraform",
"OpenAPI": "openapi",
"AzureResourceManager": "azureresourcemanager",
"AzureResourceManager": "azureResourceManager",
}

// AvailableSeverities - All severities available
Expand Down
22 changes: 11 additions & 11 deletions test/queries_content_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,8 @@ var (
}

// TODO uncomment this test once all metadata are fixed
availablePlatforms = map[string]string{
"Ansible": "ansible",
"CloudFormation": "cloudFormation",
"Common": "common",
"Dockerfile": "dockerfile",
"Kubernetes": "k8s",
"OpenAPI": "openAPI",
"Terraform": "terraform",
"AzureResourceManager": "azureResourceManager",
}
platformKeys = MapToStringSlice(availablePlatforms)
availablePlatforms = initPlatforms()
platformKeys = MapToStringSlice(availablePlatforms)

CategoriesKeys = MapToStringSlice(constants.AvailableCategories)

Expand Down Expand Up @@ -120,6 +111,15 @@ var (
}
)

func initPlatforms() map[string]string {
platforms := make(map[string]string)
for k, v := range constants.AvailablePlatforms {
platforms[k] = v
}
platforms["Common"] = "common"
return platforms
}

func TestQueriesContent(t *testing.T) {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: io.Discard})

Expand Down

0 comments on commit c2dafc2

Please sign in to comment.