Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing #10

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
9686f84
Create semgrep.yml
VirajNayak Aug 21, 2023
a01784e
Create sonarcloud.yml
VirajNayak Aug 21, 2023
6a57798
Update semgrep.yml
VirajNayak Aug 22, 2023
fa46571
Update semgrep.yml
VirajNayak Aug 22, 2023
462f577
Delete semgrep.yml
VirajNayak Aug 22, 2023
2c818ac
Delete sonarcloud.yml
VirajNayak Aug 22, 2023
0a82d5f
Create codeql.yml
VirajNayak Aug 22, 2023
f12fddb
Create sonarqube.yml
VirajNayak Aug 22, 2023
0c5ae8a
Create semgrep.yml
VirajNayak Aug 22, 2023
2fe98f7
Update semgrep.yml
VirajNayak Aug 22, 2023
225d604
Delete sonarqube.yml
VirajNayak Aug 22, 2023
39cbeac
Delete semgrep.yml
VirajNayak Aug 22, 2023
b26464b
Create sonarqube.yml
VirajNayak Aug 22, 2023
114ebe1
Create semgrep.yml
VirajNayak Aug 22, 2023
b2a38bd
Update sonarqube.yml
VirajNayak Aug 23, 2023
c4797d1
Update sonarqube.yml
VirajNayak Aug 23, 2023
15b63c5
Update sonarqube.yml
VirajNayak Aug 23, 2023
68f1507
Update semgrep.yml
VirajNayak Aug 23, 2023
e00a960
Update semgrep.yml
VirajNayak Aug 23, 2023
309306e
Update semgrep.yml
VirajNayak Aug 23, 2023
616de32
Update semgrep.yml
VirajNayak Aug 23, 2023
2c8ba70
Update semgrep.yml
VirajNayak Aug 23, 2023
1925327
Update semgrep.yml
VirajNayak Aug 23, 2023
e26093f
Update semgrep.yml
VirajNayak Aug 23, 2023
1d5befb
Update semgrep.yml
VirajNayak Aug 23, 2023
6b5c01c
Update semgrep.yml
VirajNayak Aug 23, 2023
96e2995
Update semgrep.yml
VirajNayak Aug 23, 2023
50af738
Update semgrep.yml
VirajNayak Aug 23, 2023
1f2c587
Add files via upload
VirajNayak Aug 25, 2023
bae3657
Update semgrep.yml
VirajNayak Aug 25, 2023
7b22a50
Update semgrep.yml
VirajNayak Aug 25, 2023
a628c0a
Delete semgrep_rules.yml
VirajNayak Aug 25, 2023
84b2a38
Add files via upload
VirajNayak Aug 25, 2023
c32194d
Update semgrep.yml
VirajNayak Aug 25, 2023
ebe8566
Update semgrep.yml
VirajNayak Aug 25, 2023
220332f
Update semgrep.yml
VirajNayak Aug 25, 2023
68b9012
Delete semgrep_rules.yml
VirajNayak Aug 25, 2023
338ff3a
Add files via upload
VirajNayak Aug 25, 2023
7a8fb81
Update semgrep.yml
VirajNayak Aug 25, 2023
d8a8c4b
Delete semgrep_rules.yaml
VirajNayak Aug 25, 2023
44b6236
Add files via upload
VirajNayak Aug 25, 2023
8ec7e88
Add files via upload
VirajNayak Aug 28, 2023
04e920e
Update semgrep.yml
VirajNayak Aug 28, 2023
0641f23
Update semgrep.yml
VirajNayak Aug 28, 2023
871f1fe
Delete semgrep_rules_copy.yaml
VirajNayak Aug 28, 2023
2d7308c
Delete semgrep_rules.yaml
VirajNayak Aug 28, 2023
f1e2165
Add files via upload
VirajNayak Aug 28, 2023
efd7151
Delete semgrep_rules.yaml
VirajNayak Aug 28, 2023
9dec52b
Add files via upload
VirajNayak Aug 28, 2023
35f7f78
Update semgrep.yml
VirajNayak Aug 31, 2023
87a7351
Update semgrep.yml
VirajNayak Aug 31, 2023
bcbc34d
Update semgrep.yml
VirajNayak Aug 31, 2023
ec47e60
Update semgrep.yml
VirajNayak Aug 31, 2023
3c20be5
Update semgrep.yml
VirajNayak Sep 1, 2023
cb7623b
Update semgrep.yml
VirajNayak Sep 1, 2023
b8757ce
Update semgrep.yml
VirajNayak Sep 1, 2023
fbd627c
Update semgrep.yml
VirajNayak Sep 4, 2023
eb566b7
Update semgrep.yml
VirajNayak Sep 4, 2023
8523b6a
Update semgrep.yml
VirajNayak Sep 4, 2023
54f76b4
Update semgrep.yml
VirajNayak Sep 5, 2023
4958cc5
Update semgrep.yml
VirajNayak Sep 5, 2023
065bcef
Update semgrep.yml
VirajNayak Sep 5, 2023
577cb95
Update semgrep.yml
VirajNayak Sep 6, 2023
babe906
Update semgrep.yml
VirajNayak Sep 6, 2023
aeb1f6b
Update semgrep.yml
VirajNayak Sep 6, 2023
2718d31
Update semgrep.yml
VirajNayak Sep 6, 2023
1666ac6
Update semgrep.yml
VirajNayak Sep 6, 2023
43b5263
Update semgrep.yml
VirajNayak Sep 6, 2023
2b83f4f
Update semgrep.yml
VirajNayak Sep 6, 2023
a10a0f3
Delete .github/workflows/semgrep.yml
VirajNayak Sep 6, 2023
5393358
Create semgrep.yml
VirajNayak Sep 6, 2023
72e74c3
Update semgrep.yml
VirajNayak Sep 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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: '31 2 * * 1'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# 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

Check warning

Code scanning / Semgrep

Semgrep Finding: yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
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.

# For more 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#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

Check warning

Code scanning / Semgrep

Semgrep Finding: yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

# ℹ️ 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

Check warning

Code scanning / Semgrep

Semgrep Finding: yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
with:
category: "/language:${{matrix.language}}"
79 changes: 79 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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.

# This workflow file requires a free account on Semgrep.dev to
# manage rules, file ignores, notifications, and more.
#
# See https://semgrep.dev/docs

name: Semgrep

on:
push:
branches: [ "Testing-2" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "Testing-2" ]
schedule:
- cron: '44 18 * * 2'

permissions:
contents: read

jobs:
semgrep:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Scan
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep
steps:
# Checkout project source
- uses: actions/checkout@v3
- name: Semgrep Scan
id: scan
#run: semgrep ci --config=auto --suppress-errors --sarif || true
run: |
semgrep \
--sarif --output report.sarif \
--config=semgrep_rules.yaml

# Scan code using project's configuration on https://semgrep.dev/manage
# - uses: returntocorp/semgrep-action@fcd5ab7459e8d91cb1777481980d1b18b4fc6735
# with:
#publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
#publishDeployment: ${{ secrets.SEMGREP_DEPLOYMENT_ID }}
# generateSarif: "1"

# Upload SARIF file generated in previous step

- name: Add Labels to Code Scanning Issues
env:
SEMGREP_SEVERITY: ${{ steps.scan.outputs.severity }}
run: |
if [[ "$SEMGREP_SEVERITY" == "error" ]]; then
gh issue list | grep "Semgrep" | grep "error" | cut -d' ' -f1 | xargs -I {} gh issue add-label {} "High"
elif [[ "$SEMGREP_SEVERITY" == "warning" ]]; then
gh issue list | grep "Semgrep" | grep "warning" | cut -d' ' -f1 | xargs -I {} gh issue add-label {} "Medium"
elif [[ "$SEMGREP_SEVERITY" == "info" ]]; then
gh issue list | grep "Semgrep" | grep "info" | cut -d' ' -f1 | xargs -I {} gh issue add-label {} "Low"
fi

# Make sure you have the GitHub CLI (gh) available and configured in your workflow.

# - name: Save Report as Pipeline Artifact
# uses: actions/upload-artifact@v3
# with:
# name: report.sarif
# path: report.sarif

# step 4
- name: Publish Code Scanning Alerts
uses: github/codeql-action/upload-sarif@v2

Check warning

Code scanning / Semgrep

Semgrep Finding: yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
with:
sarif_file: report.sarif
66 changes: 66 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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.

# This workflow helps you trigger a SonarQube analysis of your code and populates
# GitHub Code Scanning alerts with the vulnerabilities found.
# (this feature is available starting from SonarQube 9.7, Developer Edition and above)

# 1. Make sure you add a valid GitHub configuration to your SonarQube (Administration > DevOps platforms > GitHub)

# 2. Import your project on SonarQube
# * Add your repository as a new project by clicking "Create project" from your homepage.
#
# 3. Select GitHub Actions as your CI and follow the tutorial
# * a. Generate a new token and add it to your GitHub repository's secrets using the name SONAR_TOKEN
# (On SonarQube, click on your avatar on top-right > My account > Security or ask your administrator)
#
# * b. Copy/paste your SonarQube host URL to your GitHub repository's secrets using the name SONAR_HOST_URL
#
# * c. Copy/paste the project Key into the args parameter below
# (You'll find this information in SonarQube by following the tutorial or by clicking on Project Information at the top-right of your project's homepage)

# Feel free to take a look at our documentation (https://docs.sonarqube.org/latest/analysis/github-integration/)
# or reach out to our community forum if you need some help (https://community.sonarsource.com/c/sq/10)

name: SonarQube analysis

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:

permissions:
pull-requests: read # allows SonarQube to decorate PRs with analysis results

jobs:
Analysis:
runs-on: ubuntu-latest

steps:
- name: Analyze with SonarQube

# You can pin the exact commit or the version.
uses: SonarSource/[email protected]

Check warning

Code scanning / Semgrep

Semgrep Finding: yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
#uses: SonarSource/sonarqube-scan-action@7295e71c9583053f5bf40e9d4068a0c974603ec8

Check failure

Code scanning / Semgrep

Semgrep Finding: generic.secrets.security.detected-sonarqube-docs-api-key.detected-sonarqube-docs-api-key

SonarQube Docs API Key detected
#env:
# GITHUB_TOKEN: ${{ secrets.GT_TOKEN }} # Needed to get PR information
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on SonarQube, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} # add the URL of your instance to the secrets of this repo with the name SONAR_HOST_URL (Settings > Secrets > Actions > add new repository secret)
with:
# Additional arguments for the sonarcloud scanner
args:
# Unique key of your project. You can find it in SonarQube > [my project] > Project Information (top-right menu)
# mandatory
-Dsonar.projectKey=
# Comma-separated paths to directories containing main source files.
#-Dsonar.sources= # optional, default is project base directory
# When you need the analysis to take place in a directory other than the one from which it was launched
#-Dsonar.projectBaseDir= # optional, default is .
# Comma-separated paths to directories containing test source files.
#-Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/
# Adds more detail to both client and server-side analysis logs, activating DEBUG mode for the scanner, and adding client-side environment variables and system properties to the server-side log of analysis report processing.
#-Dsonar.verbose= # optional, default is false
Loading