From 56a36979cc633ab713fad357a83f2a7ad0104d51 Mon Sep 17 00:00:00 2001 From: Mayank Sinha Date: Wed, 21 Jul 2021 17:17:22 -0400 Subject: [PATCH 1/3] Create checkmarx-analysis.yml --- .github/workflows/checkmarx-analysis.yml | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/checkmarx-analysis.yml diff --git a/.github/workflows/checkmarx-analysis.yml b/.github/workflows/checkmarx-analysis.yml new file mode 100644 index 0000000..bf423e5 --- /dev/null +++ b/.github/workflows/checkmarx-analysis.yml @@ -0,0 +1,37 @@ +# This is a basic workflow to help you get started with Using Checkmarx CxFlow Action + +name: CxFlow + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel - this job is specifically configured to use the Checkmarx CxFlow Action +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on - Ubuntu is required as Docker is leveraged for the action + runs-on: ubuntu-latest + + # Steps require - checkout code, run CxFlow Action, Upload SARIF report (optional) + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + # Runs the Checkmarx Scan leveraging the latest version of CxFlow - REFER to Action README for list of inputs + - name: Checkmarx CxFlow Action + uses: checkmarx-ts/checkmarx-cxflow-github-action@v1.0 + with: + project: GithubActionTest + team: '\CxServer\SP\Checkmarx' + checkmarx_url: ${{ secrets.CHECKMARX_URL }} + checkmarx_username: ${{ secrets.CHECKMARX_USERNAME }} + checkmarx_password: ${{ secrets.CHECKMARX_PASSWORD }} + checkmarx_client_secret: ${{ secrets.CHECKMARX_CLIENT_SECRET }} + # Upload the Report for CodeQL/Security Alerts + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: cx.sarif From baaa3997f4c644f67a1185ea790a06a495033820 Mon Sep 17 00:00:00 2001 From: Mayank Sinha Date: Thu, 22 Jul 2021 00:45:07 -0400 Subject: [PATCH 2/3] Create cx.sarif --- cx.sarif | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 cx.sarif diff --git a/cx.sarif b/cx.sarif new file mode 100644 index 0000000..4980d3c --- /dev/null +++ b/cx.sarif @@ -0,0 +1,185 @@ +{ + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.4.json", + "version": "2.1.0", + "runs": [ + { + "tool": { + "driver": { + "name": "Trivy", + "fullName": "Trivy Vulnerability Scanner", + "rules": [ + { + "id": "[MEDIUM] CVE-2019-1549", + "name": "dockerfile_scan", + "shortDescription": { + "text": "CVE-2019-1549 Package: openssl" + }, + "fullDescription": { + "text": "openssl: information disclosure in fork()." + }, + "help": { + "text": "Vulnerability CVE-2019-1549\nSeverity: MEDIUM\nPackage: openssl\nInstalled Version: 1.1.1c-r0\nFixed Version: 1.1.1d-r0\nLink: [CVE-2019-1549](https://aquasecurity.github.io/avd/nvd/cve-2019-1549)", + "markdown": "**Vulnerability CVE-2019-1549**\n| Severity | Package | Installed Version | Fixed Version | Link |\n| --- | --- | --- | --- | --- |\n|MEDIUM|openssl|1.1.1c-r0|1.1.1d-r0|[CVE-2019-1549](https://aquasecurity.github.io/avd/nvd/cve-2019-1549)|\n" + }, + "properties": { + "tags": [ + "vulnerability", + "MEDIUM", + "openssl" + ], + "precision": "very-high" + } + }, + { + "id": "[MEDIUM] CVE-2019-1551", + "name": "dockerfile_scan", + "shortDescription": { + "text": "CVE-2019-1551 Package: openssl" + }, + "fullDescription": { + "text": "openssl: Integer overflow in RSAZ modular exponentiation on x86_64." + }, + "help": { + "text": "Vulnerability CVE-2019-1551\nSeverity: MEDIUM\nPackage: openssl\nInstalled Version: 1.1.1c-r0\nFixed Version: 1.1.1d-r2\nLink: [CVE-2019-1551](https://aquasecurity.github.io/avd/nvd/cve-2019-1551)", + "markdown": "**Vulnerability CVE-2019-1551**\n| Severity | Package | Installed Version | Fixed Version | Link |\n| --- | --- | --- | --- | --- |\n|MEDIUM|openssl|1.1.1c-r0|1.1.1d-r2|[CVE-2019-1551](https://aquasecurity.github.io/avd/nvd/cve-2019-1551)|\n" + }, + "properties": { + "tags": [ + "vulnerability", + "MEDIUM", + "openssl" + ], + "precision": "very-high" + } + }, + { + "id": "[MEDIUM] CVE-2019-1563", + "name": "dockerfile_scan", + "shortDescription": { + "text": "CVE-2019-1563 Package: openssl" + }, + "fullDescription": { + "text": "openssl: information disclosure in PKCS7_dataDecode and CMS_decrypt_set1_pkey." + }, + "help": { + "text": "Vulnerability CVE-2019-1563\nSeverity: MEDIUM\nPackage: openssl\nInstalled Version: 1.1.1c-r0\nFixed Version: 1.1.1d-r0\nLink: [CVE-2019-1563](https://aquasecurity.github.io/avd/nvd/cve-2019-1563)", + "markdown": "**Vulnerability CVE-2019-1563**\n| Severity | Package | Installed Version | Fixed Version | Link |\n| --- | --- | --- | --- | --- |\n|MEDIUM|openssl|1.1.1c-r0|1.1.1d-r0|[CVE-2019-1563](https://aquasecurity.github.io/avd/nvd/cve-2019-1563)|\n" + }, + "properties": { + "tags": [ + "vulnerability", + "MEDIUM", + "openssl" + ], + "precision": "very-high" + } + }, + { + "id": "[LOW] CVE-2019-1547", + "name": "dockerfile_scan", + "shortDescription": { + "text": "CVE-2019-1547 Package: openssl" + }, + "fullDescription": { + "text": "openssl: side-channel weak encryption vulnerability." + }, + "help": { + "text": "Vulnerability CVE-2019-1547\nSeverity: LOW\nPackage: openssl\nInstalled Version: 1.1.1c-r0\nFixed Version: 1.1.1d-r0\nLink: [CVE-2019-1547](https://aquasecurity.github.io/avd/nvd/cve-2019-1547)", + "markdown": "**Vulnerability CVE-2019-1547**\n| Severity | Package | Installed Version | Fixed Version | Link |\n| --- | --- | --- | --- | --- |\n|LOW|openssl|1.1.1c-r0|1.1.1d-r0|[CVE-2019-1547](https://aquasecurity.github.io/avd/nvd/cve-2019-1547)|\n" + }, + "properties": { + "tags": [ + "vulnerability", + "LOW", + "openssl" + ], + "precision": "very-high" + } + }] + } + }, + "results": [ + { + "ruleId": "[MEDIUM] CVE-2019-1549", + "ruleIndex": 0, + "level": "error", + "message": { + "text": "OpenSSL 1.1.1 introduced a rewritten random number generator (RNG). This was intended to include protection in the event of a fork() system call in order to ensure that the parent and child processes did not share the same RNG state. However this protection was not being used in the default case. A partial mitigation for this issue is that the output from a high precision timer is mixed into the RNG state so the likelihood of a parent and child process sharing state is significantly reduced. If an application already calls OPENSSL_init_crypto() explicitly using OPENSSL_INIT_ATFORK then this problem does not occur at all. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c)." + }, + "locations": [{ + "physicalLocation": { + "artifactLocation": { + "uri": "Dockerfile" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endColumn": 1 + } + } + }] + }, + { + "ruleId": "[MEDIUM] CVE-2019-1551", + "ruleIndex": 1, + "level": "error", + "message": { + "text": "There is an overflow bug in the x64_64 Montgomery squaring procedure used in exponentiation with 512-bit moduli. No EC algorithms are affected. Analysis suggests that attacks against 2-prime RSA1024, 3-prime RSA1536, and DSA1024 as a result of this defect would be very difficult to perform and are not believed likely. Attacks against DH512 are considered just feasible. However, for an attack the target would have to re-use the DH512 private key, which is not recommended anyway. Also applications directly using the low level API BN_mod_exp may be affected if they use BN_FLG_CONSTTIME. Fixed in OpenSSL 1.1.1e (Affected 1.1.1-1.1.1d). Fixed in OpenSSL 1.0.2u (Affected 1.0.2-1.0.2t)." + }, + "locations": [{ + "physicalLocation": { + "artifactLocation": { + "uri": "Dockerfile" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endColumn": 1 + } + } + }] + }, + { + "ruleId": "[MEDIUM] CVE-2019-1563", + "ruleIndex": 2, + "level": "error", + "message": { + "text": "In situations where an attacker receives automated notification of the success or failure of a decryption attempt an attacker, after sending a very large number of messages to be decrypted, can recover a CMS/PKCS7 transported encryption key or decrypt any RSA encrypted message that was encrypted with the public RSA key, using a Bleichenbacher padding oracle attack. Applications are not affected if they use a certificate together with the private RSA key to the CMS_decrypt or PKCS7_decrypt functions to select the correct recipient info to decrypt. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s)." + }, + "locations": [{ + "physicalLocation": { + "artifactLocation": { + "uri": "Dockerfile" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endColumn": 1 + } + } + }] + }, + { + "ruleId": "[LOW] CVE-2019-1547", + "ruleIndex": 3, + "level": "error", + "message": { + "text": "Normally in OpenSSL EC groups always have a co-factor present and this is used in side channel resistant code paths. However, in some cases, it is possible to construct a group using explicit parameters (instead of using a named curve). In those cases it is possible that such a group does not have the cofactor present. This can occur even where all the parameters match a known named curve. If such a curve is used then OpenSSL falls back to non-side channel resistant code paths which may result in full key recovery during an ECDSA signature operation. In order to be vulnerable an attacker would have to have the ability to time the creation of a large number of signatures where explicit parameters with no co-factor present are in use by an application using libcrypto. For the avoidance of doubt libssl is not vulnerable because explicit parameters are never used. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s)." + }, + "locations": [{ + "physicalLocation": { + "artifactLocation": { + "uri": "Dockerfile" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endColumn": 1 + } + } + }] + }], + "columnKind": "utf16CodeUnits" + } + ] +} From b29c0f1bc78371d912e3afb40ccb4f796beebd3f Mon Sep 17 00:00:00 2001 From: Mayank Sinha Date: Thu, 22 Jul 2021 00:46:01 -0400 Subject: [PATCH 3/3] Update checkmarx-analysis.yml --- .github/workflows/checkmarx-analysis.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/checkmarx-analysis.yml b/.github/workflows/checkmarx-analysis.yml index bf423e5..491e14a 100644 --- a/.github/workflows/checkmarx-analysis.yml +++ b/.github/workflows/checkmarx-analysis.yml @@ -21,15 +21,15 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 # Runs the Checkmarx Scan leveraging the latest version of CxFlow - REFER to Action README for list of inputs - - name: Checkmarx CxFlow Action - uses: checkmarx-ts/checkmarx-cxflow-github-action@v1.0 - with: - project: GithubActionTest - team: '\CxServer\SP\Checkmarx' - checkmarx_url: ${{ secrets.CHECKMARX_URL }} - checkmarx_username: ${{ secrets.CHECKMARX_USERNAME }} - checkmarx_password: ${{ secrets.CHECKMARX_PASSWORD }} - checkmarx_client_secret: ${{ secrets.CHECKMARX_CLIENT_SECRET }} +# - name: Checkmarx CxFlow Action +# uses: checkmarx-ts/checkmarx-cxflow-github-action@v1.0 +# with: +# project: GithubActionTest +# team: '\CxServer\SP\Checkmarx' +# checkmarx_url: ${{ secrets.CHECKMARX_URL }} +# checkmarx_username: ${{ secrets.CHECKMARX_USERNAME }} +# checkmarx_password: ${{ secrets.CHECKMARX_PASSWORD }} +# checkmarx_client_secret: ${{ secrets.CHECKMARX_CLIENT_SECRET }} # Upload the Report for CodeQL/Security Alerts - name: Upload SARIF file uses: github/codeql-action/upload-sarif@v1