-
Notifications
You must be signed in to change notification settings - Fork 210
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 config option to restrict asset downloads to logged-in users #6076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you try to incorporate changes applicable to pure mojo+nginx+apache at the same time. Wouldn't it be easier if we focus for a start on mojo especially to avoid the tricky authentication synchronisation between htpasswd and the database?
Maybe we can use https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-subrequest-authentication instead of maintaining an htpasswd file. |
* Disallow unauthenticated access to assets in web application routes * Does NOT cover access via * See https://progress.opensuse.org/issues/170380
It makes not much sense to focus on the web app as a start because this change would be useless if one can just access assets via NGINX anyway. However, I now split the commits because the changes to the web app are of course independent and I probably want to try out https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-subrequest-authentication for NGINX. So this PR is now only covering the web app. You can still see how the approach using basic auth/htpasswd would look like on https://github.com/Martchus/openQA/tree/asset-auth-nginx-basic-auth. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6076 +/- ##
=======================================
Coverage 98.98% 98.98%
=======================================
Files 396 396
Lines 39527 39532 +5
=======================================
+ Hits 39127 39132 +5
Misses 400 400 ☔ View full report in Codecov by Sentry. |
Using a subquery for authentication would actually be quite easy: https://github.com/Martchus/openQA/tree/asset-auth-nginx-subrequest With this we still need to adapt other code, e.g. so assets are still accessible via a logged-in web UI session. With Chromium this just works (except when using the incognito mode) but with Firefox it doesn't and I cannot get it to work using tokenauth (e.g. via https://github.com/Martchus/openQA/tree/asset-auth-nginx-subrequest-with-redirect). Although tokenauth works in general with this approach, e.g.
works as well as:
|
This comment was marked as resolved.
This comment was marked as resolved.
I tried to use the cache service:
This appears to work despite C&P-ing Unfortunately Firefox also gives a 403 response with a logged-in session under |
I summarized my findings so far in https://progress.opensuse.org/issues/174154. |
This PR is now only covering the web app and probably not useful on its own. You can still see how the approach using basic auth/htpasswd would look like on https://github.com/Martchus/openQA/tree/asset-auth-nginx-basic-auth.
See https://progress.opensuse.org/issues/170380