galasa-dev / projectmanagement

Project Management repo for Issues and ZenHub
7 stars 3 forks source link

Use a configurable value to set the Access-Control-Allow-Origin header in API server responses #1895

Closed eamansour closed 2 weeks ago

eamansour commented 3 weeks ago

Story

As a Galasa Ecosystem administrator, I want to be able to configure the domains that are allowed to receive responses from my ecosystem's API server, so that I can avoid CORS vulnerabilities.

Background

Currently, API server responses all contain a Access-Control-Allow-Origin: * header, which is too permissive as noted by a recent vulnerability scan.

Adding a value in the Helm chart that is passed into the API server would allow users to limit the domains that can receive responses from their ecosystem's API server. This value will contain a list of allowed origins that can be checked against whenever a request is made to the API server. If the request's Origin header contains a value that matches an allowed origin, then we'll set the Access-Control-Allow-Origin header in the response to the matched value.

Tasks