2802d04368
Add TTL to web UI auth token cache for rotation
...
The web-ui handlers cached the Secrets Manager auth token at module
level with no expiry, so a rotated secret was only picked up when the
warm container recycled — an emergency rotation could take hours to
take effect. Cache the fetched value for a 5-minute TTL instead, so a
rotated token propagates within the TTL while still avoiding a Secrets
Manager call on every request. Still fails closed when the secret is
unset or unreadable.
Refs: INFRA-74
2026-07-15 19:33:16 -04:00
amoussa1229
5b39f1dad1
fix: resolve web UI auth token from Secrets Manager at runtime
...
Replace the plaintext SSM String parameter with a Secrets Manager secret
referenced by ARN only. The token is fetched and cached at module level on
first invocation, keeping shared secrets out of CloudFormation templates and
Lambda environment variables.
Refs: PR-97
2026-07-15 19:31:29 -04:00
522f4593c6
Gate web UIs behind auth and escape currency XSS
...
The po-web-ui and workorder-web-ui handlers had no auth: any
invocation path returned the full PO/WO DB. Add a fail-closed
shared-secret gate (X-Auth-Token / Bearer, constant-time compared to
WEB_UI_AUTH_TOKEN) so a future re-attached Function URL cannot
re-expose the data (URLs removed under INFRA-74). Wire the token from
the SSM String param /procurement-ingest/web-ui-auth-token.
Also fix stored XSS in po-web-ui fmt_currency: the non-numeric
fallback returned str(val) unescaped, so a prompt-injected email
could make Claude emit total_amount as <script>. Escape it.
Refs: INFRA-74
2026-07-15 19:29:41 -04:00
55a647537c
Require Secrets Manager key for Anthropic client
...
Remove the silent fallback to a plaintext ANTHROPIC_API_KEY env var
in both email processors; require ANTHROPIC_API_KEY_SECRET_ARN and
raise if absent so a misconfigured deploy fails loudly instead of
using an unmanaged key.
Adapted from f175323 on security/sweep-2026-06-17. The From-header
sender-domain allowlist from that commit is intentionally dropped:
the From header is spoofable (INFRA-107, confirmed critical) and
sender authentication is being reworked in a separate PR.
Refs: INFRA-107
2026-07-15 19:29:41 -04:00
dependabot[bot]
f06d2d6f5e
Update boto3 requirement in /lambdas/wo/email_processor ( #93 )
2026-07-14 13:06:52 +00:00
dependabot[bot]
4aa88b630e
Update boto3 requirement in /lambdas/wo/web_ui ( #92 )
2026-07-14 09:04:31 -04:00
dependabot[bot]
944b8e7bdd
Update anthropic requirement in /lambdas/wo/email_processor ( #89 )
...
Deploy / deploy (push) Waiting to run
Updates the requirements on [anthropic](https://github.com/anthropics/anthropic-sdk-python ) to permit the latest version.
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases )
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md )
- [Commits](https://github.com/anthropics/anthropic-sdk-python/compare/v0.113.0...v0.116.0 )
---
updated-dependencies:
- dependency-name: anthropic
dependency-version: 0.116.0
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-07 18:25:53 +00:00
dependabot[bot]
5019c2e7b6
Update boto3 requirement in /lambdas/wo/email_processor ( #88 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.38...1.43.41 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.41
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-07 17:59:27 +00:00
dependabot[bot]
e8202a8394
Update boto3 requirement in /lambdas/wo/web_ui ( #90 )
...
Deploy / deploy (push) Waiting to run
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.39...1.43.41 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.41
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-07 16:36:58 +00:00
dependabot[bot]
1dba62e52e
Update boto3 requirement in /lambdas/wo/web_ui ( #80 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.36...1.43.39 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.37
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-02 15:30:38 -04:00
dependabot[bot]
3e95cabcd2
Update boto3 requirement in /lambdas/wo/email_processor ( #81 )
...
Deploy / deploy (push) Has been cancelled
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.36...1.43.38 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.37
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-30 23:49:58 +00:00
dependabot[bot]
b102dae3c8
Update anthropic requirement in /lambdas/wo/email_processor ( #78 )
...
Updates the requirements on [anthropic](https://github.com/anthropics/anthropic-sdk-python ) to permit the latest version.
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases )
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md )
- [Commits](https://github.com/anthropics/anthropic-sdk-python/compare/v0.112.0...v0.113.0 )
---
updated-dependencies:
- dependency-name: anthropic
dependency-version: 0.113.0
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-30 19:45:49 -04:00
dependabot[bot]
0772f8c535
Update anthropic requirement in /lambdas/wo/email_processor ( #77 )
...
Deploy / deploy (push) Has been cancelled
Updates the requirements on [anthropic](https://github.com/anthropics/anthropic-sdk-python ) to permit the latest version.
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases )
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md )
- [Commits](https://github.com/anthropics/anthropic-sdk-python/compare/v0.109.2...v0.112.0 )
---
updated-dependencies:
- dependency-name: anthropic
dependency-version: 0.111.0
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-24 16:16:32 -04:00
dependabot[bot]
e803437f20
Update boto3 requirement in /lambdas/wo/email_processor ( #75 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.31...1.43.36 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.36
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-24 16:08:04 -04:00
dependabot[bot]
a215f12095
Update boto3 requirement in /lambdas/wo/web_ui ( #74 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.31...1.43.36 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.36
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-24 16:03:55 -04:00
dependabot[bot]
cab4a035ed
Update boto3 requirement in /lambdas/wo/email_processor ( #67 )
...
Deploy / deploy (push) Waiting to run
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.28...1.43.31 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.30
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-16 21:16:19 +00:00
dependabot[bot]
3a4f4889ab
Update boto3 requirement in /lambdas/wo/web_ui ( #63 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.28...1.43.31 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.30
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-16 20:50:39 +00:00
dependabot[bot]
14794946ba
Update anthropic requirement in /lambdas/wo/email_processor ( #62 )
...
Updates the requirements on [anthropic](https://github.com/anthropics/anthropic-sdk-python ) to permit the latest version.
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases )
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md )
- [Commits](https://github.com/anthropics/anthropic-sdk-python/compare/v0.109.1...v0.109.2 )
---
updated-dependencies:
- dependency-name: anthropic
dependency-version: 0.109.2
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-16 16:46:29 -04:00
dependabot[bot]
109f9336e0
Update boto3 requirement in /lambdas/wo/web_ui ( #60 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.25...1.43.28 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.27
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-12 15:19:41 -04:00
dependabot[bot]
01dc4f6368
Update boto3 requirement in /lambdas/wo/email_processor ( #59 )
...
Deploy / deploy (push) Waiting to run
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.25...1.43.28 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.27
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-12 15:15:51 -04:00
dependabot[bot]
d217caac13
Update anthropic requirement in /lambdas/wo/email_processor ( #53 )
...
Deploy / deploy (push) Waiting to run
Updates the requirements on [anthropic](https://github.com/anthropics/anthropic-sdk-python ) to permit the latest version.
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases )
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md )
- [Commits](https://github.com/anthropics/anthropic-sdk-python/compare/v0.105.2...v0.109.1 )
---
updated-dependencies:
- dependency-name: anthropic
dependency-version: 0.107.1
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam Moussa <166072409+amoussa1229@users.noreply.github.com>
2026-06-10 22:21:45 +00:00
dependabot[bot]
6af5312409
Update boto3 requirement in /lambdas/wo/web_ui ( #54 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.23...1.43.25 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.25
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-10 18:14:13 -04:00
dependabot[bot]
d0dcfb51fc
Update boto3 requirement in /lambdas/wo/email_processor ( #51 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.23...1.43.25 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.25
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-10 18:14:01 -04:00
dependabot[bot]
dedbbda7a1
Update boto3 requirement in /lambdas/wo/web_ui ( #46 )
...
Deploy / deploy (push) Has been cancelled
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.22...1.43.23 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.23
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam Moussa <166072409+amoussa1229@users.noreply.github.com>
2026-06-08 22:37:44 +00:00
dependabot[bot]
7b3b01ec05
Update boto3 requirement in /lambdas/wo/email_processor ( #44 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.10...1.43.23 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.23
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam Moussa <166072409+amoussa1229@users.noreply.github.com>
2026-06-08 22:33:01 +00:00
dependabot[bot]
d145178c8d
Update boto3 requirement in /lambdas/wo/web_ui ( #41 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.10...1.43.22 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.22
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-03 22:51:28 +00:00
dependabot[bot]
53e906bf56
Update anthropic requirement in /lambdas/wo/email_processor ( #38 )
...
Updates the requirements on [anthropic](https://github.com/anthropics/anthropic-sdk-python ) to permit the latest version.
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases )
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md )
- [Commits](https://github.com/anthropics/anthropic-sdk-python/compare/v0.103.1...v0.105.2 )
---
updated-dependencies:
- dependency-name: anthropic
dependency-version: 0.105.2
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-03 22:49:37 +00:00
dependabot[bot]
dfd2a77126
Update boto3 requirement in /lambdas/wo/email_processor ( #33 )
...
Deploy / deploy (push) Has been cancelled
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.6...1.43.10 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.10
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-19 19:24:01 +00:00
dependabot[bot]
dc3355b7a8
Update boto3 requirement in /lambdas/wo/web_ui ( #31 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.43.6...1.43.10 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.10
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-19 19:21:02 +00:00
dependabot[bot]
51f4272b0e
Update anthropic requirement in /lambdas/wo/email_processor ( #30 )
...
Updates the requirements on [anthropic](https://github.com/anthropics/anthropic-sdk-python ) to permit the latest version.
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases )
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md )
- [Commits](https://github.com/anthropics/anthropic-sdk-python/compare/v0.101.0...v0.103.1 )
---
updated-dependencies:
- dependency-name: anthropic
dependency-version: 0.103.1
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-19 19:20:53 +00:00
dependabot[bot]
cb2af81615
Update anthropic requirement in /lambdas/wo/email_processor ( #27 )
...
Deploy / deploy (push) Has been cancelled
Updates the requirements on [anthropic](https://github.com/anthropics/anthropic-sdk-python ) to permit the latest version.
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases )
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md )
- [Commits](https://github.com/anthropics/anthropic-sdk-python/compare/v0.42.0...v0.101.0 )
---
updated-dependencies:
- dependency-name: anthropic
dependency-version: 0.101.0
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-12 19:26:04 +00:00
dependabot[bot]
b7dd722de6
Update boto3 requirement from >=1.35.0 to >=1.43.6 in /lambdas/wo/web_ui ( #25 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.35.0...1.43.6 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.6
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-12 19:23:39 +00:00
dependabot[bot]
3c9f845a32
Update boto3 requirement in /lambdas/wo/email_processor ( #26 )
...
Updates the requirements on [boto3](https://github.com/boto/boto3 ) to permit the latest version.
- [Release notes](https://github.com/boto/boto3/releases )
- [Commits](https://github.com/boto/boto3/compare/1.35.0...1.43.6 )
---
updated-dependencies:
- dependency-name: boto3
dependency-version: 1.43.6
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-12 19:23:36 +00:00
Adam Moussa
5112c1345b
Merge workorder-ingest into unified procurement repo ( #22 )
...
* Merge workorder-ingest pipeline into unified repo
Move PO lambdas under lambdas/po/, add WO pipeline under lambdas/wo/.
Two independent CloudFormation stacks in one CDK app. Fix WO stack
compliance: ARM64 architecture, 60-day log retention, aarch64 bundling,
RETAIN on Anthropic secret. Remove stale CodePipeline buildspec.
* Fix test_local.py import path and remove dead shared/models.py
test_local.py referenced the old lambdas/email_processor path. Updated
to lambdas/wo/email_processor. Removed shared/ directory entirely as
nothing imports from it.
* Escape HTML in both web UI dashboards to prevent XSS
Both Function URLs are public (auth_type=NONE) and render
email-derived content via f-strings. Attacker-crafted emails
could inject scripts. Added html.escape() on all interpolated
values in both PO and WO dashboards.
* Add pagination to WO web UI scan
get_work_orders() only fetched the first 1MB page from DynamoDB.
Loop on LastEvaluatedKey to match the PO web UI pattern.
* Fix esc(None) TypeError and javascript: scheme in PO web UI
Coerce supplier name through `or ""` before escaping to handle
nested None from DynamoDB. Add scheme allowlist on view_order_url
to block javascript:/data: hrefs from LLM-extracted URLs.
* Fix WO render_badge None guard, updated_at slice, and backfill path
Add null guard to WO render_badge matching the PO version. Use
`or ""` before slicing updated_at to handle explicit None values.
Fix backfill_sites.py sys.path to use new lambdas/po/site_extractor.
* Harden WO web UI and fix JS-context XSS in both dashboards
- Use json.dumps for onclick URLs to prevent JS string breakout
- Add .lower() to WO render_badge color lookup matching PO pattern
- Add pagination to get_comments query
- Cap get_work_orders to 500 results matching PO pattern
* Apply ruff formatting to web UI handlers
2026-05-12 15:21:06 -04:00