-
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 'securefederatedai:develop' into exp_agg_workflow_privat…
…e_attrs_fix
- Loading branch information
Showing
106 changed files
with
921 additions
and
684 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,17 +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 | ||
- name: Run Trivy vulnerability scanner for Docker image (JSON Output) | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: 'docker.io/securefederatedai/openfl:${{ github.sha }}' | ||
format: 'table' | ||
format: 'json' | ||
output: 'trivy-docker-results.json' | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH,MEDIUM,LOW' | ||
|
||
- name: Log completion message | ||
- 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: | | ||
echo "Trivy scan completed. Review the output above for vulnerabilities." | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# Copyright (C) 2020-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
sphinx-rtd-theme | ||
pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability | ||
recommonmark | ||
sphinx>=3.0.4 # not directly required, pinned by Snyk to avoid a vulnerability | ||
sphinx-copybutton | ||
sphinx-prompt | ||
sphinx-rtd-theme | ||
sphinx_substitution_extensions | ||
sphinx-copybutton | ||
sphinxcontrib-mermaid | ||
pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability | ||
sphinx>=3.0.4 # not directly required, pinned by Snyk to avoid a vulnerability | ||
recommonmark |
Oops, something went wrong.