-
-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# 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 Bearer.com to manage findings, notifications and more. | ||
# See https://docs.bearer.com/guides/bearer-cloud/ | ||
name: Bearer | ||
Check warning on line 8 in .github/workflows/bearer.yml
|
||
|
||
on: | ||
push: | ||
branches: ["master" ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: ["master"] | ||
schedule: | ||
- cron: '24 22 * * 6' | ||
|
||
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 | ||
|
||
jobs: | ||
bearer: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout project source | ||
- uses: actions/checkout@v4 | ||
# Scan code using Bearer CLI | ||
- name: Run Report | ||
id: report | ||
uses: bearer/bearer-action@828eeb928ce2f4a7ca5ed57fb8b59508cb8c79bc | ||
with: | ||
api-key: ${{ secrets.BEARER_TOKEN }} | ||
format: sarif | ||
output: results.sarif | ||
exit-code: 0 | ||
# Upload SARIF file generated in previous step | ||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: results.sarif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Dependency Review Action | ||
# | ||
# This Action will scan dependency manifest files that change as part of a Pull Request, | ||
# surfacing known-vulnerable versions of the packages declared or updated in the PR. | ||
# Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable | ||
# packages will be blocked from merging. | ||
# | ||
# Source repository: https://github.com/actions/dependency-review-action | ||
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement | ||
name: 'Dependency review' | ||
on: | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
# If using a dependency submission action in this workflow this permission will need to be set to: | ||
# | ||
# permissions: | ||
# contents: write | ||
# | ||
# https://docs.github.com/en/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api | ||
permissions: | ||
contents: read | ||
# Write permissions for pull-requests are required for using the `comment-summary-in-pr` option, comment out if you aren't using this option | ||
pull-requests: write | ||
|
||
jobs: | ||
dependency-review: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout repository' | ||
uses: actions/checkout@v4 | ||
- name: 'Dependency Review' | ||
uses: actions/dependency-review-action@v4 | ||
# Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options. | ||
with: | ||
comment-summary-in-pr: always | ||
# fail-on-severity: moderate | ||
# deny-licenses: GPL-1.0-or-later, LGPL-2.0-or-later | ||
# retry-on-snapshot-warnings: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# 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 integrates Pyre with GitHub's | ||
# Code Scanning feature. | ||
# | ||
# Pyre is a performant type checker for Python compliant with | ||
# PEP 484. Pyre can analyze codebases with millions of lines | ||
# of code incrementally – providing instantaneous feedback | ||
# to developers as they write code. | ||
# | ||
# See https://pyre-check.org | ||
|
||
name: Pyre | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
pyre: | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Run Pyre | ||
uses: facebook/pyre-action@12b8d923443ea66cb657facc2e5faac1c8c86e64 | ||
with: | ||
# To customize these inputs: | ||
# See https://github.com/facebook/pyre-action#inputs | ||
repo-directory: './' | ||
requirements-path: 'requirements.txt' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 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 integrates Python Static Analyzer (Pysa) with | ||
# GitHub's Code Scanning feature. | ||
# | ||
# Python Static Analyzer (Pysa) is a security-focused static | ||
# analysis tool that tracks flows of data from where they | ||
# originate to where they terminate in a dangerous location. | ||
# | ||
# See https://pyre-check.org/docs/pysa-basics/ | ||
|
||
name: Pysa | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
schedule: | ||
- cron: '43 5 * * 3' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
pysa: | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Run Pysa | ||
uses: facebook/pysa-action@f46a63777e59268613bd6e2ff4e29f144ca9e88b | ||
with: | ||
# To customize these inputs: | ||
# See https://github.com/facebook/pysa-action#inputs | ||
repo-directory: './' | ||
requirements-path: 'requirements.txt' | ||
infer-types: true | ||
include-default-sapp-filters: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Python Package using Conda | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: Add conda to system path | ||
run: | | ||
# $CONDA is an environment variable pointing to the root of the miniconda directory | ||
echo $CONDA/bin >> $GITHUB_PATH | ||
- name: Install dependencies | ||
run: | | ||
conda env update --file environment.yml --name base | ||
- name: Lint with flake8 | ||
run: | | ||
conda install flake8 | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
conda install pytest | ||
pytest |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# 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 | ||
Check warning on line 11 in .github/workflows/semgrep.yml
|
||
|
||
on: | ||
Check warning on line 13 in .github/workflows/semgrep.yml
|
||
push: | ||
branches: [ "master" ] | ||
Check failure on line 15 in .github/workflows/semgrep.yml
|
||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ "master" ] | ||
Check failure on line 18 in .github/workflows/semgrep.yml
|
||
schedule: | ||
- cron: '19 7 * * 3' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
semgrep: | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
Check warning on line 28 in .github/workflows/semgrep.yml
|
||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
Check warning on line 29 in .github/workflows/semgrep.yml
|
||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
Check warning on line 30 in .github/workflows/semgrep.yml
|
||
name: Scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout project source | ||
- uses: actions/checkout@v4 | ||
|
||
# Scan code using project's configuration on https://semgrep.dev/manage | ||
- uses: returntocorp/semgrep-action@713efdd345f3035192eaa63f56867b88e63e4e5d | ||
with: | ||
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }} | ||
publishDeployment: ${{ secrets.SEMGREP_DEPLOYMENT_ID }} | ||
generateSarif: "1" | ||
|
||
# Upload SARIF file generated in previous step | ||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: semgrep.sarif | ||
if: always() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# 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. | ||
|
||
name: trivy | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ "master" ] | ||
schedule: | ||
- cron: '31 0 * * 5' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
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 to get the Action run status | ||
name: Build | ||
runs-on: "ubuntu-20.04" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build an image from Dockerfile | ||
run: | | ||
docker build -t docker.io/my-organization/my-app:${{ github.sha }} . | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 | ||
with: | ||
image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}' | ||
format: 'template' | ||
template: '@/contrib/sarif.tpl' | ||
output: 'trivy-results.sarif' | ||
severity: 'CRITICAL,HIGH' | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: 'trivy-results.sarif' |