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

Add config option to restrict asset downloads to logged-in users #6076

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Martchus
Copy link
Contributor

@Martchus Martchus commented Dec 4, 2024

This is a draft how restricting access to assets would look like relying on basic auth for the reverse proxy:

  • Disallow unauthenticated access to assets in web application routes
  • Maintain an htpasswd file for API keys of users to allow requiring authorization for assets in reverse proxies like NGINX
    • Add and remove an entry in htpasswd when an API key is added/removed
    • Store the key as part of the user name as we could otherwise only store one key/secret pair per user (as users are unique)
    • TODO: Is this a security problem? The key is also in plaintext in the database so I suppose it doesn't make things worse.
    • TODO: Handle existing keys and expiration
  • Provide API key/secret in Location header when redirecting to reverse proxy; probably not ideal but as it for a download key/secret won't show in the address bar at least
  • TODO: Fix other places where assets are downloaded to include API key/secret (e.g. cache service)
  • TODO: Submit perl-Apache-Htpasswd to Factory
  • See https://progress.opensuse.org/issues/170380

* Disallow unauthenticated access to assets in web application routes
* Maintain an htpasswd file for API keys of users to allow requiring
  authorization for assets in reverse proxies like NGINX
    * Add and remove an entry in htpasswd when an API key is added/removed
    * Store the key as part of the user name as we could otherwise only
      store one key/secret pair per user (as users are unique)
	* TODO: Is this a security problem? The key is also in plaintext in
          the database so I suppose it doesn't make things worse.
    * TODO: Handle existing keys and expiration
* Provide API key/secret in `Location` header when redirecting to reverse
  proxy; probably not ideal but as it for a download key/secret won't show
  in the address bar at least
* TODO: Fix other places where assets are downloaded to include API
  key/secret (e.g. cache service)
* TODO: Submit `perl-Apache-Htpasswd` to Factory
* See https://progress.opensuse.org/issues/170380
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.

1 participant