• Stars
    star
    260
  • Rank 157,189 (Top 4 %)
  • Language
    Java
  • License
    MIT License
  • Created over 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SecHub provides a central API to test software with different security tools.
Build status

SecHub

Eugen

The free and open-source security platform SecHub, provides a central API to test software with different security tools. Many free and open-source as well proprietary security tools are supported by SecHub.

SecHub features:

Supported security tools:

Installation

Please visit https://github.com/mercedes-benz/sechub/wiki/ for detailed information.

Documentation

Introduction

SecHub basic architecture overview
                                                   +--------------+
                                              +--> | PDS + Tool A |
                                              |    +--------------+
+--------+                     +---------+    |
| SecHub | ------ scan ------> | SecHub  | <--+
| Client | <----- report ----- |   API   | <--+
+--------+                     +---------+    |
                                              |    +--------------+
                                              +--> | PDS + Tool B |
                                                   +--------------+

SecHub orchestrates various security and vulnerability scanners which can find potential vulnerabilities in the software under test (see: Architecture overview). This enables security, development and operation teams to review and fix security issues. As a result, SecHub improves application security.

The objective of SecHub is to help secure the software development lifecyle (SDLC) phases: development, deployment and maintenance. From the first written line of code to the application being in production. SecHub can be used to scan the software continuously.

To reduce the cognitive load for the user, the security tools are categorized into modules. Modules are named after the security testing method they perform: codeScan, webScan, infraScan etc.

The terms static application security testing (SAST) and dynamic application security testing (DAST) are intentionally not used for the module names, because the designers feel those terms are vague and difficult to understand for non-security experts. On the other hand, security experts can easily map: codeScan to SAST and webScan to DAST.

Because of the modules, the user only needs to understand what security testing a module performs, rather than to know what specific security tools are used for the actual scan. The user describes in a configuration file what module(s) to use. Or in other words, what security testing methods should be used to test the software with.

To start a scan, the user sends the configuration file to the SecHub server via API. Even better, SecHub provides a client which calls the REST API for the user. The SecHub client can be used manually or can be integrated into a continues-integration build pipeline (see: Scan using CI/CD or User).

CI/CD systems or User can scan with SecHub
/------\
| User | ----+
\------/     |            +--------+
             +-- Scan --> |        |
                          | SecHub |
             +-- Scan --> |        |
/-------\    |            +--------+
| CI/CD | ---+
\-------/

On receiving the user request, SecHub creates a job, delegates it to the security tool, collects the result and converts it into a report. Next, the user can download the report in a JSON or HTML format.

User Perspective

SecHub is designed to provide an efficient user workflow. The basic idea of SecHub is, that the user has to do as little as possible to execute a security scan. The user has two options: a) to use the REST API directly or b) to use the SecHub client. Both can be integrated into a CI/CD pipeline.

Using the REST API requires several steps, which is fine if SecHub needs to be integrated into another software or platform.

However, it is recommended to use the SecHub client, if the objective of the user is to: just scan.

The SecHub client reduces the workflow to three steps:

SecHub three steps to scan
1. Create a configuration file  // (1)

/------+
| JSON |
+------/

2. Set Credentials // (2)

export SECHUB_USERID=myUserName…
…

3. Scan // (3)

+--------+                 +--------+
|        | --- scan -----> |        |
| Client |                 | SecHub |
|        | <--- report --- |        |
+--------+                 +--------+
  1. Create a SecHub configuration file. This step only needs to be done the first time.

  2. Provide the SecHub credentials.

    Example:

    export SECHUB_USERID=myUserName
    export SECHUB_APITOKEN=NTg5YSMkGRkM2Uy00NDJjLTkYTY4NjEXAMPLE
    export SECHUB_SERVER=https://sechub.example.com:8443
  3. Scan

    sechub scan

Once the scan is finished, the client returns a report. If the client is used to scan asynchronously it will return a jobUUID which can be used to get the report (see: Scan asynchronously).

Scan asynchronously
1. Scan asynchronously // (1)

+--------+                      +--------+
|        | --- scanAsync -----> |        |
| Client |                      | SecHub |
|        | <--- jobUUID ------- |        |
+--------+                      +--------+

2. GetReport // (2)

+--------+                      +--------+
|        | --- getReport -----> |        |
| Client |                      | SecHub |
|        | <--- report -------- |        |
+--------+                      +--------+
  1. Scan asynchronously using sechub scanAsync.

  2. Get report sechub -jobUUID <jobUUID> getReport.

In general, the jobUUID can be used to download the report again and again by different users and in different formats.

Report

SecHub collects the scan results from various security tools and converts them into a unified reporting format called: SecHub Report. The advantage is that the user needs to learn only one report format. The example JSON report below shows how a report can look like:

JSON report example based on a scan of the G101, G103, G304 examples from GoSec.
{
   "result": {
      "count": 4,
      "findings": [
         {
            "id": 1,
            "description": "Potential hardcoded credentials",
            "name": "Potential hardcoded credentials",
            "severity": "HIGH",
            "code": {
               "location": "examples/g101.go",
               "line": 7,
               "column": 9,
               "source": "var password = \"f62e5bcda4fae4f82370da0c6f20697b8f8447ef\""
            },
            "type": "codeScan",
            "cweId": 798
         },
         {
            "id": 2,
            "description": "Use of unsafe calls should be audited",
            "name": "Use of unsafe calls should be audited",
            "severity": "MEDIUM",
            "code": {
               "location": "examples/g103.go",
               "line": 16,
               "column": 21,
               "source": "intPtr = (*int)(unsafe.Pointer(addressHolder))"
            },
            "type": "codeScan",
            "cweId": 242
         },
         {
            "id": 3,
            "description": "Use of unsafe calls should be audited",
            "name": "Use of unsafe calls should be audited",
            "severity": "MEDIUM",
            "code": {
               "location": "examples/g103.go",
               "line": 15,
               "column": 30,
               "source": "addressHolder := uintptr(unsafe.Pointer(intPtr)) + unsafe.Sizeof(intArray[0])"
            },
            "type": "codeScan",
            "cweId": 242
         },
         {
            "id": 4,
            "description": "Use of unsafe calls should be audited",
            "name": "Use of unsafe calls should be audited",
            "severity": "MEDIUM",
            "code": {
               "location": "examples/g103.go",
               "line": 15,
               "column": 56,
               "source": "addressHolder := uintptr(unsafe.Pointer(intPtr)) + unsafe.Sizeof(intArray[0])"
            },
            "type": "codeScan",
            "cweId": 242
         }
      ]
   },
   "messages": [],
   "reportVersion": "1.0",
   "trafficLight": "RED",
   "status": "SUCCESS",
   "jobUUID": "15a96c07-dcf3-4cbc-8d82-0acc9facd3a6"
}

The report can be downloaded in two flavors: JSON and HTML. Both are human readable. The HTML report is self-contained and can be read in any browser. The JSON format is machine readable and can be read by the SecHub plugins.

Mark Findings as False-Positives

There are two major reasons for marking a security finding as false-positive. First, it is an actual false-positive. Second, the finding is a false-positive in the context of the application. For example, the application is never deployed to be reachable from the internet. Regardless the reason, SecHub supports marking findings as false-positives. The marking of false-positives is a SecHub feature and is independent of the security tools used to scan.

SecHub Plugins

The SecHub Plugins improve the user experience by enabling the user to work directly with the SecHub report in the IDE or text editor.

SecHub plugins exist for the following text editors and IDEs:

All plugins are free and open-source software (FOSS) and can be installed directly from within the IDE or text editors.

Modules

Security tools are categorized into modules.

Each module performs a different security testing method:

  • codeScan - scans the code for potential vulnerabilities (weaknesses). Also known as SAST or static source code analysis.

  • webScan - scans a deployed web application for vulnerabilities. Also knows as DAST.

  • infraScan - scans infrastructure for vulnerabilities.

  • licenseScan - scans code or artifacts for license information.

  • secretScan - scans code or artifacts for secrets (API tokens, certificates, passwords).

codeScan

Alias: Static application security testing (SAST), static code analysis, infrastructure-as-code (IaC) scan

Status: Productive

The codeScan module scans source code or binary artifacts for potential vulnerabilities (weaknesses). To scan the user uploads the code or binary to SecHub. Once the files are uploaded, SecHub delegates the scan to one of many security tools.

PDS-Solutions:

  • GoSec

  • PMD

  • FindSecurityBugs

  • Bandit

  • Checkmarx (wrapper only)

  • … and more

webScan

Alias: Dynamic application security testing (DAST)

Status: Productive

The webScan module scans running web applications for vulnerabilities. The only requirement is that the web application can be reached by SecHub via network.

PDS-Solutions:

  • OWASP ZAP

infraScan

Status: Experimental

The infraScan scans systems in a network.

licenseScan

Status: Experimental

The licenseScan module scans code or artifacts for license information.

PDS-Solutions:

  • Scancode

  • Tern

secretScan

Status: Productive

Scans code or artifacts for secrets (API tokens, certificates, passwords).

PDS-Solutions:

  • Gitleaks

Architecture

SecHub is designed to execute hundreds of scans. It can scale horizontally and vertically. It can run on bare-metal, virtual machines, kubernetes or in the cloud.

The smallest useful setup is: a single SecHub server and a single product delegation server (PDS). Those two components are enough to start scanning.

For a larger setup, the number of SecHub server instances can be increased. More PDS instances can be added. The only requirements to scale SecHub are: a PostgreSQL database and an object store or file share. SecHub and PDS instances use the PostgreSQL database to share information between instances. For example, the job queue is kept in PostgreSQL. In addition,an object store or file share is necessary, so that all SecHub or PDS instances can store/read files.

Regardless of the backend complexity, whether one SecHub server or many are used the workflow for the user stays the same.

For more details about the architecture have a look at the architecture documentation: https://mercedes-benz.github.io/sechub/latest/sechub-architecture.html.

Operations Perspective

The operations team has to do most of the work. The operations team of SecHub needs to configure the scan tools as well as manage users and projects. This is an intentional design choice. The idea is, that users like security experts, operations engineers and developers can just scan and therefore focus on their work, rather than take care of SecHub and security scanners.

For more details have a look at the operations guide: https://mercedes-benz.github.io/sechub/latest/sechub-operations.html

REST API

All user and administrative tasks can be done via REST API. SecHub is design as a RESTful server.

Contributing

We welcome any contributions. If you want to contribute to this project, please read the contributing guide.

Code of Conduct

Please read our Code of Conduct as it is our base for interaction.

License

This project is licensed under the MIT LICENSE.

Provider Information

Please visit https://www.mercedes-benz-techinnovation.com/en/imprint/ for information on the provider.

Notice: Before you use the program in productive use, please take all necessary precautions, e.g. testing and verifying the program with regard to your specific use. The program was tested solely for our own use cases, which might differ from yours.

More Repositories

1

DnA

Data and Analytics Platform provides A-Z solution for enterprises in Analytics area, from transparency on planned and ongoing activities up to providing open source components, data and trainings to realize them. All in self-service manner, cloud independent with minimum infrastructure footprint.
Java
255
star
2

odxtools

odxtools is a collection of utilities to interact with the diagnostic functionality of automotive electronic control units using python
Python
176
star
3

foss

A collection of information on Mercedes-Benz Open Source Stuff - Code of Conduct, Mercedes-Benz CLA, and more.
68
star
4

mercedes-benz-foss-manifesto

This is the Mercedes-Benz FOSS Manifesto - our path to embrace Open Source
67
star
5

mo360-ftk

MO360 Frontend Toolkit: A toolkit for single page applications (SPA) based on React and Typescript that allows to extract single features into microfrontends.
TypeScript
61
star
6

cluster-api-state-metrics

THIS PROJECT IS NO LONGER MAINTAINED AND IS ARCHIVED. cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resource objects related of Kubernetes Cluster API.
Go
60
star
7

selfsupervised_flow

Code for Paper "Self-Supervised LiDAR Scene Flow and Motion Segmentation"
Python
56
star
8

namespace-provisioner

A Kubernetes operator creating K8s resources by annotating namespaces
Go
50
star
9

vehicle-information-service

This is an implementation of the W3C Vehicle Information Service standard.
Rust
37
star
10

kosmoo

A prometheus exporter which exposes metrics about PersistentVolumes and OpenStack
Go
37
star
11

BYOCAR-sample-app

Bring-Your-Own-Car Sample-App from Mercedes-Benz /developers
JavaScript
32
star
12

MBSDK-Mobile-iOS

Mercedes-Benz Mobile SDK - Mobile module for iOS
Swift
26
star
13

ansible-for-splunk-cloud

Ansible playbooks for configuring and managing Splunk Cloud deployments with the Admin Config Service (ACS) API
24
star
14

garm-operator

a k8s operator to run garm
Go
19
star
15

pipeliner

This component is used to define complex pipelines and run them in Jenkins
Groovy
18
star
16

product-kit_core

Product Kit Core provides design tokens for the Mercedes-Benz Tech Innovation styleguide.
JavaScript
16
star
17

MBSDK-Mobile-Android

Mercedes-Benz Mobile SDK - Mobile module for Android
Kotlin
16
star
18

acentrik

Repository to store helm charts for setting up private distributed infrastructure for Acentrik
Python
15
star
19

MOSIM_Core

The MOSIM Framework is an open modular framework for efficient and interactive simulation and analysis of realistic human motions for professional applications.
C#
15
star
20

MBSDK-CarKit-iOS

Mercedes-Benz Mobile SDK - CarKit module for iOS
Swift
12
star
21

disclosure-cli

Go
9
star
22

kafka-integration-samples

This repository contains a collection of sample code to demonstrate the usage of a Kafka client to authenticate via OAuth and read data from a secured topic.
Python
9
star
23

dp_learningplatform

An Open Source Learning Management System (LMS) for larger organisations. Targeted at efficient learning and retaining learned content. Build upon Wordpress! 2023-12-11: We plan to delete this repository soon.
PHP
9
star
24

product-kit_vue

Product Kit Vue provides a Mercedes-Benz Tech Innovation theme for Vuetify
Vue
7
star
25

garm-provider-k8s

a kubernetes provider for garm
Go
6
star
26

MOSIM

The MOSIM Framework is an open modular framework for efficient and interactive simulation and analysis of realistic human motions for professional applications.
Batchfile
6
star
27

MBSDK-community-support

Central collaboration space for the mobile app development community of the Mercedes-Benz Mobile SDK
6
star
28

product-kit_tailwind

JavaScript
5
star
29

MBSDK-RealmKit-iOS

Mercedes-Benz Mobile SDK - RealmKit module for iOS
Swift
5
star
30

sechub-plugin-intellij

intellij plugin for sechub
Java
5
star
31

product-kit_angular

Product Kit design tokens and styling for Angular.
TypeScript
5
star
32

debug-monkey

Lua
4
star
33

sechub-plugin-eclipse

eclipse plugin for sechub https://marketplace.eclipse.org/content/sechub
Java
3
star
34

MOSIM_Tools

The MOSIM Framework is an open modular framework for efficient and interactive simulation and analysis of realistic human motions for professional applications.
C#
3
star
35

MBSDK-CommonKit-iOS

Mercedes-Benz Mobile SDK - CommonKit module for iOS
Swift
3
star
36

GreenCodeEvaluator

Repository for the HerHackathon 2021
Python
3
star
37

MOSIM_Services

The MOSIM Framework is an open modular framework for efficient and interactive simulation and analysis of realistic human motions for professional applications.
C#
3
star
38

sechub-plugin-vscode

VSCode/VSCodium/Eclipse Theia plugin for sechub
TypeScript
2
star
39

MBSDK-NetworkKit-iOS

Mercedes-Benz Mobile SDK - NetworkKit module for iOS
Swift
2
star
40

MOSIM_Demos

MOSIM sample projects
C#
2
star
41

MBSDK-IngressKit-iOS

Mercedes-Benz Mobile SDK - IngressKit module for iOS
Swift
2
star
42

MBSDK-RealmKit-Android

Mercedes-Benz Mobile SDK - RealmKit module for Android
Kotlin
2
star
43

product-kit_react

JavaScript
2
star
44

roadC

Read-Only Array Data Compaction (roadC)
C
1
star
45

test-repo

1
star
46

product-kit_actions

1
star
47

automotive_feature_engineering

Python
1
star
48

multi-event-calendar

Multiple events calendar based on angular. The calendar displays multiple not overlapping date ranges and allows to select ranges and to create new ranges.
TypeScript
1
star
49

neural_representation_of_differentiable_trees

Provider Information:
Python
1
star