带yubikey auth的内存凭证存储
salvus的Python项目详细描述
具有Yubikey授权的内存凭证存储。
为每个键存储一组id和值。通常id是用户名 值是密码。两个字段都不能包含换行符。
命令行界面
用法:
salvus serve [daemon] [-p PORT] [-e EXPIRY] salvus auth [-p PORT] salvus get <KEY> [-a] [-p PORT] salvus set <KEY> <ID> [-a] [-p PORT] salvus list [-a] [-p PORT] salvus kill [-p PORT] salvus ping [-p PORT] salvus -h
选项:
-h, --help | This help |
-p PORT | Port to listen to (always on localhost) [default: 59999] |
-e EXPIRY | Auth expiry in seconds, if 0 then ^{tt1}$, ^{tt2}$ and ^{tt3}$ requires -a [default: 3600] |
-a | Add auth to each command, so requires yubikey OTP |
解释输出
所有错误都打印在STDRR上,退出代码将为非零。如果退出代码为零,输出将是空的或在该情况下 共get行,第一行是id,第二行是secret。
当需要Yubikey OTP(一次性密码)时,将输出提示 在stderr上,因此它可以与所需的输出分离。
示例
启动服务器:
salvus server
输入用于标识这是服务器的识别短语 你信任我。
触摸Yubikey,服务器将在默认端口上启动。
设置凭据:
salvus set github philipbergen
系统将在stdout上提示您输入密码,当 你完了
获取凭据:
salvus get github
stdout输出的第一行是id(用户名),第二行是 是秘密(密码)。
如果设置了零到期(对每个请求进行身份验证),则需要 将-a添加到对get、set或list的每个调用中。在 如果是get,则可以很容易地将提示与结果分离,因为 stdout上只有结果:
salvus get github -a > userpass
它将在stderr上输出Please touch the yubikey:,并且 userpass将包含两行,第一行是用户名和 第二行是密码。
正在终止服务器:
salvus kill
这显然需要Yubikey OTP。
ping服务器:
salvus ping
不需要Yubikey OTP。唯一相关的输出是退出代码, 服务器运行时为零,连接时为非零(以及stderr上的原因) 失败。