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

Add WAF ACL to Cognito User Pool #976

Merged
merged 3 commits into from
Jan 24, 2024
Merged

Add WAF ACL to Cognito User Pool #976

merged 3 commits into from
Jan 24, 2024

Conversation

noah-paige
Copy link
Contributor

@noah-paige noah-paige commented Jan 14, 2024

Feature or Bugfix

  • Feature

Detail

  • Add WAF ACL to Cognito

Relates

Security

Please answer the questions below briefly where applicable, or write N/A. Based on
OWASP 10.

  • Does this PR introduce or modify any input fields or queries - this includes
    fetching data from storage outside the application (e.g. a database, an S3 bucket)?
    • Is the input sanitized?
    • What precautions are you taking before deserializing the data you consume?
    • Is injection prevented by parametrizing queries?
    • Have you ensured no eval or similar functions are used?
  • Does this PR introduce any functionality or component that requires authorization?
    • How have you ensured it respects the existing AuthN/AuthZ mechanisms?
    • Are you logging failed auth attempts?
  • Are you using or adding any cryptographic features?
    • Do you use a standard proven implementations?
    • Are the used keys controlled by the customer? Where are they stored?
  • Are you introducing any new policies/roles/users?
    • Have you used the least-privilege principle? How?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@noah-paige noah-paige self-assigned this Jan 14, 2024
@noah-paige noah-paige linked an issue Jan 14, 2024 that may be closed by this pull request
@noah-paige noah-paige marked this pull request as ready for review January 16, 2024 19:28
@noah-paige
Copy link
Contributor Author

noah-paige commented Jan 16, 2024

Tested in AWS:

  • CICD Pipeline Succeeds
  • Add WAF Rules to Cognito User Pool (no updates to Cloudfront or API GW)
  • Log In, Log Out, and Access Data.all UI

deploy/stacks/cognito.py Outdated Show resolved Hide resolved
Copy link
Contributor

@dlpzx dlpzx left a comment

Choose a reason for hiding this comment

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

I will test with custom_waf_rules once the issue of the names of the IP sets is resolved

@dlpzx
Copy link
Contributor

dlpzx commented Jan 18, 2024

Overall looks good! Testing in AWS with custom_waf_rules:

  • CICD Pipeline Succeeds
  • Added WAF Rules to Cognito User Pool (no updates to Cloudfront or API GW)
  • Log In, Log Out, and Access Data.all UI

@@ -26,6 +28,7 @@ def __init__(
vpc=None,
prod_sizing=False,
internet_facing=True,
custom_waf_rules=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

I have been tracking this parameter upstream and I cannot see it neither in the cdk.json nor in the backend stack. Should we re-enable it and add it to the cdk.json template and docs? In such case, maybe it is worth opening a separate PR. wdyt?

@dlpzx
Copy link
Contributor

dlpzx commented Jan 24, 2024

I created another issue for the custom_waf_rules : #995

@noah-paige noah-paige merged commit 72c4ff6 into main Jan 24, 2024
9 checks passed
@dlpzx dlpzx deleted the add-waf-t-cognito branch April 25, 2024 13:12
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.

Add WAF rules to Cognito user pool
2 participants