Skip to content

feat: add integration tests#42

Merged
lhoupert merged 1 commit intomainfrom
feat--add-integration-tests
Mar 30, 2026
Merged

feat: add integration tests#42
lhoupert merged 1 commit intomainfrom
feat--add-integration-tests

Conversation

@lhoupert
Copy link
Copy Markdown
Collaborator

@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented Mar 30, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
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
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. 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


🦉 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

detects commit SHAs that don't match their version comment tags
if: always()
run: |
mkdir -p outcome
echo "${{ steps.audit.outcome }}" > outcome/outcome.txt

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion
needs: [integration-test]
runs-on: ubuntu-latest
permissions:
pull-requests: write

Check notice

Code scanning / zizmor

permissions without explanatory comments Note

permissions without explanatory comments
fi

MARKER="<!-- integration-test-validation-report -->"
PR_NUMBER="${{ github.event.pull_request.number }}"

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion
# 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

code injection via template expansion

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

code injection via template expansion
@github-advanced-security
Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

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

subprocess call with shell=True identified, security issue.
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

subprocess call with shell=True identified, security issue.
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

subprocess call with shell=True identified, security issue.
@@ -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

Consider possible security implications associated with the subprocess module.
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

Possible hardcoded password: 'supersecret123'
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

Possible hardcoded password: 'hardcoded_db_pass'
@@ -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

Consider possible security implications associated with the subprocess module.
@@ -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

Consider possible security implications associated with the subprocess module.
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

Use of weak MD5 hash for security. Consider usedforsecurity=False
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

Use of unsafe yaml load. Allows instantiation of arbitrary objects. Consider yaml.safe_load().
"""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

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
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

subprocess call with shell=True identified, security issue.
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

subprocess call with shell=True identified, security issue.
@@ -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

Consider possible security implications associated with the subprocess module.
@@ -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

Consider possible security implications associated with the subprocess module.
@github-actions
Copy link
Copy Markdown
Contributor

Security Audit Report

View workflow run

Bandit — 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)

Package Version ID Fix Versions Description
pygments 2.19.2 CVE-2026-4539 none A security flaw has been discovered in pygments up to 2.19.2. The impacted element is the function AdlLexer of the file

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

Use of weak MD5 hash for security. Consider usedforsecurity=False
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

Possible hardcoded password: 'dev_secret_token_abc123'
@github-actions
Copy link
Copy Markdown
Contributor

✅ All test workflows behaved as expected

14 passed, 0 failed

Test Name Expected Actual Bandit pip-audit Result
01 requirements · flat · clean success success
02 requirements · src/ · bandit HIGH failure failure B105, B404, B602
03 requirements · src/+scripts/ · bandit HIGH + pip-audit failure failure B105, B404, B602 cryptography, idna, requests, urllib3
04 uv · flat · clean success success
05 uv · src/ · pip-audit vuln failure failure idna, requests, urllib3
06 uv · src/+scripts/ · bandit MEDIUM failure failure B324, B506
07 poetry · flat · clean success success
08 poetry · src/ · bandit MEDIUM + pip-audit failure failure B105, B324 cryptography, idna, requests, urllib3
09 pipenv · flat · clean success success
10 pipenv · src/+scripts/ · bandit HIGH failure failure B404, B602
11 requirements · flat · clean (root working dir) success success
12 uv · flat · bandit-only (no pip-audit) failure failure B404, B602 disabled
13 requirements · flat · unfixable vulns (should pass) success success pygments
14 uv · flat · low threshold (B101 assert) failure failure B101 disabled

@lhoupert lhoupert merged commit 437ac46 into main Mar 30, 2026
21 of 22 checks passed
@lhoupert lhoupert deleted the feat--add-integration-tests branch March 30, 2026 09:33
@lhoupert
Copy link
Copy Markdown
Collaborator Author

all security warning are due to integration tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants