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

rbw unlocked resets lock-timeout in rbw-agent #215

Open
aeber opened this issue Nov 15, 2024 · 0 comments · May be fixed by #216
Open

rbw unlocked resets lock-timeout in rbw-agent #215

aeber opened this issue Nov 15, 2024 · 0 comments · May be fixed by #216

Comments

@aeber
Copy link

aeber commented Nov 15, 2024

$ rbw --version
rbw 1.12.1

Bug

When using rbw unlocked to check if your vault is locked or not the expiry timer of the vault gets reset.
Therefore, if you check often enough, your vault never re-locks even though the lock_timeout has expired already.

Steps to reproduce:

rbw config set lock_timeout 10
rbw unlock

# wait 11s and verify vault is now locked
sleep 11
rbw unlocked && echo 'vault is unlocked'

# unlock the vault again and verify it does not get locked as long as `rbw unlocked` is executed inside the `lock_timeout`
# this never prints "rbw unlocked: agent is locked"
rbw unlock
watch -n 1 "rbw unlocked && echo 'unlocked'"

Cause

rbw checks the agents version before checking the unlocked status:

crate::actions::unlocked()?;

The rbw-agent handling of the rbw::protocol::Action::Version triggers a reset of the lock timer:

aeber added a commit to aeber/rbw that referenced this issue Nov 15, 2024
@aeber aeber linked a pull request Nov 15, 2024 that will close this issue
@aeber aeber changed the title Vault not re-locking when using rbw unlocked rbw unlocked resets lock-timeout in rbw-agent Nov 15, 2024
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 a pull request may close this issue.

1 participant