Dashlane / dashlane-cli

👩‍💻 Dashlane CLI - Access your secrets in your terminal, servers and CI/CD
https://cli.dashlane.com/
Apache License 2.0
189 stars 52 forks source link

Read secrets from their ID #151

Closed Mikescops closed 1 year ago

Mikescops commented 1 year ago

As a user, I'd like to access a secret directly from its ID.

This could be done with a read command and a pathing system.

IDs are in the shape of {66263B7E-D87B-4DD0-AC8A-3B88CF46A65E} and can be query directly in the local database.

BenjaminOddou commented 1 year ago

Hey @Mikescops, it seems super interesting. But I didn't really understand how it's working. Let say I know the ID of a password element and I'd like to return the password property, what command should I supply to the terminal (dl://<id>/password ?). Is there a benefit (response time) compare to dcli p id=<id> ? Many thanks in advance !

Mikescops commented 1 year ago

@BenjaminOddou the local database is indexed by this ID so it's indeed faster to query it that way for larger vaults because when you use the title we have to decrypt every secret and then filter on the clear content (it's an optimization I'd say because the decryption is very fast in general).

In the latest version you have a dcli read command that does this (I'll update the website documentation to also explain use cases for dcli inject and dcli exec).

In the future I'm looking at remotely fetching the specific encrypted secret from the Dashlane servers via its ID instead of downloading the whole vault secrets.

BenjaminOddou commented 1 year ago

Many thanks for the explanation ! I'll look up to the documentation. Very promising 😄