bitwarden: check local env vars for password or api key #11
Labels
No labels
🐛 bug
DO THE THING >:(
blocked
dependencies
k3s
kind
openbao
question
secrets
wontfix
✨ enhancement
🌱good first issue
📓documentation
📕kyverno
🔐 Bitwarden
🙋help wanted
🦩 MinIO
🧸 🧸 Duplicate
🩹 Bug Fix
🪠 CICD
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
small-hack/smol-k8s-lab#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Looks like this can be accomplished via using the
bw login --apikeyoptionaccording to: https://bitwarden.com/help/cli/#using-an-api-key
to get the api-key you have to login to the web-vault via bitwarden.com..
From there you need to click on the user icon at the top-right of the page and select
account settingsNext you'll need to select the
Securityoption form the menu on the left, and then select theKeystab.At the bottom of the page you should get the options to view the key:
Enter your password at the following screen, and get your api key
Then export the
clientand client secret values asBW_CLIENTIDandBW_CLIENTSECRET.Amazing writeup, thank you! :D
no problem! 🥳
Checked and it looks like even with the api key, you still need to enter in the password to unlock the vault. I don't knoow that we're gaining anything by introducing the API key :(
Source: https://bitwarden.com/help/cli/#unlock
Well, it's hacky, but we can maybe suggest local users use libsecret to grab their bitwarden password and then export that in their shell on login, and then that can be used to unlock the vault. So, going back to the default option for this ticket: We should check local env vars for password. More importantly, it might make sense to add a "add to vault command" option, where we can add things to your vault of any password manager of your choice, but this would still require the user to know that they need to export certain env variables ahead of time to have the vault command work 🤔
I hate this for us. D: I wish that the API key actually worked like a normal API key and didn't still require the password key. This feels like it just adds complexity and no extra security, because you can't even set "require api key".
Reopening because although we now check for session tokens in the env vars, we do not accept API keys yet.
#45 is semi related to this.
I guess if the user is not logged in already, we could potentially try logging in via an api key, but after that, I am closing this ticket, because this is a lot to handle for the scope of this project currently.
Ok, we will now check local env vars not only for a password but also the api key in #79 Closing and we can handle local keyring in #45