Skip to content

Commit ca4280c

Browse files
Merge branch 'main' into feat/security-baseline-default-enabled
2 parents a831587 + 56ef0be commit ca4280c

10 files changed

Lines changed: 34 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
contents: read
2222
steps:
2323
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
24-
- uses: DavidAnson/markdownlint-cli2-action@ce4853d43830c74c1753b39f3cf40f71c2031eb9 #v23.0.0
24+
- uses: DavidAnson/markdownlint-cli2-action@6b51ade7a9e4a75a7ad929842dd298a3804ebe8b #v23.1.0
2525
with:
2626
globs: "**/*.md"

.github/workflows/pull-request-lint.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,20 @@ jobs:
3838
env:
3939
GH_TOKEN: ${{ github.token }}
4040
PR_LABELS_JSON: ${{ toJson(github.event.pull_request.labels.*.name) }}
41+
PR_NUMBER_INPUT: ${{ github.event.pull_request.number }}
4142
steps:
4243
- name: Get PR info
4344
id: get-pr
4445
run: |
45-
if [ "${{ github.event_name }}" == "merge_group" ]; then
46-
PR_NUMBER=$(echo "${{ github.ref }}" | grep -oP '(?<=/pr-)\d+' || echo "")
47-
PR_LABELS=$(gh api repos/${{ github.repository }}/pulls/$PR_NUMBER | jq -c '[.labels[].name] // []')
46+
if [ "$GITHUB_EVENT_NAME" == "merge_group" ]; then
47+
PR_NUMBER=$(echo "$GITHUB_REF" | grep -oP '(?<=/pr-)\d+' || echo "")
48+
PR_LABELS=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER" | jq -c '[.labels[].name] // []')
4849
echo "::group::Getting Information"
49-
gh api repos/${{ github.repository }}/pulls/$PR_NUMBER
50+
gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER"
5051
echo $PR_LABELS
5152
echo "::endgroup::"
52-
elif [ "${{ github.event_name }}" == "pull_request" -o "${{ github.event_name }}" == "pull_request_target" ]; then
53-
PR_NUMBER="${{ github.event.pull_request.number }}"
53+
elif [ "$GITHUB_EVENT_NAME" == "pull_request" -o "$GITHUB_EVENT_NAME" == "pull_request_target" ]; then
54+
PR_NUMBER="$PR_NUMBER_INPUT"
5455
PR_LABELS=$(echo "$PR_LABELS_JSON" | jq -c '.')
5556
fi
5657
echo "::group::Debug Output Values"

.github/workflows/release-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
fetch-depth: 0
3939

4040
- name: Install git-cliff
41-
uses: orhun/git-cliff-action@c93ef52f3d0ddcdcc9bd5447d98d458a11cd4f72 # v4.7.1
41+
uses: orhun/git-cliff-action@f50e11560dce63f7c33227798f90b924471a88b5 # v4.8.0
4242
with:
4343
config: cliff.toml
4444
args: --version
@@ -93,7 +93,7 @@ jobs:
9393
fi
9494
9595
- name: Generate changelog
96-
uses: orhun/git-cliff-action@c93ef52f3d0ddcdcc9bd5447d98d458a11cd4f72 # v4.7.1
96+
uses: orhun/git-cliff-action@f50e11560dce63f7c33227798f90b924471a88b5 # v4.8.0
9797
with:
9898
config: cliff.toml
9999
args: --tag ${{ steps.version.outputs.tag }}

.gitleaks.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ description = "Global allowlist"
1212
paths = [
1313
'''\.gitleaks-baseline\.json$''',
1414
'''uv\.lock$''',
15+
'''packages/shared/tests/test_credential_scrubber\.py$''',
1516
]

scripts/aidlc-evaluator/packages/quantitative/src/quantitative/analyzers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def run_ruff(project_root: Path) -> ToolResult:
107107
sev = "error" if item.get("code", "").startswith("E") else "warning"
108108
raw_path = item.get("filename", "?")
109109
try:
110+
# nosemgrep: ai.ai-best-practices.hooks-path-traversal - relative_to() enforces path stays within project_root; ValueError on escape
110111
rel_path = str(Path(raw_path).relative_to(project_root))
111112
except ValueError:
112113
rel_path = raw_path
@@ -320,6 +321,7 @@ def run_semgrep(project_root: Path) -> ToolResult:
320321
sev = _SEMGREP_SEVERITY_MAP.get(raw_sev, "medium")
321322
raw_path = item.get("path", "?")
322323
try:
324+
# nosemgrep: ai.ai-best-practices.hooks-path-traversal - relative_to() enforces path stays within project_root; ValueError on escape
323325
rel_path = str(Path(raw_path).relative_to(project_root))
324326
except ValueError:
325327
rel_path = raw_path

scripts/aidlc-evaluator/packages/shared/tests/test_credential_scrubber.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ def test_aws_secret_key(self):
2626

2727
def test_jwt_token(self):
2828
"""Test JWT token redaction."""
29-
text = "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
29+
text = "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" # nosemgrep: generic.secrets.security.detected-jwt-token # gitleaks:allow
3030
result = scrub_credentials(text)
3131
assert "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" not in result
3232
assert "[REDACTED-JWT-TOKEN]" in result
3333

3434
def test_github_token(self):
3535
"""Test GitHub personal access token redaction."""
36-
text = "GITHUB_TOKEN=ghp_1234567890abcdefghijklmnopqrstuv"
36+
text = "GITHUB_TOKEN=ghp_1234567890abcdefghijklmnopqrstuv" # gitleaks:allow
3737
result = scrub_credentials(text)
3838
assert "ghp_1234567890abcdefghijklmnopqrstuv" not in result
3939
assert "[REDACTED-GITHUB-TOKEN]" in result
@@ -60,7 +60,7 @@ def test_private_key(self):
6060

6161
def test_api_key_hex(self):
6262
"""Test generic API key redaction (hex format)."""
63-
text = "api_key=a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
63+
text = "api_key=a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4" # nosemgrep: generic.secrets.security.detected-generic-api-key # gitleaks:allow
6464
result = scrub_credentials(text)
6565
assert "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4" not in result
6666
assert "[REDACTED-API-KEY]" in result
@@ -70,7 +70,7 @@ def test_multiple_credentials(self):
7070
text = """
7171
AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
7272
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
73-
TOKEN=ghp_1234567890abcdefghijklmnopqrstuv
73+
TOKEN=ghp_1234567890abcdefghijklmnopqrstuv # gitleaks:allow
7474
"""
7575
result = scrub_credentials(text)
7676
assert "AKIAIOSFODNN7EXAMPLE" not in result
@@ -104,7 +104,7 @@ class TestScrubDictValues:
104104
def test_scrub_all_strings(self):
105105
"""Test scrubbing all string values in a dict."""
106106
data = {
107-
"token": "ghp_1234567890abcdefghijklmnopqrstuv",
107+
"token": "ghp_1234567890abcdefghijklmnopqrstuv", # gitleaks:allow
108108
"count": 42,
109109
"message": "Hello world",
110110
}
@@ -116,8 +116,8 @@ def test_scrub_all_strings(self):
116116
def test_scrub_specific_keys(self):
117117
"""Test scrubbing only targeted keys."""
118118
data = {
119-
"token": "ghp_1234567890abcdefghijklmnopqrstuv",
120-
"message": "ghp_1234567890abcdefghijklmnopqrstuv",
119+
"token": "ghp_1234567890abcdefghijklmnopqrstuv", # gitleaks:allow
120+
"message": "ghp_1234567890abcdefghijklmnopqrstuv", # gitleaks:allow
121121
}
122122
result = scrub_dict_values(data, keys_to_scrub={"token"})
123123
assert "ghp_1234567890abcdefghijklmnopqrstuv" not in result["token"]

scripts/aidlc-evaluator/packages/trend-reports/src/trend_reports/fetcher.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ def fetch_workflow_runs(
138138
if event is not None:
139139
cmd.extend(["--event", event])
140140

141+
# nosec B603, B607 - cmd is a static gh CLI invocation with validated string arguments (repo, branch, event)
142+
# nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit.dangerous-subprocess-use-audit
141143
result = subprocess.run(cmd, capture_output=True, text=True, check=False)
142144
if result.returncode != 0:
143145
raise FetchError(f"Failed to list workflow runs for {repo}: {result.stderr.strip()}")

scripts/aidlc-evaluator/packages/trend-reports/tests/test_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_ordering(self):
5050
assert SemVer(0, 1, 9) < SemVer(1, 0, 0)
5151

5252
def test_equality(self):
53-
assert SemVer(1, 2, 3) == SemVer(1, 2, 3)
53+
assert SemVer(1, 2, 3) == SemVer(1, 2, 3) # nosemgrep: template.eqeq-is-bad - dataclass equality via __eq__ is intentional here
5454

5555
def test_frozen(self):
5656
sv = SemVer(1, 2, 3)

scripts/aidlc-evaluator/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Evaluation and reporting framework for AI-DLC workflows"
55
requires-python = ">=3.13"
66
dependencies = [
77
"pyyaml>=6.0",
8-
"boto3>=1.42.96",
8+
"boto3>=1.43.2",
99
"aidlc-runner",
1010
"aidlc-qualitative",
1111
"aidlc-quantitative",

scripts/aidlc-evaluator/uv.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)