Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 29283725 | Triggered | Generic Password | cada289 | integration-tests/cases/02-requirements-src-bandit/src/app.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
|
|
||
| - name: Set up uv | ||
| if: matrix.setup == 'uv' | ||
| uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.3.1 |
Check warning
Code scanning / zizmor
detects commit SHAs that don't match their version comment tags Warning
| if: always() | ||
| run: | | ||
| mkdir -p outcome | ||
| echo "${{ steps.audit.outcome }}" > outcome/outcome.txt |
Check notice
Code scanning / zizmor
code injection via template expansion Note
| needs: [integration-test] | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write |
Check notice
Code scanning / zizmor
permissions without explanatory comments Note
| fi | ||
|
|
||
| MARKER="<!-- integration-test-validation-report -->" | ||
| PR_NUMBER="${{ github.event.pull_request.number }}" |
Check notice
Code scanning / zizmor
code injection via template expansion Note
| # Find existing comment with our marker | ||
| COMMENT_ID=$( | ||
| gh api \ | ||
| "repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" \ |
Check notice
Code scanning / zizmor
code injection via template expansion Note
|
|
||
| if [ -n "$COMMENT_ID" ]; then | ||
| gh api \ | ||
| "repos/${{ github.repository }}/issues/comments/${COMMENT_ID}" \ |
Check notice
Code scanning / zizmor
code injection via template expansion Note
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
| def run_command(cmd: str) -> int: | ||
| """Run a shell command.""" | ||
| # B602: subprocess call with shell=True — HIGH severity | ||
| return subprocess.call(cmd, shell=True) # noqa: S602 |
Check failure
Code scanning / Bandit
subprocess call with shell=True identified, security issue. Error
| def process(data: str) -> None: | ||
| """Process data via shell command.""" | ||
| # B602: subprocess with shell=True — HIGH severity | ||
| subprocess.call(f"process.sh {data}", shell=True) # noqa: S602 |
Check failure
Code scanning / Bandit
subprocess call with shell=True identified, security issue. Error
| import subprocess | ||
|
|
||
| def run_command(user_input: str) -> str: | ||
| result = subprocess.run(user_input, shell=True, capture_output=True, text=True) |
Check failure
Code scanning / Bandit
subprocess call with shell=True identified, security issue. Error
| @@ -0,0 +1,15 @@ | |||
| """Command runner — intentionally insecure for bandit testing.""" | |||
| import subprocess | |||
Check notice
Code scanning / Bandit
Consider possible security implications associated with the subprocess module. Note
| def get_config() -> dict: | ||
| """Return config dict.""" | ||
| # B105: hardcoded password string — MEDIUM severity | ||
| password = "supersecret123" # noqa: S105 |
Check notice
Code scanning / Bandit
Possible hardcoded password: 'supersecret123' Note
| def authenticate(user: str) -> dict: | ||
| """Return auth config for a user.""" | ||
| # B105: hardcoded password string — MEDIUM severity | ||
| db_password = "hardcoded_db_pass" # noqa: S105 |
Check notice
Code scanning / Bandit
Possible hardcoded password: 'hardcoded_db_pass' Note
| @@ -0,0 +1,8 @@ | |||
| """Data processor — intentionally insecure for bandit testing.""" | |||
| import subprocess | |||
Check notice
Code scanning / Bandit
Consider possible security implications associated with the subprocess module. Note
| @@ -0,0 +1,6 @@ | |||
| """Intentional B602 — subprocess call with shell=True.""" | |||
| import subprocess | |||
Check notice
Code scanning / Bandit
Consider possible security implications associated with the subprocess module. Note
| def compute_hash(data: bytes) -> str: | ||
| """Compute a digest of the given data.""" | ||
| # B303: use of MD5 — MEDIUM severity | ||
| return hashlib.md5(data).hexdigest() # noqa: S324 |
Check failure
Code scanning / Bandit
Use of weak MD5 hash for security. Consider usedforsecurity=False Error
| def parse_config(data: str) -> dict: | ||
| """Parse YAML config string.""" | ||
| # B506: yaml.load without Loader — MEDIUM severity | ||
| return yaml.load(data) # noqa: S506 |
Check warning
Code scanning / Bandit
Use of unsafe yaml load. Allows instantiation of arbitrary objects. Consider yaml.safe_load(). Warning
| """Intentional B101 — use of assert in non-test code.""" | ||
|
|
||
| def validate(value: int) -> int: | ||
| assert value > 0, "Value must be positive" |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note
| def deploy(target: str) -> None: | ||
| """Deploy to the given target.""" | ||
| # B602: subprocess with shell=True — HIGH severity | ||
| subprocess.call(f"deploy.sh {target}", shell=True) # noqa: S602 |
Check failure
Code scanning / Bandit
subprocess call with shell=True identified, security issue. Error
| def handle_request(cmd: str) -> int: | ||
| """Execute a request via shell command.""" | ||
| # B602: subprocess with shell=True — HIGH severity | ||
| return subprocess.call(cmd, shell=True) # noqa: S602 |
Check failure
Code scanning / Bandit
subprocess call with shell=True identified, security issue. Error
| @@ -0,0 +1,8 @@ | |||
| """Deploy script — intentionally insecure for bandit testing.""" | |||
| import subprocess | |||
Check notice
Code scanning / Bandit
Consider possible security implications associated with the subprocess module. Note
| @@ -0,0 +1,8 @@ | |||
| """Request handler — intentionally insecure for bandit testing.""" | |||
| import subprocess | |||
Check notice
Code scanning / Bandit
Consider possible security implications associated with the subprocess module. Note
Security Audit ReportBandit — Static Security Analysis (Security tab)12 issue(s) found: 12 low ✅ No issues at or above HIGH severity. 12 low issue(s) below threshold not shown in table. pip-audit — Dependency Vulnerabilities (Security tab)
1 vulnerability/vulnerabilities found (0 fixable) across 1 package(s). Result: ✅ No blocking issues found. |
| def legacy_hash(data: bytes) -> str: | ||
| """Compute a legacy hash of data.""" | ||
| # B303: use of MD5 — MEDIUM severity | ||
| return hashlib.md5(data).hexdigest() # noqa: S324 |
Check failure
Code scanning / Bandit
Use of weak MD5 hash for security. Consider usedforsecurity=False Error
| def check_token(token: str) -> bool: | ||
| """Validate an API token.""" | ||
| # B105: hardcoded password string — MEDIUM severity | ||
| secret = "dev_secret_token_abc123" # noqa: S105 |
Check notice
Code scanning / Bandit
Possible hardcoded password: 'dev_secret_token_abc123' Note
✅ All test workflows behaved as expected14 passed, 0 failed
|
|
all security warning are due to integration tests |
Move integration tests originally maintained in https://github.com/lhoupert/action-python-security-auditing-tests/tree/pre-migration