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

Compatibility with recent cloud-run-proxy changes #54

Closed
ricardogesuatto-tw opened this issue Jul 11, 2023 · 10 comments · Fixed by #60
Closed

Compatibility with recent cloud-run-proxy changes #54

ricardogesuatto-tw opened this issue Jul 11, 2023 · 10 comments · Fixed by #60

Comments

@ricardogesuatto-tw
Copy link

Hello,

A recent commit in cloud-run-proxy switches from the Authorization header to X-Serverless-Authorization to prevent conflicts with authentication/authorization flows from actual Cloud Run applications.

While this change is technically correct, it breaks how the proxy is used for the local FreshClam database mirror. Since the Cloud Storage API expects regular authentication (vs service-to-service auth with either header), an Forbidden error is returned during container startup.

I'm actually not sure if this issue should be opened here or in the cloud-run-proxy repository... My understanding is that the proxy is being used in an unusual way by the malware scanner, but please let me know if it should be supported in the long run.

@ntang86
Copy link

ntang86 commented Sep 5, 2023

Same issue. Any update on this?

@ntang86
Copy link

ntang86 commented Nov 10, 2023

@nielm ?

@nielm
Copy link
Contributor

nielm commented Nov 15, 2023

In the short term, use cloud-run-proxy v0.3.0 -- which it already does

Cloud-run-proxy have been reluctant to add new features to support my use of their tool...

@ntang86
Copy link

ntang86 commented Nov 23, 2023

Hi, thank you for your answer. I'm failing to understand how their new header X-Serverless-Authorization is impacting clamav? Any clue?

@nielm
Copy link
Contributor

nielm commented Nov 23, 2023 via email

@ricardogesuatto-tw
Copy link
Author

ricardogesuatto-tw commented Nov 23, 2023

@ntang86 The Cloud Storage API expects an access token in the Authorization header. The X-Serverless-Authorization header is effectively ignored by Cloud Storage, since it's specific for serverless scenarios. Cloud Run accepts either Authorization or X-Serverless-Authorization.

Some time before the original post, cloud-run-proxy switched to X-Serverless-Authorization so it frees up the Authorization header for application-specific flows. Whilst this change improves compatibility for most common scenarios, it also breaks CVD updates as implemented in this repository.

Even though cloud-run-proxy supports a -host parameter, pointing it to https://storage.googleapis.com (a completely different service) goes way beyond its intended usage. I'm not sure the team responsible for the proxy endorses this workaround ... Also consider that the equivalent functionality bundled in Google Cloud SDK (mentioned in their README file)does not includes that parameter at all.

I am still using cloud-run-proxy v.0.3.0 as indicated above, but for CVEs / compliance reasons I'm considering if Cloud Storage FUSE can be used instead.

@ntang86
Copy link

ntang86 commented Nov 23, 2023

Thank you for your explanation !

Indeed, we are also facing some CVEs security issue, using the cloud-run-proxy v.0.3.0, not ideal for any production system.
Storage Fuse is a great idea, I might give it a try.

@nielm
Copy link
Contributor

nielm commented Nov 23, 2023 via email

@nielm
Copy link
Contributor

nielm commented Nov 24, 2023

Fix in progress in #60

@ntang86
Copy link

ntang86 commented Nov 25, 2023

Thank you, that's awesome, less dependency to worry about! Looking forward to the fix to be merged !

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 a pull request may close this issue.

3 participants