Skip to content

fix(proxy): add domain validation for proxy requests#1740

Merged
gustavobtflores merged 3 commits intokernelci:mainfrom
gustavobtflores:fix/add-domain-validation-proxy
Feb 10, 2026
Merged

fix(proxy): add domain validation for proxy requests#1740
gustavobtflores merged 3 commits intokernelci:mainfrom
gustavobtflores:fix/add-domain-validation-proxy

Conversation

@gustavobtflores
Copy link
Contributor

No description provided.

Copy link
Collaborator

@MarceloRobert MarceloRobert left a comment

Choose a reason for hiding this comment

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

When accessing a not-allowed domain, the log viewer page just says "Sorry... something went wrong". I think we should at least give a hint to the user as to what is wrong with that log so that they know where to start fixing things.

@MarceloRobert MarceloRobert added the Backend Most or all of the changes for this issue will be in the backend code. label Feb 9, 2026
@gustavobtflores gustavobtflores force-pushed the fix/add-domain-validation-proxy branch from 11cc0c2 to 7d9fddf Compare February 10, 2026 12:56
@gustavobtflores gustavobtflores marked this pull request as ready for review February 10, 2026 13:15
@gustavobtflores gustavobtflores force-pushed the fix/add-domain-validation-proxy branch from 5ae9cf0 to 18cd0ad Compare February 10, 2026 18:55
- Added tests for allowed and forbidden domains, including wildcard and exact matches.
- Updated existing tests to use new allowed domains and paths for consistency.
@gustavobtflores gustavobtflores force-pushed the fix/add-domain-validation-proxy branch from 18cd0ad to ec812a4 Compare February 10, 2026 19:04
Copy link
Collaborator

@MarceloRobert MarceloRobert left a comment

Choose a reason for hiding this comment

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

LGTM, only some minor benefits

"*.linaro.org",
]

ALLOWED_S3_PATHS = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

very nit: I'd add a comment saying that we don't want to allow the entirety of s3 to be allowed, so we only allow the buckets that we know have log data

error instanceof AxiosError &&
error.response?.status === HttpStatusCode.Forbidden
) {
throw new Error('403:Domain not allowed');
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's great, but we could still improve this because when an error 403 is received, the page still retries the request even though it doesn't have to

@gustavobtflores gustavobtflores added this pull request to the merge queue Feb 10, 2026
Merged via the queue into kernelci:main with commit 54eab00 Feb 10, 2026
7 checks passed
@tales-aparecida
Copy link

I think we might be able to handle this differently.
We trust the origins, so we could trust anything that they have inserted in the database, therefore we should check if the URLs are in there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend Most or all of the changes for this issue will be in the backend code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants