mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-05-06 08:47:18 +00:00
chore(safety): define policy for high and critical (#10845)
This commit is contained in:
@@ -60,6 +60,7 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
api/**
|
api/**
|
||||||
.github/workflows/api-security.yml
|
.github/workflows/api-security.yml
|
||||||
|
.safety-policy.yml
|
||||||
files_ignore: |
|
files_ignore: |
|
||||||
api/docs/**
|
api/docs/**
|
||||||
api/README.md
|
api/README.md
|
||||||
@@ -80,10 +81,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Safety
|
- name: Safety
|
||||||
if: steps.check-changes.outputs.any_changed == 'true'
|
if: steps.check-changes.outputs.any_changed == 'true'
|
||||||
run: poetry run safety check --ignore 79023,79027,86217,71600
|
# Accepted CVEs, severity threshold, and ignore expirations live in ../.safety-policy.yml
|
||||||
# TODO: 79023 & 79027 knack ReDoS until `azure-cli-core` (via `cartography`) allows `knack` >=0.13.0
|
run: poetry run safety check --policy-file ../.safety-policy.yml
|
||||||
# TODO: 86217 because `alibabacloud-tea-openapi == 0.4.3` don't let us upgrade `cryptography >= 46.0.0`
|
|
||||||
# TODO: 71600 CVE-2024-1135 false positive - fixed in gunicorn 22.0.0, project uses 23.0.0
|
|
||||||
|
|
||||||
- name: Vulture
|
- name: Vulture
|
||||||
if: steps.check-changes.outputs.any_changed == 'true'
|
if: steps.check-changes.outputs.any_changed == 'true'
|
||||||
|
|||||||
@@ -83,7 +83,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Security scan with Safety
|
- name: Security scan with Safety
|
||||||
if: steps.check-changes.outputs.any_changed == 'true'
|
if: steps.check-changes.outputs.any_changed == 'true'
|
||||||
run: poetry run safety check -r pyproject.toml
|
# Accepted CVEs, severity threshold, and ignore expirations live in .safety-policy.yml
|
||||||
|
run: poetry run safety check -r pyproject.toml --policy-file .safety-policy.yml
|
||||||
|
|
||||||
- name: Dead code detection with Vulture
|
- name: Dead code detection with Vulture
|
||||||
if: steps.check-changes.outputs.any_changed == 'true'
|
if: steps.check-changes.outputs.any_changed == 'true'
|
||||||
|
|||||||
@@ -152,17 +152,19 @@ repos:
|
|||||||
- id: safety
|
- id: safety
|
||||||
name: safety
|
name: safety
|
||||||
description: "Safety is a tool that checks your installed dependencies for known security vulnerabilities"
|
description: "Safety is a tool that checks your installed dependencies for known security vulnerabilities"
|
||||||
# TODO: Botocore needs urllib3 1.X so we need to ignore these vulnerabilities 77744,77745. Remove this once we upgrade to urllib3 2.X
|
# Accepted CVEs, severity threshold, and ignore expirations live in .safety-policy.yml
|
||||||
# TODO: 79023 & 79027 knack ReDoS until `azure-cli-core` (via `cartography`) allows `knack` >=0.13.0
|
entry: safety check --policy-file .safety-policy.yml
|
||||||
# TODO: 86217 because `alibabacloud-tea-openapi == 0.4.3` don't let us upgrade `cryptography >= 46.0.0`
|
|
||||||
# TODO: 71600 CVE-2024-1135 false positive - fixed in gunicorn 22.0.0, project uses 23.0.0
|
|
||||||
entry: safety check --ignore 70612,66963,74429,76352,76353,77744,77745,79023,79027,86217,71600
|
|
||||||
language: system
|
language: system
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
files:
|
files:
|
||||||
{
|
{
|
||||||
glob:
|
glob:
|
||||||
["**/pyproject.toml", "**/poetry.lock", "**/requirements*.txt"],
|
[
|
||||||
|
"**/pyproject.toml",
|
||||||
|
"**/poetry.lock",
|
||||||
|
"**/requirements*.txt",
|
||||||
|
".safety-policy.yml",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
- id: vulture
|
- id: vulture
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# Safety policy for `safety check` (Safety CLI 3.x, v2 schema).
|
||||||
|
# Applied in: .pre-commit-config.yaml, .github/workflows/api-security.yml,
|
||||||
|
# .github/workflows/sdk-security.yml via `--policy-file`.
|
||||||
|
#
|
||||||
|
# Validate: poetry run safety validate policy_file --path .safety-policy.yml
|
||||||
|
|
||||||
|
security:
|
||||||
|
# Scan unpinned requirements too. Prowler pins via poetry.lock, so this is
|
||||||
|
# defensive against accidental unpinned entries.
|
||||||
|
ignore-unpinned-requirements: False
|
||||||
|
|
||||||
|
# CVSS severity filter. 7 = report only HIGH (7.0–8.9) and CRITICAL (9.0–10.0).
|
||||||
|
# Reference: 9=CRITICAL only, 7=CRITICAL+HIGH, 4=CRITICAL+HIGH+MEDIUM.
|
||||||
|
ignore-cvss-severity-below: 7
|
||||||
|
|
||||||
|
# Unknown severity is unrated, not safe. Keep False so unrated CVEs still fail
|
||||||
|
# the build and get a human eye. Flip to True only if noise is unmanageable.
|
||||||
|
ignore-cvss-unknown-severity: False
|
||||||
|
|
||||||
|
# Fail the build when a non-ignored vulnerability is found.
|
||||||
|
continue-on-vulnerability-error: False
|
||||||
|
|
||||||
|
# Explicit accepted vulnerabilities. Each entry MUST have a reason and an
|
||||||
|
# expiry. Expired entries fail the scan, forcing re-audit.
|
||||||
|
ignore-vulnerabilities:
|
||||||
|
77744:
|
||||||
|
reason: "Botocore requires urllib3 1.X. Remove once upgraded to urllib3 2.X."
|
||||||
|
expires: '2026-10-22'
|
||||||
|
77745:
|
||||||
|
reason: "Botocore requires urllib3 1.X. Remove once upgraded to urllib3 2.X."
|
||||||
|
expires: '2026-10-22'
|
||||||
|
79023:
|
||||||
|
reason: "knack ReDoS; blocked until azure-cli-core (via cartography) allows knack >=0.13.0."
|
||||||
|
expires: '2026-10-22'
|
||||||
|
79027:
|
||||||
|
reason: "knack ReDoS; blocked until azure-cli-core (via cartography) allows knack >=0.13.0."
|
||||||
|
expires: '2026-10-22'
|
||||||
|
86217:
|
||||||
|
reason: "alibabacloud-tea-openapi==0.4.3 blocks upgrade to cryptography >=46.0.0."
|
||||||
|
expires: '2026-10-22'
|
||||||
|
71600:
|
||||||
|
reason: "CVE-2024-1135 false positive. Fixed in gunicorn 22.0.0; project uses 23.0.0."
|
||||||
|
expires: '2026-10-22'
|
||||||
|
70612:
|
||||||
|
reason: "TBD - audit required. Reason not documented in prior --ignore list."
|
||||||
|
expires: '2026-07-22'
|
||||||
|
66963:
|
||||||
|
reason: "TBD - audit required. Reason not documented in prior --ignore list."
|
||||||
|
expires: '2026-07-22'
|
||||||
|
74429:
|
||||||
|
reason: "TBD - audit required. Reason not documented in prior --ignore list."
|
||||||
|
expires: '2026-07-22'
|
||||||
|
76352:
|
||||||
|
reason: "TBD - audit required. Reason not documented in prior --ignore list."
|
||||||
|
expires: '2026-07-22'
|
||||||
|
76353:
|
||||||
|
reason: "TBD - audit required. Reason not documented in prior --ignore list."
|
||||||
|
expires: '2026-07-22'
|
||||||
Reference in New Issue
Block a user