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

All repo-roles: UserAuth should be implemented more strict #152

Closed
markuslf opened this issue May 9, 2024 · 2 comments
Closed

All repo-roles: UserAuth should be implemented more strict #152

markuslf opened this issue May 9, 2024 · 2 comments
Assignees

Comments

@markuslf
Copy link
Member

markuslf commented May 9, 2024

As of today, all repo-roles add username={{ repo_... }} and password={{ repo_... }}, even when the original public vendor repo is used.

Wrong:

[grafana]
name=grafana
{% if repo_grafana__mirror_url is defined and repo_grafana__mirror_url | length %}
baseurl={{ repo_grafana__mirror_url }}/grafana
{% else %}
baseurl=https://rpm.grafana.com
{% endif %}
...
{% if repo_grafana__basic_auth_login is defined and repo_grafana__basic_auth_login | length %}
username={{ repo_grafana__basic_auth_login["username"] }}
password={{ repo_grafana__basic_auth_login["password"] }}
{% endif %}

Fixed by checking if we defined a private mirror (6c2bf8f):

[grafana]
name=grafana
{% if repo_grafana__mirror_url is defined and repo_grafana__mirror_url | length %}
baseurl={{ repo_grafana__mirror_url }}/grafana
{% else %}
baseurl=https://rpm.grafana.com
{% endif %}
...
{% if repo_grafana__mirror_url is defined and repo_grafana__mirror_url | length and repo_grafana__basic_auth_login is defined and repo_grafana__basic_auth_login | length %}
username={{ repo_grafana__basic_auth_login["username"] }}
password={{ repo_grafana__basic_auth_login["password"] }}
{% endif %}

Should be fixed in all repo templates. Otherwise some repos return:

Errors during downloading metadata for repository 'grafana':
  - Status code: 403 for https://rpm.grafana.com/repodata/repomd.xml (IP: 151.101.194.217)
Error: Failed to download metadata for repo 'grafana': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
@NavidSassan
Copy link
Member

There are also upstream repositories that require authentication, for example the Icinga Repo for RHEL8+. IMO the admin should just unset repo_grafana__basic_auth_login when it is not needed, same as they did with repo_grafana__mirror_url.

@markuslf
Copy link
Member Author

Yeah, sounds better. I will revert my changes.

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

No branches or pull requests

2 participants