|
| 1 | +project_name: sample-spec-driven-presentation-maker |
| 2 | + |
| 3 | +global_settings: |
| 4 | + ignore_paths: |
| 5 | + - path: "infra/node_modules/**" |
| 6 | + reason: "CDK bundled code β not our source code" |
| 7 | + |
| 8 | + suppressions: |
| 9 | + # --- CFn Custom Resource: urlopen to pre-signed ResponseURL --- |
| 10 | + # Standard pattern for CloudFormation custom resources. |
| 11 | + # The URL is the CFn-provided ResponseURL, not user-controlled. |
| 12 | + |
| 13 | + - rule_id: "B310" |
| 14 | + path: "infra/lambdas/kb-provisioner/index.py" |
| 15 | + reason: > |
| 16 | + urllib.request.urlopen sends CloudFormation custom resource response |
| 17 | + to the pre-signed ResponseURL. Standard CFn pattern. URL is not user-controlled. |
| 18 | + expiration: "2027-03-29" |
| 19 | + |
| 20 | + - rule_id: "B310" |
| 21 | + path: "infra/lambdas/bedrock-logging/index.py" |
| 22 | + reason: > |
| 23 | + urllib.request.urlopen sends CloudFormation custom resource response |
| 24 | + to the pre-signed ResponseURL. Standard CFn pattern. URL is not user-controlled. |
| 25 | + expiration: "2027-03-29" |
| 26 | + |
| 27 | + - rule_id: "python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected" |
| 28 | + path: "infra/lambdas/kb-provisioner/index.py" |
| 29 | + reason: > |
| 30 | + Same as B310 above. CFn custom resource ResponseURL pattern. |
| 31 | + expiration: "2027-03-29" |
| 32 | + |
| 33 | + - rule_id: "python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected" |
| 34 | + path: "infra/lambdas/bedrock-logging/index.py" |
| 35 | + reason: > |
| 36 | + Same as B310 above. CFn custom resource ResponseURL pattern. |
| 37 | + expiration: "2027-03-29" |
| 38 | + |
| 39 | + # --- CDK local bundling: execSync at build time only --- |
| 40 | + # execSync runs hardcoded cp commands during CDK synth/build on the |
| 41 | + # developer's machine. Not executed at runtime. No user input. |
| 42 | + |
| 43 | + - rule_id: "javascript.lang.security.detect-child-process.detect-child-process" |
| 44 | + path: "infra/lib/web-ui-stack.ts" |
| 45 | + reason: > |
| 46 | + execSync copies api/ and shared/ into Lambda asset output directory |
| 47 | + at CDK synth time. Hardcoded cp commands, no user input, build-time only. |
| 48 | + expiration: "2027-03-29" |
| 49 | + |
| 50 | + - rule_id: "javascript.lang.security.detect-child-process.detect-child-process" |
| 51 | + path: "infra/lib/data-stack.ts" |
| 52 | + reason: > |
| 53 | + execSync copies assets/ into Lambda asset output directory |
| 54 | + at CDK synth time. Hardcoded cp commands, no user input, build-time only. |
| 55 | + expiration: "2027-03-29" |
| 56 | + |
| 57 | + # --- Container binding to 0.0.0.0 --- |
| 58 | + # MCP server runs inside a Fargate container behind AgentCore Runtime. |
| 59 | + # Binding to all interfaces is required for container networking. |
| 60 | + |
| 61 | + - rule_id: "B104" |
| 62 | + path: "mcp-server/server.py" |
| 63 | + reason: > |
| 64 | + MCP server runs in a Fargate container behind AgentCore Runtime. |
| 65 | + Binding to 0.0.0.0 is required for container networking. |
| 66 | + Not exposed to the public internet directly. |
| 67 | + expiration: "2027-03-29" |
| 68 | + |
| 69 | + # --- /tmp usage in local CLI tools --- |
| 70 | + # These are local developer tools (Layer 1-2), not server-side code. |
| 71 | + # /tmp is used for transient preview files and build artifacts. |
| 72 | + |
| 73 | + - rule_id: "B108" |
| 74 | + path: "mcp-local/tools.py" |
| 75 | + reason: > |
| 76 | + Local MCP server (Layer 2) uses /tmp for transient PPTX preview files. |
| 77 | + Runs on developer's machine, not in a shared server environment. |
| 78 | + expiration: "2027-03-29" |
| 79 | + |
| 80 | + - rule_id: "B108" |
| 81 | + path: "skill/sdpm/analyzer/__init__.py" |
| 82 | + reason: > |
| 83 | + Template analyzer reads preview PNGs from /tmp. Local CLI tool (Layer 1), |
| 84 | + runs on developer's machine only. |
| 85 | + expiration: "2027-03-29" |
| 86 | + |
| 87 | + - rule_id: "B108" |
| 88 | + path: "skill/scripts/pptx_builder.py" |
| 89 | + reason: > |
| 90 | + CLI entry point uses /tmp for transient build artifacts and previews. |
| 91 | + Local tool (Layer 1), runs on developer's machine only. |
| 92 | + expiration: "2027-03-29" |
| 93 | + |
| 94 | + # --- XML parsing of trusted PPTX content --- |
| 95 | + # ET.fromstring parses XML extracted from PPTX files that the tool itself |
| 96 | + # generated or that the user explicitly provided. Not untrusted network input. |
| 97 | + |
| 98 | + - rule_id: "B314" |
| 99 | + path: "skill/sdpm/converter/color.py" |
| 100 | + reason: > |
| 101 | + ET.fromstring parses theme XML from PPTX files provided by the user |
| 102 | + or generated by the tool. Input is a local .pptx file, not untrusted |
| 103 | + network data. python-pptx itself uses the same pattern. |
| 104 | + expiration: "2027-03-29" |
| 105 | + |
| 106 | + - rule_id: "B314" |
| 107 | + path: "skill/sdpm/converter/slide.py" |
| 108 | + reason: > |
| 109 | + ET.fromstring parses slide XML from PPTX files. Same rationale as |
| 110 | + color.py β local file input, not untrusted network data. |
| 111 | + expiration: "2027-03-29" |
| 112 | + |
| 113 | + - rule_id: "B314" |
| 114 | + path: "skill/sdpm/converter/xml_helpers.py" |
| 115 | + reason: > |
| 116 | + ET.fromstring parses shape XML from PPTX files. Same rationale β |
| 117 | + local file input, not untrusted network data. |
| 118 | + expiration: "2027-03-29" |
| 119 | + |
| 120 | + - rule_id: "B310" |
| 121 | + path: "skill/scripts/download_aws_icons.py" |
| 122 | + reason: > |
| 123 | + urlopen downloads the official AWS Architecture Icons asset package |
| 124 | + from a hardcoded HTTPS URL (ASSET_PACKAGE_URL constant). |
| 125 | + URL is not user-controlled. Developer utility script only. |
| 126 | + expiration: "2027-03-29" |
| 127 | + |
| 128 | + # --- Semgrep subprocess audit (nosemgrep inline comments not recognized by Holmes) --- |
| 129 | + # All subprocess calls use hardcoded commands or validated local file paths. |
| 130 | + # This is a CLI tool / MCP server that runs on the user's own machine or |
| 131 | + # in a trusted Fargate container. No untrusted user input reaches subprocess. |
| 132 | + |
| 133 | + - rule_id: "python.lang.security.audit.dangerous-subprocess-use-audit" |
| 134 | + path: "mcp-local/tools.py" |
| 135 | + reason: > |
| 136 | + subprocess.run invokes pdftoppm/osascript/PowerShell with hardcoded |
| 137 | + commands and local file paths. Local MCP server (Layer 2), runs on |
| 138 | + developer's machine. nosemgrep inline comment present but not recognized. |
| 139 | + expiration: "2027-03-29" |
| 140 | + |
| 141 | + - rule_id: "python.lang.security.audit.dangerous-subprocess-use-audit" |
| 142 | + path: "skill/scripts/pptx_builder.py" |
| 143 | + reason: > |
| 144 | + subprocess.run invokes LibreOffice/pdftoppm for PPTX-to-PNG conversion. |
| 145 | + Commands are hardcoded, file paths are from local filesystem. |
| 146 | + CLI tool (Layer 1). nosemgrep inline comment present but not recognized. |
| 147 | + expiration: "2027-03-29" |
| 148 | + |
| 149 | + - rule_id: "python.lang.security.audit.dangerous-subprocess-use-audit" |
| 150 | + path: "skill/sdpm/converter/pipeline.py" |
| 151 | + reason: > |
| 152 | + subprocess.run invokes LibreOffice for PPTX-to-PDF conversion. |
| 153 | + Hardcoded command, local file path. nosemgrep inline comment present. |
| 154 | + expiration: "2027-03-29" |
| 155 | + |
| 156 | + - rule_id: "python.lang.security.audit.dangerous-subprocess-use-audit" |
| 157 | + path: "skill/sdpm/diff/__init__.py" |
| 158 | + reason: > |
| 159 | + subprocess.run invokes LibreOffice for slide diff preview generation. |
| 160 | + Hardcoded commands, local temp directory paths. |
| 161 | + nosemgrep inline comment present but not recognized. |
| 162 | + expiration: "2027-03-29" |
| 163 | + |
| 164 | + # --- Semgrep defusedxml (defuse_stdlib() applied but not recognized) --- |
| 165 | + # All four modules call defusedxml.defuse_stdlib() at import time, |
| 166 | + # which monkey-patches xml.etree.ElementTree to use safe parsers. |
| 167 | + # Semgrep does not recognize this pattern and still flags the import. |
| 168 | + |
| 169 | + - rule_id: "python.lang.security.use-defused-xml" |
| 170 | + path: "skill/sdpm/converter/slide.py" |
| 171 | + reason: > |
| 172 | + Module calls defusedxml.defuse_stdlib() at import time (line 3-4). |
| 173 | + This patches xml.etree.ElementTree globally. Semgrep does not |
| 174 | + recognize defuse_stdlib() as a mitigation. |
| 175 | + expiration: "2027-03-29" |
| 176 | + |
| 177 | + - rule_id: "python.lang.security.use-defused-xml" |
| 178 | + path: "skill/sdpm/converter/color.py" |
| 179 | + reason: > |
| 180 | + Same as slide.py β defusedxml.defuse_stdlib() applied at import time. |
| 181 | + expiration: "2027-03-29" |
| 182 | + |
| 183 | + - rule_id: "python.lang.security.use-defused-xml" |
| 184 | + path: "skill/sdpm/converter/constants.py" |
| 185 | + reason: > |
| 186 | + Same as slide.py β defusedxml.defuse_stdlib() applied at import time. |
| 187 | + expiration: "2027-03-29" |
| 188 | + |
| 189 | + - rule_id: "python.lang.security.use-defused-xml" |
| 190 | + path: "skill/sdpm/converter/xml_helpers.py" |
| 191 | + reason: > |
| 192 | + Same as slide.py β defusedxml.defuse_stdlib() applied at import time. |
| 193 | + expiration: "2027-03-29" |
| 194 | + |
| 195 | + # --- Dockerfile base images from ECR Public Gallery --- |
| 196 | + # All Dockerfiles use public.ecr.aws images. Suppressed as these are |
| 197 | + # official mirrors, not third-party registries. |
| 198 | + |
| 199 | + - rule_id: "bosco/non-ecr-docker-image" |
| 200 | + path: "agent/Dockerfile" |
| 201 | + reason: > |
| 202 | + Uses public.ecr.aws/docker/library/python:3.13-slim-bookworm from |
| 203 | + ECR Public Gallery. This is the official Python image mirror on ECR. |
| 204 | + expiration: "2027-03-29" |
| 205 | + |
| 206 | + - rule_id: "bosco/non-ecr-docker-image" |
| 207 | + path: "mcp-server/Dockerfile" |
| 208 | + reason: > |
| 209 | + Uses public.ecr.aws/docker/library/python:3.13-slim from |
| 210 | + ECR Public Gallery. This is the official Python image mirror on ECR. |
| 211 | + expiration: "2027-03-29" |
0 commit comments