-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into dependabot/pip/protobuf-gte-4.22-and-lt-6…
….0.0
- Loading branch information
Showing
156 changed files
with
1,681 additions
and
923 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Docker Bench for Security | ||
|
||
on: | ||
pull_request: | ||
branches: [ develop ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.8" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install . | ||
- name: Clean Docker System | ||
run: | | ||
docker image prune -a -f | ||
docker system prune -a -f | ||
- name: Clone Docker Bench Security Repo | ||
run: git clone https://github.com/docker/docker-bench-security.git | ||
- name: Build Docker Bench Security Image | ||
run: | | ||
cd docker-bench-security | ||
docker build --no-cache -t docker-bench-security . | ||
- name: Create results directory | ||
run: mkdir -p results | ||
- name: Run Docker Bench for Security | ||
run: | | ||
docker run --rm --net host --pid host --userns host --cap-add audit_control \ | ||
-e DOCKER_CONTENT_TRUST=0 \ | ||
-v /etc:/etc:ro \ | ||
-v /lib/systemd/system:/lib/systemd/system:ro \ | ||
-v /usr/bin/containerd:/usr/bin/containerd:ro \ | ||
-v /usr/bin/runc:/usr/bin/runc:ro \ | ||
-v /usr/lib/systemd:/usr/lib/systemd:ro \ | ||
-v /var/lib:/var/lib:ro \ | ||
-v /var/run/docker.sock:/var/run/docker.sock:ro \ | ||
-v "$(pwd)/results:/results" \ | ||
--label docker_bench_security \ | ||
docker-bench-security | tee results/docker_bench_security_report.txt | ||
- name: Upload Security Bench Report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: docker_bench_security-report | ||
path: results/docker_bench_security_report.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
docker build --pull -t docker.io/securefederatedai/openfl:${{ github.sha }} -f openfl-docker/Dockerfile.base . | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
uses: aquasecurity/trivy-action@0.24.0 | ||
with: | ||
image-ref: 'docker.io/securefederatedai/openfl:${{ github.sha }}' | ||
format: 'sarif' | ||
|
@@ -30,3 +30,61 @@ jobs: | |
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: 'trivy-results.sarif' | ||
|
||
- name: Install Trivy | ||
run: | | ||
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin v0.55.0 | ||
- name: Run Trivy code vulnerability scanner (JSON Output) | ||
run: | | ||
trivy --quiet fs --format json --output trivy-code-results.json --ignore-unfixed --vuln-type os,library --severity CRITICAL,HIGH,MEDIUM,LOW . | ||
- name: Upload Code Vulnerability Scan Results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: trivy-code-report-json | ||
path: trivy-code-results.json | ||
|
||
- name: Run Trivy vulnerability scanner for Docker image (JSON Output) | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: 'docker.io/securefederatedai/openfl:${{ github.sha }}' | ||
format: 'json' | ||
output: 'trivy-docker-results.json' | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH,MEDIUM,LOW' | ||
|
||
- name: Upload Docker Vulnerability Scan | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: trivy-docker-report-json | ||
path: trivy-docker-results.json | ||
|
||
- name: Run Trivy code vulnerability scanner (SPDX-JSON Output) | ||
run: | | ||
trivy --quiet fs --format spdx-json --output trivy-code-spdx-results.json --ignore-unfixed --vuln-type os,library --severity CRITICAL,HIGH,MEDIUM,LOW . | ||
- name: Upload Code Vulnerability Scan Results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: trivy-code-spdx-report-json | ||
path: trivy-code-spdx-results.json | ||
|
||
- name: Run Trivy vulnerability scanner for Docker image (SPDX-JSON Output) | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: 'docker.io/securefederatedai/openfl:${{ github.sha }}' | ||
format: 'spdx-json' | ||
output: 'trivy-docker-spdx-results.json' | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH,MEDIUM,LOW' | ||
|
||
- name: Upload Docker Vulnerability Scan | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: trivy-docker-spdx-report-json | ||
path: trivy-docker-spdx-results.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
minimum_pre_commit_version: 3.3.3 | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
files: \.py$ | ||
- id: requirements-txt-fixer | ||
- id: check-merge-conflict | ||
- id: check-case-conflict | ||
- id: check-json | ||
files: \.json$ | ||
- id: check-yaml | ||
files: \.yaml$ | ||
- id: debug-statements | ||
- id: pretty-format-json | ||
args: | ||
- --autofix | ||
files: \.json$ | ||
- id: trailing-whitespace | ||
files: \.py$ | ||
- repo: https://github.com/PyCQA/autoflake | ||
rev: v2.2.0 | ||
hooks: | ||
- id: autoflake | ||
args: | ||
- --in-place | ||
- --remove-unused-variables | ||
- --recursive | ||
- --ignore-pass-statements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.