Plan 9: Password Management
An authentication server manages users credentials in a Plan 9 grid. However, if you are just getting started, probably it would be a better idea to directly use factotum for managing credentials for various services.
Create a file keys with the following content.
Load the keys in factotum.
Now you can log into the services without manually entering the password.
Finally, you can add the command to $home/lib/profile so that it will be executed automatically during bootup.
If you have the authentication server configured, you can use the following commands to manage your credentials. (Secstore files are stored at "/adm/secstore/user/" on the authserver).
% auth/secstore -vg factotum
secstore password:
# Append new key
% auth/secstore -vp factotum
secstore password:
# Load credentials in the current factotum process
Time-Based One-Time Password (TOTP) Authenticator
Time-Based One-Time Password (TOTP) is increasingly the preferred way for securing accounts with Two-factor authentication. This program allows you to access TOTP using GUI and CLI. Use mouse-2 to copy the code in the GUI.
Note: The demo uses a modified version (notice aux/totp vs auth/totp in 9front).
Sample factotum key:
TOTP is time-sensitive. You must keep the time synchronized for codes to work.
Key Formats
- otpauth://: The official open standard used by almost all TOTP apps for a single secret. e.g. otpauth://totp/{label}?secret={secret}&issuer={issuer}
- otpauth-migration://offline?data=<base64 string>: A Google authenticator custom protocol that encapsulates multiple secrets into a single string using Google Protocol Buffers (Protobuf) and Base64 encoding.
Quick Response (QR) code
QR code can be generated using qr command.
Code
- https://gitlab.com/atamariya/plan9front/-/blob/dev/sys/src/cmd/aux/totp.c
- https://gitlab.com/atamariya/plan9front/-/blob/dev/sys/src/cmd/aux/totpga.c
Lessons Learnt
- Secret fields in factotum can only be accessed via RPC. factotum/totp.c and factotum/pass.c are the implementation for password and TOTP respectively.
References

Comments
Post a Comment