Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header change detection construct #1422

Merged
merged 12 commits into from
Jan 24, 2025
Merged

Conversation

TheOrangePuff
Copy link
Contributor

Description of the proposed changes

This is a big PR, apologies. Probably best to read the readme which describes the purpose of what I'm adding here. TL;DR: this is required for PCI DSS v4 11.6.1.

This creates a Lambda, DynamoDB table, and EventBridge schedule to check for header changes. The idea is that this construct can be added to any hosting stack to add the header change detection functionality.

Notes to reviewers

@toddhainsworth I've added you specifically for the Lambda function code review but feel free to review other areas as well.

🛈 When you've finished leaving feedback, please add a final comment to the PR tagging the author, letting them know that you have finished leaving feedback

@TheOrangePuff
Copy link
Contributor Author

The build is failing for a strange reason 🤔

node_modules/@smithy/core/protocols.d.ts:6:3 - error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'RequestBuilder'. Consider explicitly re-exporting to resolve the ambiguity.

6   export * from "@smithy/core/dist-types/submodules/protocols/index.d";

Copy link
Member

@toddhainsworth toddhainsworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few little housekeeping things and TS questions - looking good!

packages/header-change-detection/jest.config.ts Outdated Show resolved Hide resolved
const securityHeaders = HEADERS?.split(",") || []

type Headers = Map<string, string | undefined>
type URLHeaders = Map<string, Headers>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if commentary describing what the string key is here (the URL, right?) might make it clearer?

packages/header-change-detection/package.json Outdated Show resolved Hide resolved
packages/header-change-detection/package.json Show resolved Hide resolved
toddhainsworth
toddhainsworth previously approved these changes Jan 23, 2025
Copy link
Member

@toddhainsworth toddhainsworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nicely done 🕺

AdamJHall
AdamJHall previously approved these changes Jan 23, 2025
toddhainsworth
toddhainsworth previously approved these changes Jan 24, 2025
@TheOrangePuff TheOrangePuff merged commit ac75b8f into main Jan 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants