Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Checkmarx/kics into AST-5…
Browse files Browse the repository at this point in the history
…0621
  • Loading branch information
ArturRibeiro-CX committed Sep 20, 2024
2 parents 417492d + 21234ad commit 1321068
Show file tree
Hide file tree
Showing 3,617 changed files with 6,226 additions and 3,042 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,20 @@ def generate_md_docs(queries_database : str, output_path : str, template_file_pa
doc_template = f.read()

for key, query_data in queries_database.items():
cwe = query_data.get('cwe', '')
if cwe == '':
cwe = 'Ongoing'
else:
cwe_url = f'https://cwe.mitre.org/data/definitions/{cwe}.html'
cwe = f'<a href="{cwe_url}" onclick="newWindowOpenerSafe(event, \'{cwe_url}\')">{cwe}</a>'

query_doc = doc_template
query_doc = doc_template.replace('<QUERY_ID>', key).replace(
'<QUERY_NAME>', query_data.get('queryName')).replace(
'<PLATFORM>', query_data.get('platform')).replace(
'<SEVERITY>', format_severity(query_data.get('severity'))).replace(
'<CATEGORY>', query_data.get('category')).replace(
'<CWE>', cwe).replace(
'<GITHUB_URL>', query_data.get('githubUrl')).replace(
'<DESCRIPTION_TEXT>', query_data.get('descriptionText')).replace(
'<DESCRIPTION_URL>', query_data.get('descriptionUrl')).replace(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ hide:
- **Platform:** <PLATFORM>
- **Severity:** <SEVERITY>
- **Category:** <CATEGORY>
- **CWE:** <CWE>
- **URL:** [Github](<GITHUB_URL>)

### Description
Expand Down
16 changes: 14 additions & 2 deletions .github/scripts/queries-validator/metadata-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
"minLength": 1,
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-4{1}[a-f0-9]{3}-[89ab]{1}[a-f0-9]{3}-[a-f0-9]{12}$"
},
"description_text_pattern": {
"type": "string",
"minLength": 1,
"pattern": "^.{1,500}$"
},
"query_name_pattern": {
"type": "string",
"minLength": 1,
"pattern": "^[a-zA-Z][a-zA-Z0-9_ \\-\"',:$.()]{0,119}$"
},
"description_id_pattern": {
"type": "string",
"minLength": 1,
Expand All @@ -29,8 +39,9 @@
"$ref": "#/definitions/query_id_pattern"
},
"queryName": {
"$ref": "#/definitions/query_name_pattern",
"type": "string",
"minLength": 8,
"minLength": 1,
"maxLength": 120
},
"severity": {
Expand Down Expand Up @@ -75,8 +86,9 @@
]
},
"descriptionText": {
"$ref": "#/definitions/description_text_pattern",
"type": "string",
"minLength": 16,
"minLength": 1,
"maxLength" : 500
},
"descriptionUrl": {
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/report/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Checkmarx/e2e-report

go 1.21
go 1.23.1

require (
github.com/rs/zerolog v1.31.0
Expand Down
108 changes: 76 additions & 32 deletions .github/scripts/server-mock/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

This file was deleted.

15 changes: 9 additions & 6 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
lint:
name: lint
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Go
Expand All @@ -16,9 +16,9 @@ jobs:
go-version-file: go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
version: v1.57.2
version: v1.61.0
args: -c .golangci.yml --timeout 20m
go-generate:
name: go-generate
Expand All @@ -39,7 +39,7 @@ jobs:
name: unit-tests
strategy:
matrix:
go-version: [1.22.x]
go-version: [1.23.x]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -99,10 +99,13 @@ jobs:
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run Gosec Security Scanner
uses: securego/gosec@master
uses: securego/gosec@6fbd381238e97e1d1f3358f0d6d65de78dcf9245 # v2.20.0
with:
args: "-no-fail -fmt sarif -out results.sarif ./..."
- name: Show results
run: |
cat results.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
uses: github/codeql-action/upload-sarif@2bbafcdd7fbf96243689e764c2f15d9735164f33
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/go-e2e-debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.22.x]
go-version: [1.23.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.22.x]
go-version: [1.23.x]
os: [ubuntu-latest]
kics-docker: ["Dockerfile", "docker/Dockerfile.ubi8"]
runs-on: ${{ matrix.os }}
Expand Down
Loading

0 comments on commit 1321068

Please sign in to comment.