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

security updates #3821

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
1dcc814
fix: package.json & package-lock.json to reduce vulnerabilities
snyk-bot Mar 13, 2024
dbf4c2d
fix: requirements.txt to reduce vulnerabilities
snyk-bot Mar 13, 2024
f1b5e58
fix: requirements.txt to reduce vulnerabilities
snyk-bot Mar 13, 2024
9363c38
Merge pull request #7 from farmmanic/snyk-fix-a554f4dfc933685c1705054…
farmmanic Mar 13, 2024
8db9c26
Merge pull request #6 from farmmanic/snyk-fix-6a094088d7600a35c7d67d2…
farmmanic Mar 13, 2024
25b27a8
Merge pull request #5 from farmmanic/snyk-fix-25d5369d9ec3c0121917bb6…
farmmanic Mar 13, 2024
06f4dcf
fix: upgrade nodemon from 3.0.0 to 3.0.3
snyk-bot Mar 14, 2024
9bceedc
fix: upgrade clean-css from 4.2.3 to 4.2.4
snyk-bot Mar 14, 2024
78075f5
Merge branch 'Aircoookie:main' into main
farmmanic Mar 14, 2024
312a8c4
Merge pull request #9 from farmmanic/snyk-upgrade-f11fcb522e319bf3391…
farmmanic Mar 14, 2024
f0091f7
Merge pull request #8 from farmmanic/snyk-upgrade-6d4e037bb4af4d4787b…
farmmanic Mar 14, 2024
5dd936b
Create crunch42.yml
farmmanic Mar 14, 2024
89aa126
Update crunch42.yml
farmmanic Mar 14, 2024
34b08dd
Update crunch42.yml
farmmanic Mar 14, 2024
f0ab550
Rename crunch42.yml to crunch42.yml>>dropped
farmmanic Mar 14, 2024
e8ac13e
Create snyk-security.yml
farmmanic Mar 14, 2024
a051527
Update snyk-security.yml
farmmanic Mar 14, 2024
d2fe5c3
Create bandit.yml
farmmanic Mar 15, 2024
8e93aae
Create checkmarx-one.yml
farmmanic Mar 15, 2024
8750830
Create pylint.yml
farmmanic Mar 15, 2024
a56676a
Create label.yml
farmmanic Mar 15, 2024
ac4ce47
Merge branch 'Aircoookie:main' into main
farmmanic Mar 18, 2024
2506cd1
Update snyk-security.yml
farmmanic Mar 18, 2024
e6e9806
Update .gitignore
farmmanic Mar 18, 2024
1d5d681
Bump json-schema and jsprim
dependabot[bot] Mar 18, 2024
5723d61
Rename label.yml to labeler.yml
farmmanic Mar 18, 2024
396589c
Rename snyk-security.yml to snyk-security.yml>dropped
farmmanic Mar 18, 2024
02a345a
Rename checkmarx-one.yml to checkmarx-one.yml>dropped
farmmanic Mar 18, 2024
5b64832
Rename pylint.yml to pylint.yml>dropped
farmmanic Mar 18, 2024
2da53f7
Merge pull request #11 from farmmanic/dependabot/npm_and_yarn/json-sc…
farmmanic Mar 18, 2024
ad248fd
Update wled-ci.yml
farmmanic Mar 18, 2024
a80e478
Update requirements.txt
farmmanic Mar 18, 2024
c92c171
Update requirements.txt
farmmanic Mar 18, 2024
8b5a2fb
Create labeler.yml
farmmanic Mar 18, 2024
1c82d7d
Update wled-ci.yml
farmmanic Mar 18, 2024
6bb1c36
Update wled-ci.yml
farmmanic Mar 18, 2024
8cf1c65
Update wled-ci.yml
farmmanic Mar 18, 2024
6f474a4
Update requirements.txt
farmmanic Mar 18, 2024
94e972f
fix: requirements.txt to reduce vulnerabilities
snyk-bot Mar 18, 2024
d4c7c90
Merge pull request #13 from farmmanic/snyk-fix-50b9a2eff1f58094bd620c…
farmmanic Mar 18, 2024
ff6bed6
Update wled-ci.yml
farmmanic Mar 18, 2024
ec6bc06
Update wled-ci.yml
farmmanic Mar 18, 2024
1c7809a
Update wled-ci.yml
farmmanic Mar 18, 2024
6185a3c
Delete requirements.txt
farmmanic Mar 18, 2024
f2ed34f
Update wled-ci.yml
farmmanic Mar 18, 2024
4dd73b2
Update wled-ci.yml
farmmanic Mar 18, 2024
8d90d48
Update wled-ci.yml
farmmanic Mar 18, 2024
21978da
Update wled-ci.yml
farmmanic Mar 18, 2024
2e2f2e2
Update wled-ci.yml
farmmanic Mar 18, 2024
16fdb8a
Update wled-ci.yml
farmmanic Mar 18, 2024
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
22 changes: 22 additions & 0 deletions .github/.github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler

name: Labeler
on: [pull_request_target]

jobs:
label:

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
52 changes: 52 additions & 0 deletions .github/workflows/bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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.

# Bandit is a security linter designed to find common security issues in Python code.
# This action will run Bandit on your codebase.
# The results of the scan will be found under the Security tab of your repository.

# https://github.com/marketplace/actions/bandit-scan is ISC licensed, by abirismyname
# https://pypi.org/project/bandit/ is Apache v2.0 licensed, by PyCQA

name: Bandit
on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '26 18 * * 0'

jobs:
bandit:
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

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bandit Scan
uses: shundor/python-bandit-scan@9cc5aa4a006482b8a7f91134412df6772dbda22c
with: # optional arguments
# exit with 0, even with results found
exit_zero: true # optional, default is DEFAULT
# Github token of the repository (automatically created by Github)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information.
# File or directory to run bandit on
# path: # optional, default is .
# Report only issues of a given severity level or higher. Can be LOW, MEDIUM or HIGH. Default is UNDEFINED (everything)
# level: # optional, default is UNDEFINED
# Report only issues of a given confidence level or higher. Can be LOW, MEDIUM or HIGH. Default is UNDEFINED (everything)
# confidence: # optional, default is UNDEFINED
# comma-separated list of paths (glob patterns supported) to exclude from scan (note that these are in addition to the excluded paths provided in the config file) (default: .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg)
# excluded_paths: # optional, default is DEFAULT
# comma-separated list of test IDs to skip
# skips: # optional, default is DEFAULT
# path to a .bandit file that supplies command line arguments
# ini_path: # optional, default is DEFAULT

55 changes: 55 additions & 0 deletions .github/workflows/checkmarx-one.yml>dropped
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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.

# The Checkmarx One GitHub Action enables you to trigger SAST, SCA, and KICS scans directly from the GitHub workflow.
# It provides a wrapper around the Checkmarx One CLI Tool which creates a zip archive from your source code repository
# and uploads it to Checkmarx One for scanning. The Github Action provides easy integration with GitHub while enabling
# scan customization using the full functionality and flexibility of the CLI tool.

# This is a basic workflow to help you get started with Using Checkmarx One Action,
# documentation can be found here : https://checkmarx.com/resource/documents/en/34965-68702-checkmarx-one-github-actions.html

name: Checkmarx Scan

# Controls when the workflow will run
on:
pull_request:
types: [opened, reopened, synchronize]
branches: [ "main" ]

permissions:
contents: read

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
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

# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# This step checks out a copy of your repository.
- name: Checkout repository
uses: actions/checkout@v3
# This step creates the Checkmarx One scan
- name: Checkmarx One scan
uses: checkmarx/ast-github-action@8e887bb93dacc44e0f5b64ee2b06d5815f89d4fc
with:
base_uri: https://ast.checkmarx.net # This should be replaced by your base uri for Checkmarx One
cx_client_id: ${{ secrets.CX_CLIENT_ID }} # This should be created within your Checkmarx One account : https://checkmarx.com/resource/documents/en/34965-118315-authentication-for-checkmarx-one-cli.html#UUID-a4e31a96-1f36-6293-e95a-97b4b9189060_UUID-4123a2ff-32d0-2287-8dd2-3c36947f675e
cx_client_secret: ${{ secrets.CX_CLIENT_SECRET }} # This should be created within your Checkmarx One account : https://checkmarx.com/resource/documents/en/34965-118315-authentication-for-checkmarx-one-cli.html#UUID-a4e31a96-1f36-6293-e95a-97b4b9189060_UUID-4123a2ff-32d0-2287-8dd2-3c36947f675e
cx_tenant: ${{ secrets.CX_TENANT }} # This should be replaced by your tenant for Checkmarx One
additional_params: --report-format sarif --output-path .
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
# Path to SARIF file relative to the root of the repository
sarif_file: cx_result.sarif
58 changes: 58 additions & 0 deletions .github/workflows/crunch42.yml>>dropped
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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 locates REST API file contracts (Swagger or OpenAPI format, v2 and v3, JSON and YAML)
# and runs 300+ security checks on them using 42Crunch Security Audit technology to uncover
# potential vulnerabilities related to authentication, authorization as well as data validation.
#
# Documentation is located here: https://docs.42crunch.com/latest/content/tasks/integrate_github_actions.htm
#
# To use this workflow, you need a 42Crunch platform account. If you do not have one, you can contact us
# from this page: https://42crunch.com/request-demo.
#
# 1. Follow steps at https://docs.42crunch.com/latest/content/tasks/integrate_github_actions.htm
# to create an API Token on the 42Crunch platform
#
# 2. Create an secret in GitHub as explained in https://docs.42crunch.com/latest/content/tasks/integrate_github_actions.htm
# and store the 42Crunch API Token in that secret. Expected default is API_TOKEN (see the api-token property in the task).
#
# If you have any questions or need help, open an issue at: https://support.42crunch.com.

name: "42Crunch REST API Static Security Testing"

# follow standard Code Scanning triggers
on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '26 20 * * 1'

permissions:
contents: read

jobs:
rest-api-static-security-testing:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for 42Crunch/api-security-audit-action to upload results to Github Code Scanning
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: 42Crunch REST API Static Security Testing
uses: 42Crunch/api-security-audit-action@fc01ea7a89e6268875868f9d89598af7a9899ae0
with:
# Please create free account at https://platform.42crunch.com/register
# Follow these steps to configure API_TOKEN https://docs.42crunch.com/latest/content/tasks/integrate_github_actions.htm
api-token: ${{ secrets.CRUNCH }}
# Fail if any OpenAPI file scores lower than 75
min-score: 75
# Upload results to Github code scanning
upload-to-code-scanning: true
# Github token for uploading the results
github-token: ${{ github.token }}
22 changes: 22 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler

name: Labeler
on: [pull_request_target]

jobs:
label:

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
23 changes: 23 additions & 0 deletions .github/workflows/pylint.yml>dropped
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
79 changes: 79 additions & 0 deletions .github/workflows/snyk-security.yml>dropped
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.

# A sample workflow which sets up Snyk to analyze the full Snyk platform (Snyk Open Source, Snyk Code,
# Snyk Container and Snyk Infrastructure as Code)
# The setup installs the Snyk CLI - for more details on the possible commands
# check https://docs.snyk.io/snyk-cli/cli-reference
# The results of Snyk Code are then uploaded to GitHub Security Code Scanning
#
# In order to use the Snyk Action you will need to have a Snyk API token.
# More details in https://github.com/snyk/actions#getting-your-snyk-token
# or you can signup for free at https://snyk.io/login
#
# For more examples, including how to limit scans to only high-severity issues
# and fail PR checks, see https://github.com/snyk/actions/

name: Snyk Security

on:
push:
branches: ["main" ]
pull_request:
branches: ["main"]

permissions:
contents: read

jobs:
snyk:
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
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Snyk CLI to check for security issues
# Snyk can be used to break the build when it detects security issues.
# In this case we want to upload the SAST issues to GitHub Code Scanning
uses: snyk/actions/setup@806182742461562b67788a64410098c9d9b96adb

# For Snyk Open Source you must first set up the development environment for your application's dependencies
# For example for Node
#- uses: actions/setup-node@v3
# with:
# node-version: 16

env:
# This is where you will need to introduce the Snyk API token created with your Snyk account
SNYK_TOKEN: ${{ secrets.SNYK }}

# Runs Snyk Code (SAST) analysis and uploads result into GitHub.
# Use || true to not fail the pipeline
- name: Snyk Code test
run: snyk code test --sarif > snyk-code.sarif || true

# Runs Snyk Open Source (SCA) analysis and uploads result to Snyk.
- name: Snyk Open Source monitor
run: snyk monitor --all-projects

# Runs Snyk Infrastructure as Code (IaC) analysis and uploads result to Snyk.
# Use || true to not fail the pipeline.
- name: Snyk IaC test and report
run: snyk iac test --report # || true

# Build the docker image for testing
- name: Build a Docker image
run: docker build -t your/image-to-test .
# Runs Snyk Container (Container and SCA) analysis and uploads result to Snyk.
- name: Snyk Container monitor
run: snyk container monitor your/image-to-test --file=Dockerfile

# Push the Snyk Code results into GitHub Code Scanning tab
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk-code.sarif
7 changes: 7 additions & 0 deletions .github/workflows/wled-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ jobs:
name: Gather Environments
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- name: install pip tools
run: python -m pip install pip-tools
- name: reset requirements
run: pip-compile - --output-file=- < WLED/requirements.in > requirements.txt
- name: upgrade pip
run: pip install --upgrade pip
- uses: actions/checkout@v3
- name: Cache pip
uses: actions/cache@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ wled-update.sh
/wled00/my_config.h
/wled00/Release
/wled00/wled00.ino.cpp
.github/*
.gitignore

Loading
Loading