我正试图熟悉Hashicorp Vault,但我不知道如何使用其审核日志?
例如,假设一位管理员被盗用,并且拥有root令牌的人创建了另一个root令牌。我收到这样的审核日志:
IVsUIShellOpenDocument
我怎么知道是谁? 我如何获取被破坏的令牌的访问者? 在哪里可以获取刚刚创建的令牌的访问者以撤消它?
还是我没有正确了解保险柜审核的目的?
答案 0 :(得分:0)
我发现一个很酷的选项使我吃了一惊:hmac_accessor = false
,这是启用了tis选项的审核日志:
{
"time": "2019-08-27T07:55:57.888464574Z",
"type": "response",
"auth": {
"client_token": "hmac-sha256:84c8887e815c04aeef145ebffa05f9ef6fde166d7645b5046416d76add283fef",
"accessor": "y1lRcyzxkPgL0gmQ45WqliPy",
"display_name": "root",
...
},
"request": {
"id": "f4dc76af-b562-ae2c-8d6f-dd6a0d6f7ef6",
"operation": "update",
"client_token": "hmac-sha256:84c8887e815c04aeef145ebffa05f9ef6fde166d7645b5046416d76add283fef",
"client_token_accessor": "y1lRcyzxkPgL0gmQ45WqliPy",
...
},
"response": {
...
},
"error": ""
}
UPD:当前访问者列表:
$ vault list auth/token/accessors
Keys
----
MelMLthx4K4FznCbNIB8xbC6
bOnatDe7MXfdB9f3CRuGPo0h
y1lRcyzxkPgL0gmQ45WqliPy
VerAvaBln92HG38gKbKEcXOZ
通过访问者获取有关令牌的信息:
$ vault write auth/token/lookup-accessor accessor=VerAvaBln92HG38gKbKEcXOZ
Key Value
--- -----
accessor VerAvaBln92HG38gKbKEcXOZ
creation_time 1566893336
creation_ttl 3m
display_name token
entity_id n/a
expire_time 2019-08-27T11:11:56.903211142+03:00
explicit_max_ttl 0s
id n/a
issue_time 2019-08-27T11:08:56.903210949+03:00
meta <nil>
num_uses 0
orphan false
path auth/token/create
period 3m
policies [root]
renewable true
ttl 2m55s
type service