Skip to content

Protect the users API endpoint with web ACL#71

Merged
lsipii merged 12 commits intomainfrom
VFD-264-vahvennetaan-tuotannon-palvelujen-kayttooikeudet
Aug 31, 2023
Merged

Protect the users API endpoint with web ACL#71
lsipii merged 12 commits intomainfrom
VFD-264-vahvennetaan-tuotannon-palvelujen-kayttooikeudet

Conversation

@lsipii
Copy link
Copy Markdown
Contributor

@lsipii lsipii commented Aug 24, 2023

  • restrict access to the Users API with AWS Web Application Firewall
    • only allow access from the access finland backend & the dataspace application
    • change the lambda function serving from functionUrl to API Gateway v2
      • WAF does not support lambda functionUrl
  • original intent was to use AWS WAF, but it only supports the original AWS v0 API Gateway REST-API solution, which has it's many drawbacks
    • instead created the restrictions at the application runtime security check level
  • protected controllers and the attached policy explanation:
    • ProductizerController -> [Authorize(Policy = "RequestFromDataspace")]
      • for now: just inspect the request user-agent header, which currently is the only reliably recognizable info from the dataspace requests
      • adjust when we know more from the actual production-like setups
    • UserController ->[Authorize(Policy = "RequestFromAccessFinland")]
      • created a stack infrastructure-level shared access key thats delivered with the pulumi secret outputs
      • direct requests to the users-api must have the shared key defined in the x-api-key header
      • the key is introduced only to the backend-apps:
        • access-finland:af-mvp
        • testbed-api (access-finland:af-features dependecy)

@lsipii lsipii requested a review from LauriGofore August 25, 2023 15:49
@lsipii
Copy link
Copy Markdown
Contributor Author

lsipii commented Aug 28, 2023

Korjaa sen että vanhassa "staging"-tasossa ei ole nykyisellään testbed-kirjautuminen päällä eli vanhat demot ovat särki.

Copy link
Copy Markdown
Contributor

@LauriGofore LauriGofore left a comment

Choose a reason for hiding this comment

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

Testattu toimivaksi fronttibrantsin kanssa. 👍

@lsipii lsipii merged commit 86aabca into main Aug 31, 2023
@lsipii lsipii deleted the VFD-264-vahvennetaan-tuotannon-palvelujen-kayttooikeudet branch August 31, 2023 04:09
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.

2 participants