Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
67ae740
Make all values.yaml files follow the same template structure
SebieF Sep 29, 2021
1d7f71f
Updating Helm Docs
SebieF Sep 29, 2021
bbbf510
Merge branch 'main' into consistency/value-files
SebieF Sep 30, 2021
c2547e2
Merge remote-tracking branch 'origin/consistency/value-files' into co…
SebieF Sep 30, 2021
aca7adf
Merge branch 'main' into consistency/value-files
SebieF Oct 5, 2021
25ca91c
Switching security context privileges to root privileges
SebieF Oct 5, 2021
20bddce
Updating Helm Docs
SebieF Oct 5, 2021
81c4464
Merge branch 'main' into consistency/value-files
SebieF Oct 11, 2021
098e568
Changing test-scan to use non-numeric user
SebieF Oct 11, 2021
fda7c6d
Gitleaks needs root rights in its scanner Dockerfile
SebieF Oct 11, 2021
9249657
Changing Dockerfile to not require users
SebieF Oct 11, 2021
a406ec1
Merge branch 'main' into consistency/value-files
SebieF Oct 13, 2021
0d81d5a
Resetting gitleaks Dockerfile to main branch
SebieF Oct 13, 2021
5ea532e
Setting runAsNonRoot (and readOnlyRootFilesystem if necessary) to true
SebieF Oct 13, 2021
5f95e1b
Updating Helm Docs
SebieF Oct 13, 2021
5428a14
Typo3Scan needs readOnlyRootFileSystem as false
SebieF Oct 13, 2021
9cac3aa
Merge remote-tracking branch 'origin/main' into consistency/cmseek
SebieF Oct 15, 2021
a519bd0
Adding empty file parser test
SebieF Oct 15, 2021
d859e7f
Making all yaml files consistent with template
SebieF Oct 15, 2021
b3364ea
Adding empty json file test
SebieF Oct 15, 2021
2c1b8c9
Making all yaml files follow the template
SebieF Oct 15, 2021
431cfa6
Merge branch 'consistency/cmseek' into consistency/cmseek-fix
SebieF Oct 15, 2021
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
21 changes: 4 additions & 17 deletions scanners/cmseek/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,27 @@
# SPDX-FileCopyrightText: 2021 iteratec GmbH
#
# SPDX-License-Identifier: Apache-2.0

apiVersion: v2
name: cmseek
description: A Helm chart for the Joomla security scanner that integrates with the secureCodeBox

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# version - gets automatically set to the secureCodeBox release version when the helm charts gets published
version: v3.1.0-alpha1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.1.3"
kubeVersion: ">=v1.11.0-0"
keywords:

keywords:
- security
- cmseek
- Joomla
- scanner
- secureCodeBox

home: https://docs.securecodebox.io/docs/scanners/cmseek
icon: https://docs.securecodebox.io/img/integrationIcons/Default.svg

sources:
- https://github.com/secureCodeBox/secureCodeBox

maintainers:
- name: iteratec GmbH
- email: [email protected]
email: [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2021 iteratec GmbH

SPDX-License-Identifier: Apache-2.0
14 changes: 13 additions & 1 deletion scanners/cmseek/parser/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,16 @@ test("parser parses result of non-Joomla scan successfully", async () => {
const findings = await parse(JSON.parse(fileContent));
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchSnapshot();
});
});

test("should properly parse empty cmseek json file", async () => {
const jsonContent = await readFile(
__dirname + "/__testFiles__/test-empty-report.json",
{
encoding: "utf8",
}
);
const findings = await parse(jsonContent);
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`Array []`);
});
5 changes: 4 additions & 1 deletion scanners/cmseek/templates/cascading-rules.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# SPDX-FileCopyrightText: 2021 iteratec GmbH
#
# SPDX-License-Identifier: Apache-2.0

# We only want to import the default cascading rules if they are enabled
{{ if .Values.cascadingRules.enabled }}
# The CascadingRules are not directly in the /templates directory as their curly bracket syntax clashes with helms templates ... :(
# We import them as raw files to avoid these clashes as escaping them is even more messy
{{ range $path, $_ := .Files.Glob "cascading-rules/*" }}
# Include File
{{ $.Files.Get $path }}
# Separate multiple files
---
{{ end }}
{{ end }}
{{ end }}
1 change: 0 additions & 1 deletion scanners/cmseek/templates/cmseek-parse-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ metadata:
spec:
image: "{{ .Values.parser.image.repository }}:{{ .Values.parser.image.tag | default .Chart.Version }}"
imagePullPolicy: {{ .Values.parser.image.pullPolicy }}

ttlSecondsAfterFinished: {{ .Values.parser.ttlSecondsAfterFinished }}
env:
{{- toYaml .Values.parser.env | nindent 4 }}
3 changes: 2 additions & 1 deletion scanners/cmseek/templates/cmseek-scan-type.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# SPDX-FileCopyrightText: 2021 iteratec GmbH
#
# SPDX-License-Identifier: Apache-2.0

apiVersion: "execution.securecodebox.io/v1"
kind: ScanType
metadata:
name: "cmseek"
name: "cmseek{{ .Values.scanner.nameAppend | default ""}}"
spec:
extractResults:
type: cmseek-json
Expand Down
20 changes: 16 additions & 4 deletions scanners/cmseek/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ parser:
tag: null
# -- Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
pullPolicy: IfNotPresent

# parser.ttlSecondsAfterFinished -- seconds after which the kubernetes job for the parser will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/
ttlSecondsAfterFinished: null
# parser.env -- Optional environment variables mapped into each parseJob (see: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/)
Expand All @@ -28,12 +29,11 @@ scanner:
# scanner.nameAppend -- append a string to the default scantype name.
nameAppend: null

# scanner.ttlSecondsAfterFinished -- seconds after which the kubernetes job for the scanner will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/
# -- seconds after which the kubernetes job for the scanner will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/
ttlSecondsAfterFinished: null
# -- There are situations where you want to fail a scan Job after some amount of time. To do so, set activeDeadlineSeconds to define an active deadline (in seconds) when considering a scan Job as failed. (see: https://kubernetes.io/docs/concepts/workloads/controllers/job/#job-termination-and-cleanup)
activeDeadlineSeconds: null

# scanner.backoffLimit -- There are situations where you want to fail a scan Job after some amount of retries due to a logical error in configuration etc. To do so, set backoffLimit to specify the number of retries before considering a scan Job as failed. (see: https://kubernetes.io/docs/concepts/workloads/controllers/job/#pod-backoff-failure-policy)
# -- There are situations where you want to fail a scan Job after some amount of retries due to a logical error in configuration etc. To do so, set backoffLimit to specify the number of retries before considering a scan Job as failed. (see: https://kubernetes.io/docs/concepts/workloads/controllers/job/#pod-backoff-failure-policy)
# @default -- 3
backoffLimit: 3

Expand All @@ -60,7 +60,19 @@ scanner:
extraContainers: []

# scanner.securityContext -- Optional securityContext set on scanner container (see: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
securityContext: {}
securityContext:
# scanner.securityContext.runAsNonRoot -- Enforces that the scanner image is run as a non root user
runAsNonRoot: true
# scanner.securityContext.readOnlyRootFilesystem -- Prevents write access to the containers file system
readOnlyRootFilesystem: false
# scanner.securityContext.allowPrivilegeEscalation -- Ensure that users privileges cannot be escalated
allowPrivilegeEscalation: false
# scanner.securityContext.privileged -- Ensures that the scanner container is not run in privileged mode
privileged: false
capabilities:
drop:
# scanner.securityContext.capabilities.drop[0] -- This drops all linux privileges from the container.
- all

cascadingRules:
# cascadingRules.enabled -- Enables or disables the installation of the default cascading rules for this scanner
Expand Down