Skip to content

Commit ba77cd2

Browse files
committed
fix: correct scanner suppression comments and add remaining fixes
- Add nosemgrep alongside nosec for opengrep/semgrep compatibility - Fix suppression comment placement (config-manager.ts for loop, backend-stack.ts line 126) - Add USER node to Dockerfile.frontend.dev (CKV_DOCKER_3) - Add .checkov.yml to skip false positive tj-actions/changed-files GHSAs (pinned to safe v46.0.5)
1 parent e2397eb commit ba77cd2

6 files changed

Lines changed: 14 additions & 3 deletions

File tree

.checkov.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Checkov configuration for security scanning
2+
# Skip rules that are verified false positives in this repository
3+
skip-check:
4+
# tj-actions/changed-files is pinned to commit ed68ef82c... which is v46.0.5 (post-fix for CVE-2025-30066).
5+
# Checkov flags the action name regardless of the pinned commit hash.
6+
- "GHSA-mrrh-fwg8-r2c3" # tj-actions/changed-files supply chain compromise (patched in v46)
7+
- "GHSA-mcph-m25j-8j63" # tj-actions/changed-files related advisory (patched in v46)

docker/Dockerfile.frontend.dev

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ COPY . .
1717
# Expose port
1818
EXPOSE 3000
1919

20+
# Run as non-root user (node user is built into node:20-alpine)
21+
USER node
22+
2023
# Healthcheck for container orchestration (dev server)
2124
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
2225
CMD wget -qO- http://localhost:3000/ || exit 1

infra-cdk/lambdas/zip-packager/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def send_response(
6060
headers={"Content-Type": "application/json"},
6161
method="PUT",
6262
)
63-
urllib.request.urlopen(req) # nosec B310 B113 — URL is the CloudFormation pre-signed ResponseURL, not user-controlled
63+
urllib.request.urlopen(req) # nosemgrep: python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected # nosec B310 B113 — URL is the CloudFormation pre-signed ResponseURL, not user-controlled
6464

6565

6666
def download_wheels(requirements: list[str], download_dir: Path) -> None:

infra-cdk/lib/backend-stack.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export class BackendStack extends cdk.NestedStack {
123123
if (deploymentType === "zip") {
124124
// ZIP DEPLOYMENT: Use Lambda to package and upload to S3 (no Docker required)
125125
const repoRoot = path.resolve(__dirname, "..", "..")
126+
// nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal — pattern is from trusted local config.yaml, not user input
126127
const patternDir = path.join(repoRoot, "patterns", pattern)
127128

128129
// Create S3 bucket for agent code

infra-cdk/lib/utils/config-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ export class ConfigManager {
113113
return this.config
114114
}
115115

116-
// nosemgrep: javascript.lang.security.audit.prototype-pollution.prototype-pollution-loop.prototype-pollution-loop — iterates over a trusted local YAML config object, not user-controlled input
117116
public get(key: string, defaultValue?: any): any {
118117
const keys = key.split(".")
119118
let value: any = this.config
120119

120+
// nosemgrep: javascript.lang.security.audit.prototype-pollution.prototype-pollution-loop.prototype-pollution-loop — iterates over a trusted local YAML config object, not user-controlled input
121121
for (const k of keys) {
122122
if (typeof value === "object" && value !== null && k in value) {
123123
value = value[k]

patterns/utils/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def extract_user_id_from_context(context: RequestContext) -> str:
6060

6161
# Decode without signature verification — AgentCore Runtime already validated the token.
6262
# We use options to skip all verification since this is a trusted, pre-validated token.
63-
claims = jwt.decode( # nosec — signature verification intentionally skipped; AgentCore Runtime already validated the JWT
63+
claims = jwt.decode( # nosemgrep: python.jwt.security.unverified-jwt-decode.unverified-jwt-decode # nosec — signature verification intentionally skipped; AgentCore Runtime already validated the JWT
6464
jwt=token,
6565
options={"verify_signature": False},
6666
algorithms=["RS256"],

0 commit comments

Comments
 (0)