From ffb47f2a69bae85e0aea93902b72a1a9f52019c8 Mon Sep 17 00:00:00 2001 From: Shayne Michael Bacik <95336295+ShayneMichaelBacik1@users.noreply.github.com> Date: Mon, 13 Jun 2022 10:12:44 -0600 Subject: [PATCH 1/2] fortify - name: Close Stale Issues uses: actions/stale@v5.0.0 with: # Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`. repo-token: # optional, default is ${{ github.token }} # The message to post on the issue when tagging it. If none provided, will not mark issues stale. stale-issue-message: # optional # The message to post on the pull request when tagging it. If none provided, will not mark pull requests stale. stale-pr-message: # optional # The message to post on the issue when closing it. If none provided, will not comment when closing an issue. close-issue-message: # optional # The message to post on the pull request when closing it. If none provided, will not comment when closing a pull requests. close-pr-message: # optional # The number of days old an issue or a pull request can be before marking it stale. Set to -1 to never mark issues or pull requests as stale automatically. days-before-stale: # optional, default is 60 # The number of days old an issue can be before marking it stale. Set to -1 to never mark issues as stale automatically. Override "days-before-stale" option regarding only the issues. days-before-issue-stale: # optional # The number of days old a pull request can be before marking it stale. Set to -1 to never mark pull requests as stale automatically. Override "days-before-stale" option regarding only the pull requests. days-before-pr-stale: # optional # The number of days to wait to close an issue or a pull request after it being marked stale. Set to -1 to never close stale issues or pull requests. days-before-close: # optional, default is 7 # The number of days to wait to close an issue after it being marked stale. Set to -1 to never close stale issues. Override "days-before-close" option regarding only the issues. days-before-issue-close: # optional # The number of days to wait to close a pull request after it being marked stale. Set to -1 to never close stale pull requests. Override "days-before-close" option regarding only the pull requests. days-before-pr-close: # optional # The label to apply when an issue is stale. stale-issue-label: # optional, default is Stale # The label to apply when an issue is closed. close-issue-label: # optional # The labels that mean an issue is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2"). exempt-issue-labels: # optional, default is # The label to apply when a pull request is stale. stale-pr-label: # optional, default is Stale # The label to apply when a pull request is closed. close-pr-label: # optional # The labels that mean a pull request is exempt from being marked as stale. Separate multiple labels with commas (eg. "label1,label2"). exempt-pr-labels: # optional, default is # The milestones that mean an issue or a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). exempt-milestones: # optional, default is # The milestones that mean an issue is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). Override "exempt-milestones" option regarding only the issues. exempt-issue-milestones: # optional, default is # The milestones that mean a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). Override "exempt-milestones" option regarding only the pull requests. exempt-pr-milestones: # optional, default is # Exempt all issues and pull requests with milestones from being marked as stale. Default to false. exempt-all-milestones: # optional, default is false # Exempt all issues with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the issues. exempt-all-issue-milestones: # optional, default is # Exempt all pull requests with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the pull requests. exempt-all-pr-milestones: # optional, default is # Only issues or pull requests with all of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. only-labels: # optional, default is # Only issues or pull requests with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. any-of-labels: # optional, default is # Only issues with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. Override "any-of-labels" option regarding only the issues. any-of-issue-labels: # optional, default is # Only pull requests with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. Override "any-of-labels" option regarding only the pull requests. any-of-pr-labels: # optional, default is # Only issues with all of these labels are checked if stale. Defaults to `[]` (disabled) and can be a comma-separated list of labels. Override "only-labels" option regarding only the issues. only-issue-labels: # optional, default is # Only pull requests with all of these labels are checked if stale. Defaults to `[]` (disabled) and can be a comma-separated list of labels. Override "only-labels" option regarding only the pull requests. only-pr-labels: # optional, default is # The maximum number of operations per run, used to control rate limiting (GitHub API CRUD related). operations-per-run: # optional, default is 30 # Remove stale labels from issues and pull requests when they are updated or commented on. remove-stale-when-updated: # optional, default is true # Remove stale labels from issues when they are updated or commented on. Override "remove-stale-when-updated" option regarding only the issues. remove-issue-stale-when-updated: # optional, default is # Remove stale labels from pull requests when they are updated or commented on. Override "remove-stale-when-updated" option regarding only the pull requests. remove-pr-stale-when-updated: # optional, default is # Run the processor in debug mode without actually performing any operations on live issues. debug-only: # optional, default is false # The order to get issues or pull requests. Defaults to false, which is descending. ascending: # optional, default is false # Delete the git branch after closing a stale pull request. delete-branch: # optional, default is false # The date used to skip the stale action on issue/pull request created before it (ISO 8601 or RFC 2822). start-date: # optional, default is # The assignees which exempt an issue or a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). exempt-assignees: # optional, default is # The assignees which exempt an issue from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). Override "exempt-assignees" option regarding only the issues. exempt-issue-assignees: # optional, default is # The assignees which exempt a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). Override "exempt-assignees" option regarding only the pull requests. exempt-pr-assignees: # optional, default is # Exempt all issues and pull requests with assignees from being marked as stale. Default to false. exempt-all-assignees: # optional, default is false # Exempt all issues with assignees from being marked as stale. Override "exempt-all-assignees" option regarding only the issues. exempt-all-issue-assignees: # optional, default is # Exempt all pull requests with assignees from being marked as stale. Override "exempt-all-assignees" option regarding only the pull requests. exempt-all-pr-assignees: # optional, default is # Exempt draft pull requests from being marked as stale. Default to false. exempt-draft-pr: # optional, default is false # Display some statistics at the end regarding the stale workflow (only when the logs are enabled). enable-statistics: # optional, default is true # A comma delimited list of labels to add when a stale issue or pull request receives activity and has the stale-issue-label or stale-pr-label removed from it. labels-to-add-when-unstale: # optional, default is # A comma delimited list of labels to remove when a stale issue or pull request receives activity and has the stale-issue-label or stale-pr-label removed from it. labels-to-remove-when-unstale: # optional, default is # Any update (update/comment) can reset the stale idle time on the issues and pull requests. ignore-updates: # optional, default is false # Any update (update/comment) can reset the stale idle time on the issues. Override "ignore-updates" option regarding only the issues. ignore-issue-updates: # optional, default is # Any update (update/comment) can reset the stale idle time on the pull requests. Override "ignore-updates" option regarding only the pull requests. ignore-pr-updates: # optional, default is --- .github/workflows/fortify.yml | 98 +++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/fortify.yml diff --git a/.github/workflows/fortify.yml b/.github/workflows/fortify.yml new file mode 100644 index 0000000..d581459 --- /dev/null +++ b/.github/workflows/fortify.yml @@ -0,0 +1,98 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +################################################################################################################################################ +# 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" ] + schedule: + - cron: '35 8 * * 4' + +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 + permissions: + actions: read + contents: read + security-events: write + + steps: + # Check out source code + - name: Check Out Source Code + uses: actions/checkout@v3 + + # Java is required to run the various Fortify utilities. + # When scanning a Java application, please use the appropriate Java version for building your application. + - name: Setup Java + uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: 'temurin' + + # 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@5b7382f8234fb9840958c49d5f32ae854115f9f3 + - 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@6e6bb8a33cb476e240929fa8ebc739ff110e7433 + - 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_URL: "https://ams.fortify.com/" + FOD_API_URL: "https://api.ams.fortify.com/" + FOD_TENANT: ${{ secrets.FOD_TENANT }} + FOD_USER: ${{ secrets.FOD_USER }} + FOD_PAT: ${{ secrets.FOD_PAT }} + FOD_RELEASE_ID: ${{ secrets.FOD_RELEASE_ID }} + 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. + - name: Export results to GitHub-optimized SARIF + uses: fortify/gha-export-vulnerabilities@fcb374411cff9809028c911dabb8b57dbdae623b + with: + fod_base_url: "https://ams.fortify.com/" + fod_tenant: ${{ secrets.FOD_TENANT }} + fod_user: ${{ secrets.FOD_USER }} + fod_password: ${{ secrets.FOD_PAT }} + fod_release_id: ${{ secrets.FOD_RELEASE_ID }} + + # Import Fortify on Demand results to GitHub Security Code Scanning + - name: Import Results + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: ./gh-fortify-sast.sarif From 3a984efb9c6a548ec151cdbb2bef03f0d86fd5a3 Mon Sep 17 00:00:00 2001 From: Shayne Michael Bacik <95336295+ShayneMichaelBacik1@users.noreply.github.com> Date: Sat, 6 Aug 2022 09:53:32 -0400 Subject: [PATCH 2/2] S.BCode.yml.account (Set) 1. Create Title 2. Learn code 3. Help Understand 4.Trust in Others 5. Open strong characters 6. Be effective, effecient and excel 7. STAY POSITIVE 8. Payloads 9.share rewards team rules 10.enjoy the fruits of our laborers. --- .github/workflows/Kcodeql.ymlO | 72 ++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/Kcodeql.ymlO diff --git a/.github/workflows/Kcodeql.ymlO b/.github/workflows/Kcodeql.ymlO new file mode 100644 index 0000000..ba855f3 --- /dev/null +++ b/.github/workflows/Kcodeql.ymlO @@ -0,0 +1,72 @@ +# 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. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '43 10 * * 5' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + 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. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # 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@v2 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2