Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
8853dcf
Deckerfiles
Reet00 Apr 25, 2023
58d6263
chart.yaml file
Reet00 Apr 25, 2023
258a3e4
vales.yaml
Reet00 Apr 25, 2023
b0e089c
wrapper.sh
Reet00 Apr 25, 2023
2430784
scan-type ssh-audit
Reet00 Apr 25, 2023
837255d
parser definition
Reet00 Apr 25, 2023
c578b4c
created Makefile for ssh-audit
Reet00 Apr 25, 2023
4ad2f3a
debu, fixed entrypoint
Reet00 Apr 25, 2023
a28fd34
exit code to avoid error
Reet00 Apr 25, 2023
6a8b178
debug parameters
Reet00 Apr 25, 2023
675ac83
changed image versions
Reet00 Apr 25, 2023
f0de0e3
helmignore
Reet00 Apr 25, 2023
a3a929f
Basic implementation of parser
sofi0071 Apr 26, 2023
6024d0e
#1454 Implement findings format
sofi0071 Apr 26, 2023
88246bd
#1454 commentary and details
Reet00 Apr 27, 2023
ce87434
#1454 modified parser function
Reet00 Apr 27, 2023
f0de9ec
#1454 bug fix
Reet00 May 2, 2023
ae04028
#1454 added detailed findings in parser.js
Reet00 May 2, 2023
d44102a
#1454 attempt to fix bug by parsing of findings
sofi0071 May 2, 2023
31a85b5
#1454 updated version of ssh-audit
sofi0071 May 2, 2023
ca18717
#1454 added algorithmlist in findings
sofi0071 May 2, 2023
7450e36
#1454 fixed format of algorithm names in findings
sofi0071 May 2, 2023
e43bc0b
#1454 added change option to findings and changed variable names for…
sofi0071 May 2, 2023
eef6444
#1454 removed unnecessary lines, updated version, and added annotations
sofi0071 May 2, 2023
2465edd
#1454 added CVEs as findings
sofi0071 May 3, 2023
665630e
#1454 adjusted findings to new findings format
sofi0071 May 3, 2023
a464dd2
#1454 added and changed files for cascading rules
sofi0071 May 3, 2023
60d7ac9
#1454 added error handling if scanner results into an error
sofi0071 May 3, 2023
438778b
#1454 added example for dummy-ssh
sofi0071 May 3, 2023
d9a05d7
#1454 started to implement helm-docs
sofi0071 May 3, 2023
5f156ed
#1454 added missing cascading-rules file
sofi0071 May 3, 2023
24cd680
#1454 Generated Readme for ssh-audit
Reet00 May 4, 2023
0bfc298
#1454 Changed version to clone repo from
Reet00 May 4, 2023
fb4de88
#1454 Added files for unit-tests
Reet00 May 4, 2023
f535d52
#1454 Bug fixed to accomodate findings format, references as a list
Reet00 May 4, 2023
89f2511
#1454 improved wording for findings template
Reet00 May 5, 2023
63cc79f
#1454 Added ssh-audit to scanner lists in various files
Reet00 May 5, 2023
37d9efb
#1454 Added error handling for wrapper
Reet00 May 5, 2023
9d1bfae
#1454 updated example
Reet00 May 5, 2023
6463fc0
#1454 new examples for unit-tests
Reet00 May 5, 2023
8e99ee7
#1454 Added integration-tests
Reet00 May 8, 2023
136816d
#1454 Setted image repository and tags
Reet00 May 8, 2023
51d50f2
#1454 Changed Makefile to automate buildung of dummy-ssh
Reet00 May 8, 2023
5cdbb07
#1454 Clean up code
Reet00 May 8, 2023
127efd8
#1454 added suggestions
sofi0071 May 9, 2023
ecdd988
#1454 changed findings format
sofi0071 May 9, 2023
ba14ec9
#1454 added feature to differentiate hostname and ip-address
sofi0071 May 9, 2023
47155fd
#1454 updated format in unit-tests and fixed typo in example.json
sofi0071 May 9, 2023
8bd1990
#1454 Added and updated examples
Reet00 May 10, 2023
d887522
#1454 Added unit-test with different port and ip-address
Reet00 May 10, 2023
47701cc
#1454 Bug fix: added template for 'add' findings
Reet00 May 10, 2023
79fda16
#1454 Deleted unnecessary lines
sofi0071 May 11, 2023
5523051
#1454 beautified code and corrected findings format (+ fixed typo)
sofi0071 May 11, 2023
753c67c
#1454 Updated examples to current parser and updated docs
Reet00 May 11, 2023
42865ce
Merge branch 'main' into scanner/ssh-audit
sofi0071 May 11, 2023
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ jobs:
- nuclei
- screenshooter
- semgrep
- ssh-audit
- ssh-scan
- sslyze
- trivy
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ jobs:
- ncrack
- nmap
- nikto
- ssh-audit
- sslyze
- typo3scan
- whatweb
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scb-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
- ncrack
- nuclei
- semgrep
- ssh-audit
- ssh-scan
- sslyze
- trivy
Expand Down
84 changes: 84 additions & 0 deletions scanners/ssh-audit/.helm-docs.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{{- /*
SPDX-FileCopyrightText: the secureCodeBox authors

SPDX-License-Identifier: Apache-2.0
*/ -}}

{{- define "extra.docsSection" -}}
---
title: "SSH-audit"
category: "scanner"
type: "SSH"
state: "released"
appVersion: "{{ template "chart.appVersion" . }}"
usecase: "SSH Configuration and Policy Scanner"
---
{{- end }}

{{- define "extra.dockerDeploymentSection" -}}
## Supported Tags
- `latest` (represents the latest stable release build)
- tagged releases, e.g. `3.0.0`, `2.9.0`, `2.8.0`, `2.7.0`
{{- end }}

{{- define "extra.chartAboutSection" -}}
## What is SSH-audit?

ssh-audit is a tool for ssh server & client configuration auditing.

To learn more about the ssh-audit scanner itself visit [ssh-audit GitHub].
{{- end }}

{{- define "extra.scannerConfigurationSection" -}}
## Scanner Configuration

The following security scan configuration example are based on the [ssh-audit Documentation], please take a look at the original documentation for more configuration examples.

```bash
usage: ssh-audit.py [options] <host>

-h, --help print this help
-1, --ssh1 force ssh version 1 only
-2, --ssh2 force ssh version 2 only
-4, --ipv4 enable IPv4 (order of precedence)
-6, --ipv6 enable IPv6 (order of precedence)
-b, --batch batch output
-c, --client-audit starts a server on port 2222 to audit client
software config (use -p to change port;
use -t to change timeout)
-d, --debug Enable debug output.
-g, --gex-test=<x[,y,...]> dh gex modulus size test
<min1:pref1:max1[,min2:pref2:max2,...]>
<x-y[:step]>
-j, --json JSON output (use -jj to enable indents)
-l, --level=<level> minimum output level (info|warn|fail)
-L, --list-policies list all the official, built-in policies
--lookup=<alg1,alg2,...> looks up an algorithm(s) without
connecting to a server
-m, --manual print the man page (Windows only)
-M, --make-policy=<policy.txt> creates a policy based on the target server
(i.e.: the target server has the ideal
configuration that other servers should
adhere to)
-n, --no-colors disable colors
-p, --port=<port> port to connect
-P, --policy=<"policy name" | policy.txt> run a policy test using the
specified policy
-t, --timeout=<secs> timeout (in seconds) for connection and reading
(default: 5)
-T, --targets=<hosts.txt> a file containing a list of target hosts (one
per line, format HOST[:PORT])
--threads=<threads> number of threads to use when scanning multiple
targets (-T/--targets) (default: 32)
-v, --verbose verbose output
```

{{- end }}

{{- define "extra.chartConfigurationSection" -}}
{{- end }}

{{- define "extra.scannerLinksSection" -}}
[ssh-audit GitHub]: https://github.com/jtesta/ssh-audit
[ssh-audit Documentation]: https://github.com/jtesta/ssh-audit#usage
{{- end }}
41 changes: 41 additions & 0 deletions scanners/ssh-audit/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# Node.js files
node_modules/*
package.json
package-lock.json
src/*
config/*
Dockerfile
.dockerignore
*.tar
parser/*
scanner/*
integration-tests/*
examples/*
docs/*
Makefile
31 changes: 31 additions & 0 deletions scanners/ssh-audit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0

apiVersion: v2
name: ssh-audit
description: A Helm chart for Kubernetes

type: application
version: v3.1.0-alpha1

appVersion: "v2.9.0"
kubeVersion: ">=v1.11.0-0"

annotations:
versionApi: https://api.github.com/repos/jtesta/ssh-audit/releases/latest
# supported cpu architectures for which docker images for the scanner should be build
# supported-platforms: linux/amd64

keywords:
- security
- ssh
- scanner
- secureCodeBox

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

maintainers:
- name: iteratec GmbH
- email: secureCodeBox@iteratec.com
15 changes: 15 additions & 0 deletions scanners/ssh-audit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/make -f
#
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0
#

include_guard = set
scanner = ssh-audit
custom_scanner = set

include ../../scanners.mk

.PHONY: deploy-test-deps
deploy-test-deps: deploy-test-dep-dummy-ssh
137 changes: 137 additions & 0 deletions scanners/ssh-audit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
title: "SSH-audit"
category: "scanner"
type: "SSH"
state: "released"
appVersion: "v2.9.0"
usecase: "SSH Configuration and Policy Scanner"
---

<!--
SPDX-FileCopyrightText: the secureCodeBox authors

SPDX-License-Identifier: Apache-2.0
-->
<!--
.: IMPORTANT! :.
--------------------------
This file is generated automatically with `helm-docs` based on the following template files:
- ./.helm-docs/templates.gotmpl (general template data for all charts)
- ./chart-folder/.helm-docs.gotmpl (chart specific template data)

Please be aware of that and apply your changes only within those template files instead of this file.
Otherwise your changes will be reverted/overwritten automatically due to the build process `./.github/workflows/helm-docs.yaml`
--------------------------
-->

<p align="center">
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="License Apache-2.0" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"/></a>
<a href="https://github.com/secureCodeBox/secureCodeBox/releases/latest"><img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/secureCodeBox/secureCodeBox?sort=semver"/></a>
<a href="https://owasp.org/www-project-securecodebox/"><img alt="OWASP Lab Project" src="https://img.shields.io/badge/OWASP-Lab%20Project-yellow"/></a>
<a href="https://artifacthub.io/packages/search?repo=securecodebox"><img alt="Artifact HUB" src="https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/securecodebox"/></a>
<a href="https://github.com/secureCodeBox/secureCodeBox/"><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/secureCodeBox/secureCodeBox?logo=GitHub"/></a>
<a href="https://twitter.com/securecodebox"><img alt="Twitter Follower" src="https://img.shields.io/twitter/follow/securecodebox?style=flat&color=blue&logo=twitter"/></a>
</p>

## What is SSH-audit?

ssh-audit is a tool for ssh server & client configuration auditing.

To learn more about the ssh-audit scanner itself visit [ssh-audit GitHub].

## Deployment
The ssh-audit chart can be deployed via helm:

```bash
# Install HelmChart (use -n to configure another namespace)
helm upgrade --install ssh-audit secureCodeBox/ssh-audit
```

## Scanner Configuration

The following security scan configuration example are based on the [ssh-audit Documentation], please take a look at the original documentation for more configuration examples.

```bash
usage: ssh-audit.py [options] <host>

-h, --help print this help
-1, --ssh1 force ssh version 1 only
-2, --ssh2 force ssh version 2 only
-4, --ipv4 enable IPv4 (order of precedence)
-6, --ipv6 enable IPv6 (order of precedence)
-b, --batch batch output
-c, --client-audit starts a server on port 2222 to audit client
software config (use -p to change port;
use -t to change timeout)
-d, --debug Enable debug output.
-g, --gex-test=<x[,y,...]> dh gex modulus size test
<min1:pref1:max1[,min2:pref2:max2,...]>
<x-y[:step]>
-j, --json JSON output (use -jj to enable indents)
-l, --level=<level> minimum output level (info|warn|fail)
-L, --list-policies list all the official, built-in policies
--lookup=<alg1,alg2,...> looks up an algorithm(s) without
connecting to a server
-m, --manual print the man page (Windows only)
-M, --make-policy=<policy.txt> creates a policy based on the target server
(i.e.: the target server has the ideal
configuration that other servers should
adhere to)
-n, --no-colors disable colors
-p, --port=<port> port to connect
-P, --policy=<"policy name" | policy.txt> run a policy test using the
specified policy
-t, --timeout=<secs> timeout (in seconds) for connection and reading
(default: 5)
-T, --targets=<hosts.txt> a file containing a list of target hosts (one
per line, format HOST[:PORT])
--threads=<threads> number of threads to use when scanning multiple
targets (-T/--targets) (default: 32)
-v, --verbose verbose output
```

## Requirements

Kubernetes: `>=v1.11.0-0`

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| cascadingRules.enabled | bool | `false` | |
| env | list | `[]` | |
| extraContainers | list | `[]` | |
| extraVolumeMounts | list | `[]` | |
| extraVolumes | list | `[]` | |
| parser.backoffLimit | int | `3` | |
| parser.env | list | `[]` | |
| parser.image.pullPolicy | string | `"IfNotPresent"` | 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 |
| parser.image.repository | string | `"docker.io/securecodebox/parser-ssh-audit"` | |
| parser.image.tag | string | defaults to the charts version | Parser image tag |
| parser.scopeLimiterAliases | object | `{}` | |
| parser.ttlSecondsAfterFinished | string | `nil` | |
| scanner.backoffLimit | int | `3` | |
| scanner.image.repository | string | `"docker.io/securecodebox/scanner-ssh-audit"` | |
| scanner.image.tag | string | `nil` | |
| scanner.resources | object | `{}` | CPU/memory resource requests/limits (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/, https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/) |
| scanner.ttlSecondsAfterFinished | string | `nil` | |
| securityContext.allowPrivilegeEscalation | bool | `false` | |
| securityContext.capabilities.drop[0] | string | `"all"` | |
| securityContext.privileged | bool | `false` | |
| securityContext.readOnlyRootFilesystem | bool | `true` | |
| securityContext.runAsNonRoot | bool | `true` | |

## License
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Code of secureCodeBox is licensed under the [Apache License 2.0][scb-license].

[scb-owasp]: https://www.owasp.org/index.php/OWASP_secureCodeBox
[scb-docs]: https://www.securecodebox.io/
[scb-site]: https://www.securecodebox.io/
[scb-github]: https://github.com/secureCodeBox/
[scb-twitter]: https://twitter.com/secureCodeBox
[scb-slack]: https://join.slack.com/t/securecodebox/shared_invite/enQtNDU3MTUyOTM0NTMwLTBjOWRjNjVkNGEyMjQ0ZGMyNDdlYTQxYWQ4MzNiNGY3MDMxNThkZjJmMzY2NDRhMTk3ZWM3OWFkYmY1YzUxNTU
[scb-license]: https://github.com/secureCodeBox/secureCodeBox/blob/master/LICENSE
[ssh-audit GitHub]: https://github.com/jtesta/ssh-audit
[ssh-audit Documentation]: https://github.com/jtesta/ssh-audit#usage
27 changes: 27 additions & 0 deletions scanners/ssh-audit/cascading-rules/ssh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0

apiVersion: "cascading.securecodebox.io/v1"
kind: CascadingRule
metadata:
name: "ssh-audit"
labels:
securecodebox.io/invasive: non-invasive
securecodebox.io/intensive: light
spec:
matches:
anyOf:
- category: "Open Port"
attributes:
port: 22
state: open
- category: "Open Port"
attributes:
service: "ssh"
state: open
scanSpec:
scanType: "ssh-audit"
parameters:
- "{{$.hostOrIP}}"
- "--port={{attributes.port}}"
Loading