feat: switch bootstrap to 'None' authentication provider#7331
feat: switch bootstrap to 'None' authentication provider#7331okurz wants to merge 4 commits intoos-autoinst:masterfrom
Conversation
|
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files. |
Martchus
left a comment
There was a problem hiding this comment.
The PR description mentions that this is motivated by improving the single instance container but the change itself it changing the bootstrap script. And it does it in a way that makes it less secure. If this is the work of AI, I really suggest you review these changes yourself before creating a PR.
| API_KEY=$(hexdump -n 8 -e '2/4 "%08X" 1 "\n"' /dev/random) | ||
| API_SECRET=$(hexdump -n 8 -e '2/4 "%08X" 1 "\n"' /dev/random) |
There was a problem hiding this comment.
This generated a new, random key and configured it. So one ended up with a more secure setup than with with your change. The only missing step to make it secure would be switching the auth method for the web UI.
So I'm not sure whether that's a change for the better.
There was a problem hiding this comment.
I kind of agree. On the other hand changing the method away from None/Fake is necessary anyway?
| key = ${OPENQA_AUTH_NONE_KEY:-DEADBEEFDEADBEEF} | ||
| secret = ${OPENQA_AUTH_NONE_SECRET:-DEADBEEFDEADBEEF} |
There was a problem hiding this comment.
It is a bit weird that we need this file at all with the None provider. Shouldn't None also mean that no API key/secret are required when using openqa-cli?
No, I got completely tunnel sighted and have forgot that we use openqa-bootstrap outside the single instance container :D |
Actually, can you comment what you mean is making this less secure? In before we used the fake authentication means everyone is an admin. How is it less secure now? |
Read #7331 (comment). Before one was only one step away from a secure setup (changing the auth provider). Now one also needs to generate a new key/secret. |
But reusing a key that was previously openly available is also a bad idea |
0832d72 to
3216e4b
Compare
Codecov Report❌ Patch coverage is
❌ Your project check has failed because the head coverage (99.99%) is below the target coverage (100.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #7331 +/- ##
===========================================
- Coverage 100.00% 99.99% -0.01%
===========================================
Files 419 419
Lines 44529 44556 +27
===========================================
+ Hits 44529 44554 +25
- Misses 0 2 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Martchus
left a comment
There was a problem hiding this comment.
Looks generally good with supplying no key at all.
3216e4b to
29f59d1
Compare
Motivation: The single-instance container setup was using the 'Fake' authentication method, which is less ideal for modern development/testing than the newer 'None' method. 'None' provides better defaults and doesn't require manual API key injection or explicit login. Design Choices: - Updated script/openqa-bootstrap to configure method = None. - Removed manual database injection and random key generation since None handles this automatically. - Updated documentation to reflect these changes and promote None over Fake. Benefits: Simplified bootstrap process, better alignment with recommended development and testing practices. Related issue: os-autoinst#7297
Motivation: Consistent use of a constant instead of a literal string for the default admin username simplifies maintenance and potential future changes. Benefits: Better code maintainability and reduced risk of string-based errors.
Motivation: The HMAC calculation in the replay attack subtest was incorrect: it was calling hmac_sha1_sum with only one argument and concatenating the timestamp to the result, instead of hashing the concatenated string. Design Choices: Properly concatenate the path query and timestamp before hashing, and pass the secret as the second argument to hmac_sha1_sum.
29f59d1 to
1b1d5c3
Compare
This is exactly the discussion we already had drafting None authentication. Fake is not secure. The login route can be used even after a key is present. The only difference here is explicitly using a provider that consistently disabling authentication. Security by obscurity is not helping us imho (my only remark above was about documentation in that regard) |
Motivation:
The single-instance container setup was using the 'Fake' authentication method,
which is less ideal for modern development/testing than the newer 'None' method.
'None' provides better defaults and doesn't require manual API key injection or
explicit login.
Design Choices:
this automatically.
Benefits:
Simplified bootstrap process, better alignment with recommended development and
testing practices.
Related issue: #7297