From bb9101ed82fa9485fe5c6677f5608c3a8c077f25 Mon Sep 17 00:00:00 2001 From: Miguel Freitas <13312380+miguelfreitas93@users.noreply.github.com> Date: Thu, 18 Jun 2020 01:46:26 +0100 Subject: [PATCH] add support to 2020.2.18 CLI --- ....2.11-generate-token-wrong-credentials.yml | 2 +- .../{ => archived}/cx-2020.2.11-osa-scan.yml | 0 ...020.2.11-revoke-token-trust-certs-true.yml | 0 .../cx-2020.2.11-revoke-token.yml | 0 .../{ => archived}/cx-2020.2.11-sast-scan.yml | 0 .../{ => archived}/cx-2020.2.11-sca-scan.yml | 0 ....2.18-generate-token-wrong-credentials.yml | 26 ++++++++++++++ .github/workflows/cx-2020.2.18-osa-scan.yml | 34 +++++++++++++++++++ ...020.2.18-revoke-token-trust-certs-true.yml | 25 ++++++++++++++ .../workflows/cx-2020.2.18-revoke-token.yml | 24 +++++++++++++ .github/workflows/cx-2020.2.18-sast-scan.yml | 33 ++++++++++++++++++ .github/workflows/cx-2020.2.18-sca-scan.yml | 30 ++++++++++++++++ README.md | 1 + src/cli/cli.js | 11 +++--- 14 files changed, 181 insertions(+), 5 deletions(-) rename .github/workflows/{ => archived}/cx-2020.2.11-generate-token-wrong-credentials.yml (91%) rename .github/workflows/{ => archived}/cx-2020.2.11-osa-scan.yml (100%) rename .github/workflows/{ => archived}/cx-2020.2.11-revoke-token-trust-certs-true.yml (100%) rename .github/workflows/{ => archived}/cx-2020.2.11-revoke-token.yml (100%) rename .github/workflows/{ => archived}/cx-2020.2.11-sast-scan.yml (100%) rename .github/workflows/{ => archived}/cx-2020.2.11-sca-scan.yml (100%) create mode 100644 .github/workflows/cx-2020.2.18-generate-token-wrong-credentials.yml create mode 100644 .github/workflows/cx-2020.2.18-osa-scan.yml create mode 100644 .github/workflows/cx-2020.2.18-revoke-token-trust-certs-true.yml create mode 100644 .github/workflows/cx-2020.2.18-revoke-token.yml create mode 100644 .github/workflows/cx-2020.2.18-sast-scan.yml create mode 100644 .github/workflows/cx-2020.2.18-sca-scan.yml diff --git a/.github/workflows/cx-2020.2.11-generate-token-wrong-credentials.yml b/.github/workflows/archived/cx-2020.2.11-generate-token-wrong-credentials.yml similarity index 91% rename from .github/workflows/cx-2020.2.11-generate-token-wrong-credentials.yml rename to .github/workflows/archived/cx-2020.2.11-generate-token-wrong-credentials.yml index 883ef18b..21d510f4 100644 --- a/.github/workflows/cx-2020.2.11-generate-token-wrong-credentials.yml +++ b/.github/workflows/archived/cx-2020.2.11-generate-token-wrong-credentials.yml @@ -1,4 +1,4 @@ -name: 2020.1.12 Generate Token Wrong Credentials +name: 2020.2.11 Generate Token Wrong Credentials on: push: branches: diff --git a/.github/workflows/cx-2020.2.11-osa-scan.yml b/.github/workflows/archived/cx-2020.2.11-osa-scan.yml similarity index 100% rename from .github/workflows/cx-2020.2.11-osa-scan.yml rename to .github/workflows/archived/cx-2020.2.11-osa-scan.yml diff --git a/.github/workflows/cx-2020.2.11-revoke-token-trust-certs-true.yml b/.github/workflows/archived/cx-2020.2.11-revoke-token-trust-certs-true.yml similarity index 100% rename from .github/workflows/cx-2020.2.11-revoke-token-trust-certs-true.yml rename to .github/workflows/archived/cx-2020.2.11-revoke-token-trust-certs-true.yml diff --git a/.github/workflows/cx-2020.2.11-revoke-token.yml b/.github/workflows/archived/cx-2020.2.11-revoke-token.yml similarity index 100% rename from .github/workflows/cx-2020.2.11-revoke-token.yml rename to .github/workflows/archived/cx-2020.2.11-revoke-token.yml diff --git a/.github/workflows/cx-2020.2.11-sast-scan.yml b/.github/workflows/archived/cx-2020.2.11-sast-scan.yml similarity index 100% rename from .github/workflows/cx-2020.2.11-sast-scan.yml rename to .github/workflows/archived/cx-2020.2.11-sast-scan.yml diff --git a/.github/workflows/cx-2020.2.11-sca-scan.yml b/.github/workflows/archived/cx-2020.2.11-sca-scan.yml similarity index 100% rename from .github/workflows/cx-2020.2.11-sca-scan.yml rename to .github/workflows/archived/cx-2020.2.11-sca-scan.yml diff --git a/.github/workflows/cx-2020.2.18-generate-token-wrong-credentials.yml b/.github/workflows/cx-2020.2.18-generate-token-wrong-credentials.yml new file mode 100644 index 00000000..9262eedb --- /dev/null +++ b/.github/workflows/cx-2020.2.18-generate-token-wrong-credentials.yml @@ -0,0 +1,26 @@ +name: 2020.2.18 Generate Token Wrong Credentials +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Checkmarx Action + uses: ./ + with: + cxServer: ${{ secrets.CX_SERVER }} + cxAction: GenerateToken + cxUsername: ${{ secrets.CX_EMAIL }} + cxPassword: "123456" + cxSkipIfFail: true + cxVersion: "2020.2.18" + cxLog: log.log + - name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: log.log + path: log.log diff --git a/.github/workflows/cx-2020.2.18-osa-scan.yml b/.github/workflows/cx-2020.2.18-osa-scan.yml new file mode 100644 index 00000000..f6963796 --- /dev/null +++ b/.github/workflows/cx-2020.2.18-osa-scan.yml @@ -0,0 +1,34 @@ +name: 2020.2.18 OSA Scan +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Checkmarx Action + uses: ./ + with: + cxAction: OsaScan + cxServer: ${{ secrets.CX_OSA_SERVER }} + cxUsername: ${{ secrets.CX_OSA_EMAIL }} + cxPassword: ${{ secrets.CX_OSA_PASSWORD }} + cxTeam: ${{ secrets.CX_OSA_TEAM }} + cxExecutePackageDependency: true + cxVersion: "2020.2.18" + cxLog: log.log + cxGithubIssues: true + cxGithubToken: ${{ secrets.GITHUB_TOKEN }} + cxGithubLabels: bug,test + cxGithubAssignees: miguelfreitas93 + - name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: log.log + path: log.log diff --git a/.github/workflows/cx-2020.2.18-revoke-token-trust-certs-true.yml b/.github/workflows/cx-2020.2.18-revoke-token-trust-certs-true.yml new file mode 100644 index 00000000..eed9167e --- /dev/null +++ b/.github/workflows/cx-2020.2.18-revoke-token-trust-certs-true.yml @@ -0,0 +1,25 @@ +name: 2020.2.18 Revoke Token Trust Certs True +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Checkmarx Action + uses: ./ + with: + cxServer: ${{ secrets.CX_SERVER }} + cxAction: RevokeToken + cxToken: ${{ secrets.CX_TOKEN }} + cxTrustedCertificates: true + cxVersion: "2020.2.18" + cxLog: log.log + - name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: log.log + path: log.log diff --git a/.github/workflows/cx-2020.2.18-revoke-token.yml b/.github/workflows/cx-2020.2.18-revoke-token.yml new file mode 100644 index 00000000..1f9c5f05 --- /dev/null +++ b/.github/workflows/cx-2020.2.18-revoke-token.yml @@ -0,0 +1,24 @@ +name: 2020.2.18 Revoke Token +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Checkmarx Action + uses: ./ + with: + cxServer: ${{ secrets.CX_SERVER }} + cxAction: RevokeToken + cxToken: ${{ secrets.CX_TOKEN }} + cxVersion: "2020.2.18" + cxLog: log.log + - name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: log.log + path: log.log diff --git a/.github/workflows/cx-2020.2.18-sast-scan.yml b/.github/workflows/cx-2020.2.18-sast-scan.yml new file mode 100644 index 00000000..fe0c2267 --- /dev/null +++ b/.github/workflows/cx-2020.2.18-sast-scan.yml @@ -0,0 +1,33 @@ +name: 2020.2.18 SAST Scan +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Checkmarx Action + uses: ./ + with: + cxAction: Scan + cxServer: ${{ secrets.CX_SERVER }} + cxUsername: ${{ secrets.CX_EMAIL }} + cxPassword: ${{ secrets.CX_PASSWORD }} + cxTeam: ${{ secrets.CX_TEAM }} + cxVersion: "2020.2.18" + cxLog: log.log + cxGithubIssues: true + cxGithubToken: ${{ secrets.GITHUB_TOKEN }} + cxGithubLabels: bug,test + cxGithubAssignees: miguelfreitas93 + - name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: log.log + path: log.log diff --git a/.github/workflows/cx-2020.2.18-sca-scan.yml b/.github/workflows/cx-2020.2.18-sca-scan.yml new file mode 100644 index 00000000..96b0b0d2 --- /dev/null +++ b/.github/workflows/cx-2020.2.18-sca-scan.yml @@ -0,0 +1,30 @@ +name: 2020.2.18 SCA Scan +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Checkmarx Action + uses: ./ + with: + cxAction: ScaScan + cxScaAccount: ${{ secrets.CX_SCA_ACCOUNT }} + cxScaUsername: ${{ secrets.CX_SCA_USERNAME }} + cxScaPassword: ${{ secrets.CX_SCA_PASSWORD }} + cxScaPathExclude: coverage,images + cxExecutePackageDependency: true + cxVersion: "2020.2.18" + cxLog: log.log + - name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: log.log + path: log.log diff --git a/README.md b/README.md index 863f3aa6..c9b2e667 100644 --- a/README.md +++ b/README.md @@ -344,6 +344,7 @@ Here the list of versions supported: - 2020.2.3 - 2020.2.7 - 2020.2.11 + - 2020.2.18 ## Secrets diff --git a/src/cli/cli.js b/src/cli/cli.js index 337bedb8..f2c94af0 100644 --- a/src/cli/cli.js +++ b/src/cli/cli.js @@ -19,6 +19,7 @@ const CLI_DOWNLOAD_URLS = [ DOWNLOAD_DOMAIN + "/9.0.0/" + DOWNLOAD_COMMON_PATH + "2020.2.3.zip",//7 DOWNLOAD_DOMAIN + "/9.0.0/" + DOWNLOAD_COMMON_PATH + "2020.2.7.zip",//8 DOWNLOAD_DOMAIN + "/9.0.0/" + DOWNLOAD_COMMON_PATH + "2020.2.11.zip",//9 + DOWNLOAD_DOMAIN + "/9.0.0/" + DOWNLOAD_COMMON_PATH + "2020.2.18.zip",//10 ] const CLI_FOLDER_NAME = "cxcli" @@ -26,9 +27,11 @@ function getCliDownloadUrl(cxVersion) { if (isValidVersion(cxVersion)) { switch (cxVersion) { case "2020": - return CLI_DOWNLOAD_URLS[9] + return CLI_DOWNLOAD_URLS[10] case "2020.2": - return CLI_DOWNLOAD_URLS[9] + return CLI_DOWNLOAD_URLS[10] + case "2020.2.18": + return CLI_DOWNLOAD_URLS[10] case "2020.2.11": return CLI_DOWNLOAD_URLS[9] case "2020.2.7": @@ -82,9 +85,9 @@ function getCliDownloadUrl(cxVersion) { } } else { if (cxVersion.startsWith("2020")) { - return CLI_DOWNLOAD_URLS[9] + return CLI_DOWNLOAD_URLS[10] } else if (cxVersion.startsWith("9.0")) { - return CLI_DOWNLOAD_URLS[9] + return CLI_DOWNLOAD_URLS[10] } else if (cxVersion.startsWith("8.9")) { return CLI_DOWNLOAD_URLS[3] } else if (cxVersion.startsWith("8.8")) {