diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml
new file mode 100644
index 00000000..c9e3e9c8
--- /dev/null
+++ b/.github/workflows/codacy-analysis.yml
@@ -0,0 +1,44 @@
+# This workflow checks out code, performs a Codacy security scan
+# and integrates the results with the
+# GitHub Advanced Security code scanning feature. For more information on
+# the Codacy security scan action usage and parameters, see
+# https://github.com/codacy/codacy-analysis-cli-action.
+# For more information on Codacy Analysis CLI in general, see
+# https://github.com/codacy/codacy-analysis-cli.
+
+name: Codacy Security Scan
+
+on:
+ push:
+ branches: [ "master", "main" ]
+ pull_request:
+ branches: [ "master", "main" ]
+
+jobs:
+ codacy-security-scan:
+ name: Codacy Security Scan
+ runs-on: ubuntu-latest
+ steps:
+ # Checkout the repository to the GitHub Actions runner
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
+ - name: Run Codacy Analysis CLI
+ uses: codacy/codacy-analysis-cli-action@1.0.0
+ with:
+ # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
+ # You can also omit the token and run the tools that support default configurations
+ project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
+ verbose: true
+ output: results.sarif
+ format: sarif
+ # Force 0 exit code to allow SARIF file generation
+ # This will handover control about PR rejection to the GitHub side
+ max-allowed-issues: 2147483647
+
+ # Upload the SARIF file generated in the previous step
+ - name: Upload SARIF results file
+ uses: github/codeql-action/upload-sarif@v1
+ with:
+ sarif_file: results.sarif
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 00000000..4f01cf2b
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,71 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+name: "CodeQL"
+
+on:
+ push:
+ branches: [master]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [master]
+ schedule:
+ - cron: '0 19 * * 2'
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ # Override automatic language detection by changing the below list
+ # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
+ language: ['java', 'javascript']
+ # Learn more...
+ # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ # We must fetch at least the immediate parents so that if this is
+ # a pull request then we can checkout the head.
+ fetch-depth: 2
+
+ # If this run was triggered by a pull request event, then checkout
+ # the head of the pull request instead of the merge commit.
+ - run: git checkout HEAD^2
+ if: ${{ github.event_name == 'pull_request' }}
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v1
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v1
+
+ # âšī¸ Command-line programs to run using the OS shell.
+ # đ https://git.io/JvXDl
+
+ # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines
+ # and modify them (or add more) to build your code if your project
+ # uses a compiled language
+
+ #- run: |
+ # make bootstrap
+ # make release
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/fortify-analysis.yml b/.github/workflows/fortify-analysis.yml
new file mode 100644
index 00000000..41738e05
--- /dev/null
+++ b/.github/workflows/fortify-analysis.yml
@@ -0,0 +1,95 @@
+################################################################################################################################################
+# Fortify lets you build secure software fast with an appsec platform that automates testing throughout the DevSecOps pipeline. Fortify static,#
+# dynamic, interactive, and runtime security testing is available on premises or as a service. To learn more about Fortify, start a free trial #
+# or contact our sales team, visit microfocus.com/appsecurity. #
+# #
+# Use this workflow template as a basis for integrating Fortify on Demand Static Application Security Testing(SAST) into your GitHub workflows.#
+# This template demonstrates the steps to prepare the code+dependencies, initiate a scan, download results once complete and import into #
+# GitHub Security Code Scanning Alerts. Existing customers should review inputs and environment variables below to configure scanning against #
+# an existing application in your Fortify on Demand tenant. Additional information is available in the comments throughout the workflow, the #
+# documentation for the Fortify actions used, and the Fortify on Demand / ScanCentral Client product documentation. If you need additional #
+# assistance with configuration, feel free to create a help ticket in the Fortify on Demand portal. #
+################################################################################################################################################
+
+name: Fortify on Demand Scan
+
+# TODO: Customize trigger events based on your DevSecOps processes and typical FoD SAST scan time
+on:
+ workflow_dispatch:
+ push:
+ branches: [master]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [master]
+
+jobs:
+ FoD-SAST-Scan:
+ # Use the appropriate runner for building your source code.
+ # TODO: Use a Windows runner for .NET projects that use msbuild. Additional changes to RUN commands will be required to switch to Windows syntax.
+ runs-on: ubuntu-latest
+
+ steps:
+ # Check out source code
+ - name: Check Out Source Code
+ uses: actions/checkout@v2
+ with:
+ # Fetch at least the immediate parents so that if this is a pull request then we can checkout the head.
+ fetch-depth: 2
+ # If this run was triggered by a pull request event, then checkout the head of the pull request instead of the merge commit.
+ - run: git checkout HEAD^2
+ if: ${{ github.event_name == 'pull_request' }}
+ # Java 8 required by ScanCentral Client and FoD Uploader(Univeral CI Tool)
+ - name: Setup Java
+ uses: actions/setup-java@v1
+ with:
+ java-version: 13
+
+ # Prepare source+dependencies for upload. The default example is for a Maven project that uses pom.xml.
+ # TODO: Update PACKAGE_OPTS based on the ScanCentral Client documentation for your project's included tech stack(s). Helpful hints:
+ # ScanCentral Client will download dependencies for maven (-bt mvn) and gradle (-bt gradle).
+ # ScanCentral Client can download dependencies for msbuild projects (-bt msbuild); however, you must convert the workflow to use a Windows runner.
+ # ScanCentral has additional options that should be set for PHP and Python projects
+ # For other build tools, add your build commands to download necessary dependencies and prepare according to Fortify on Demand Packaging documentation.
+ # ScanCentral Client documentation is located at https://www.microfocus.com/documentation/fortify-software-security-center/
+ - name: Download Fortify ScanCentral Client
+ uses: fortify/gha-setup-scancentral-client@v1
+ - name: Package Code + Dependencies
+ run: scancentral package $PACKAGE_OPTS -o package.zip
+ env:
+ PACKAGE_OPTS: "-bt mvn"
+
+ # Start Fortify on Demand SAST scan and wait until results complete. For more information on FoDUploader commands, see https://github.com/fod-dev/fod-uploader-java
+ # TODO: Update ENV variables for your application and create the necessary GitHub Secrets. Helpful hints:
+ # Credentials and release ID should be obtained from your FoD tenant (either Personal Access Token or API Key can be used).
+ # Automated Audit preference should be configured for the release's Static Scan Settings in the Fortify on Demand portal.
+ - name: Download Fortify on Demand Universal CI Tool
+ uses: fortify/gha-setup-fod-uploader@v1
+ - name: Perform SAST Scan
+ run: java -jar $FOD_UPLOAD_JAR -z package.zip -aurl $FOD_API_URL -purl $FOD_URL -rid "$FOD_RELEASE_ID" -tc "$FOD_TENANT" -uc "$FOD_USER" "$FOD_PAT" $FOD_UPLOADER_OPTS -n "$FOD_UPLOADER_NOTES"
+ env:
+ FOD_TENANT: ${{ secrets.FOD_TENANT }}
+ FOD_USER: ${{ secrets.FOD_USER }}
+ FOD_PAT: ${{ secrets.FOD_PAT }}
+ FOD_RELEASE_ID: ${{ secrets.FOD_RELEASE_ID }}
+ FOD_URL: "https://ams.fortify.com/"
+ FOD_API_URL: "https://api.ams.fortify.com/"
+ FOD_UPLOADER_OPTS: "-ep 2 -pp 0 -I 1 -apf"
+ FOD_UPLOADER_NOTES: 'Triggered by GitHub Actions (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})'
+
+ # Once scan completes, pull SAST issues from Fortify on Demand and generate SARIF output.
+ # TODO: Review Action inputs. For most users, these will be the same as used in the Perform SAST Scan step.
+ - name: Download Results
+ uses: fortify/gha-fod-generate-sarif@1.1.0
+ with:
+ base-url: https://ams.fortify.com
+ tenant: ${{ secrets.FOD_TENANT }}
+ user: ${{ secrets.FOD_USER }}
+ password: ${{ secrets.FOD_PAT }}
+ release-id: ${{ secrets.FOD_RELEASE_ID }}
+ output: ./sarif/output.sarif
+
+ # Import Fortify on Demand results to GitHub Security Code Scanning
+ - name: Import Results
+ uses: github/codeql-action/upload-sarif@v1
+ with:
+ sarif_file: ./sarif/output.sarif
diff --git a/.github/workflows/ossar-analysis.yml b/.github/workflows/ossar-analysis.yml
new file mode 100644
index 00000000..84e84392
--- /dev/null
+++ b/.github/workflows/ossar-analysis.yml
@@ -0,0 +1,51 @@
+# This workflow integrates a collection of open source static analysis tools
+# with GitHub code scanning. For documentation, or to provide feedback, visit
+# https://github.com/github/ossar-action
+name: OSSAR
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ OSSAR-Scan:
+ # OSSAR runs on windows-latest.
+ # ubuntu-latest and macos-latest support coming soon
+ runs-on: windows-latest
+
+ steps:
+ # Checkout your code repository to scan
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ # We must fetch at least the immediate parents so that if this is
+ # a pull request then we can checkout the head.
+ fetch-depth: 2
+
+ # If this run was triggered by a pull request event, then checkout
+ # the head of the pull request instead of the merge commit.
+ - run: git checkout HEAD^2
+ if: ${{ github.event_name == 'pull_request' }}
+
+ # Ensure a compatible version of dotnet is installed.
+ # The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201.
+ # A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action.
+ # GitHub hosted runners already have a compatible version of dotnet installed and this step may be skipped.
+ # For self-hosted runners, ensure dotnet version 3.1.201 or later is installed by including this action:
+ # - name: Install .NET
+ # uses: actions/setup-dotnet@v1
+ # with:
+ # dotnet-version: '3.1.x'
+
+ # Run open source static analysis tools
+ - name: Run OSSAR
+ uses: github/ossar-action@v1
+ id: ossar
+
+ # Upload results to the Security tab
+ - name: Upload OSSAR results
+ uses: github/codeql-action/upload-sarif@v1
+ with:
+ sarif_file: ${{ steps.ossar.outputs.sarifFile }}
diff --git a/.github/workflows/veracode-analysis.yml b/.github/workflows/veracode-analysis.yml
new file mode 100644
index 00000000..a270e0e1
--- /dev/null
+++ b/.github/workflows/veracode-analysis.yml
@@ -0,0 +1,60 @@
+# This workflow will initiate a Veracode Static Analysis Pipeline scan, return a results.json and convert to SARIF for upload as a code scanning alert
+
+name: Veracode Static Analysis Pipeline Scan
+
+# Controls when the action will run. Triggers the workflow on push or pull request
+# events but only for the master branch
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ # This workflow contains a job to build and submit pipeline scan, you will need to customize the build process accordingly and make sure the artifact you build is used as the file input to the pipeline scan file parameter
+ build-and-pipeline-scan:
+ # The type of runner that the job will run on
+ runs-on: ubuntu-latest
+ steps:
+
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it and copies all sources into ZIP file for submitting for analysis. Replace this section with your applications build steps
+ - uses: actions/checkout@v2
+ with:
+ repository: ''
+
+ - uses: papeloto/action-zip@v1
+ with:
+ files: /
+ recursive: true
+ dest: veracode-pipeline-scan-results-to-sarif.zip
+
+ - uses: actions/upload-artifact@v1
+ with:
+ name: my-artifact
+ path: veracode-pipeline-scan-results-to-sarif.zip
+
+ # download the Veracode Static Analysis Pipeline scan jar
+ - uses: wei/curl@master
+ with:
+ args: -O https://downloads.veracode.com/securityscan/pipeline-scan-LATEST.zip
+ - run: unzip -o pipeline-scan-LATEST.zip
+
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 13
+ - run: java -jar pipeline-scan.jar --veracode_api_id "${{secrets.VERACODE_API_ID}}" --veracode_api_key "${{secrets.VERACODE_API_KEY}}" --fail_on_severity="Very High, High" --file veracode-pipeline-scan-results-to-sarif.zip
+ continue-on-error: true
+ - uses: actions/upload-artifact@v1
+ with:
+ name: ScanResults
+ path: results.json
+ - name: Convert pipeline scan output to SARIF format
+ id: convert
+ uses: veracode/veracode-pipeline-scan-results-to-sarif@master
+ with:
+ pipeline-results-json: results.json
+ - uses: github/codeql-action/upload-sarif@v1
+ with:
+ # Path to SARIF file relative to the root of the repository
+ sarif_file: veracode-results.sarif
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 96f6de9d..3ba69115 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -10,9 +10,6 @@
-
-
-