Skip to content

Commit c017519

Browse files
πŸŽ‰ Initial release: Spec-Driven Presentation Maker
4-layer architecture for AI-powered PowerPoint generation: - Layer 1: skill β€” engine + references + SKILL.md - Layer 2: mcp-local β€” stdio MCP server - Layer 3: mcp-server β€” AgentCore Runtime MCP (DDB + S3 + authz) - Layer 4: agent + web-ui β€” Strands Agent + React UI Features: - Template-agnostic: auto-analyze any .pptx template - Multi-asset system: AWS Architecture Icons + Material Symbols - Semantic slide search (Bedrock Knowledge Base) - Code Interpreter integration - JWT Bearer auth (IdP-agnostic) - PNG preview with LibreOffice autofit bake-in - Full CDK infrastructure (7 stacks)
0 parents  commit c017519

285 files changed

Lines changed: 63972 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Ž.ash.yamlβ€Ž

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
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"

β€Ž.dockerignoreβ€Ž

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.git
2+
.gitignore
3+
.dockerignore
4+
.DS_Store
5+
.ruff_cache
6+
.pytest_cache
7+
.venv
8+
__pycache__
9+
*.pyc
10+
*.egg-info
11+
12+
# CDK
13+
infra/cdk.out
14+
infra/node_modules
15+
16+
# Layers not needed in mcp-server image
17+
mcp-local/
18+
agent/
19+
web-ui/
20+
png-worker/
21+
docs/
22+
tests/
23+
scripts/
24+
.kiro/
25+
26+
# Assets (large, not needed at runtime β€” served from S3)
27+
skill/assets/
28+
skill/templates/
29+
skill/references/
30+
skill/.venv
31+
skill/.ruff_cache
32+
skill/scripts/

β€Ž.github/workflows/ash.ymlβ€Ž

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: ASH Security Scan
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
scan:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.12"
17+
- name: Install ASH
18+
run: pip install git+https://github.com/awslabs/automated-security-helper.git@v3.2.4
19+
- name: Run ASH scan
20+
run: ash --mode local --no-fail-on-findings
21+
- name: Upload scan results
22+
uses: actions/upload-artifact@v4
23+
if: always()
24+
with:
25+
name: ash-results
26+
path: .ash/ash_output/

β€Ž.gitignoreβ€Ž

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Byte-compiled
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# Virtual environments
7+
.venv/
8+
venv/
9+
10+
# Distribution
11+
dist/
12+
build/
13+
*.egg-info/
14+
15+
# IDE
16+
.idea/
17+
.vscode/
18+
*.swp
19+
20+
# OS
21+
.DS_Store
22+
23+
# Linter / Test / Coverage cache
24+
.ruff_cache/
25+
.pytest_cache/
26+
.mypy_cache/
27+
.coverage
28+
29+
# Environment variables
30+
.env
31+
32+
# Internal docs (not for public repo)
33+
docs/internal/
34+
35+
# CDK
36+
infra/cdk.out/
37+
infra/node_modules/
38+
infra/cdk-outputs.json
39+
infra/cdk.context.json
40+
41+
# Frontend
42+
admin-ui/node_modules/
43+
admin-ui/dist/
44+
web-ui/node_modules/
45+
web-ui/.next/
46+
web-ui/public/aws-exports.json
47+
48+
# Kiro / Q-SPEC (local steering, specs, settings)
49+
.kiro/
50+
51+
# Config (contains secrets)
52+
infra/config.yaml
53+
54+
# Assets (downloaded via scripts)
55+
skill/assets/aws/
56+
skill/assets/material/
57+
*.tsbuildinfo
58+
.ash/
59+
?/

β€ŽCODE_OF_CONDUCT.mdβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Code of Conduct
2+
3+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
4+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
5+
opensource-codeofconduct@amazon.com with any additional questions or comments.

β€ŽCONTRIBUTING.mdβ€Ž

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing Guidelines
2+
3+
Thank you for your interest in contributing to this project. Whether it's a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community.
4+
5+
## How to contribute
6+
7+
1. Fork the repository
8+
2. Create a feature branch (`git checkout -b feature/my-feature`)
9+
3. Make your changes
10+
4. Run tests (`make all`)
11+
5. Commit your changes
12+
6. Push to the branch
13+
7. Open a Pull Request
14+
15+
## Development setup
16+
17+
```bash
18+
# Install Python dependencies
19+
pip install -e ".[dev]"
20+
21+
# Run tests
22+
make test
23+
24+
# Run linter
25+
make lint
26+
27+
# Run all checks
28+
make all
29+
```
30+
31+
## Code style
32+
33+
- All functions must have docstrings (purpose, args, returns)
34+
- Type hints on all function signatures
35+
- Non-obvious code must be commented
36+
- No fallback to default values β€” fail loudly
37+
- Named parameters preferred over positional
38+
- File header: `# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.` + `# SPDX-License-Identifier: MIT-0`
39+
40+
## Reporting bugs / feature requests
41+
42+
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
43+
44+
## Security issue notifications
45+
46+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public GitHub issue.
47+
48+
## Licensing
49+
50+
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

0 commit comments

Comments
Β (0)