ARTIFACTORY:如何打印用于审计目的的ARTIFACTORY访问令牌ID

班迪·哈里什·上帝
2023-01-22 11:07

事实:

访问令牌是另一种身份验证方法,可以代替用户和密码使用。人工用户可以生成多个访问令牌,包括“可过期的和不可过期的”,每个令牌都有一个唯一的令牌ID,用于审计目的。

问题陈述:

用户可以有多个访问令牌-如果我的一个访问令牌被泄露,我如何知道我应该撤销哪个令牌:

当用户试图使用access Token访问JFrog实例时,当前的日志机制将只记录Artifactory请求日志中的“用户名”,而不记录Token ID。

例如:假设我有一个为Admin用户生成的访问令牌,并且我尝试从Artifactory下载一个文件“test1.jar”。
Usernameadmin
Scopeapplied-permissions /管理
观众* @ *
令牌id3f58786e xxxxxxxxxxxxxxxxxx - 320 dbcf3417f
过期In0(永不过期)

Artifactory将只记录与“Artifactory -access.log”和“Artifactory -request.log”中的令牌相关联的用户名,并且我们不知道哪个令牌用于从Artifactory下载“test1.jar”。

" artifactory-access.log "和"artifactory-request.log"条目:[已接受下载]lib -snapshot-local:test1.jar for client: admin / xx.xx.xx.xx. xx…
artifactory-request.log: 2022 - 10 - 21 - t08:01:00.142z d0eea37f2986bb | 76 | xx.xx.xx.xx。管理| | | / libs-snapshot-local test1.jar | 200 | 1 | 3953 | 38553858 |旋度/ 7.79.1

如何启用日志记录以在路由器请求日志中打印tokenID。

为了启用令牌ID日志记录,您需要在Artifactory系统中更新以下路由器日志记录配置。yaml文件。

注意:此更改需要重新启动Artifactory实例。

##日志设置
路由器:
日志:
要求:
详细:真
tokenIdLoggingEnabled:真

用户添加图片

启用令牌ID日志记录后。Artifactory将开始在“router-request.log”中打印Token ID,您需要将“request.log”实体与“router-request.log”关联起来,以找出实际的Token ID。

从Artifactory下载了“test1.jar”。请查看以下日志条目:Request.log:

[已接受下载]lib -snapshot-local:test1.jar for client: admin / xx.xx.xx.xx. xx.xx.xx.xx. xxx . xxx . xxx . xxx . xxx . xxx ..
artifactory-request.log: 2022 - 10 - 21 - t08:10:53.142z f0eef37f2870bb | 70 | xx.xx.xx.xx。管理| | | / libs-snapshot-local test1.jar | 200 | 1 | 3953 | 38553858 |旋度/ 7.79.1

router-request.log:

70年:“request_Uber-Trace-Id f0eef37f2870bb: 6 bcbd9ea033cfbf8:70f0eef37f2870bb: 0”
:“request_X-Jfrog-Auth-Token-Id 3 f58786e xxxxxxxxxxxxxxxxxx - 320 dbcf3417f”,“时间”:“2022 - 10 - 21 - t08:10:54z”}

请注意,如果启用此记录器,将会有性能开销。你可以参考Artifactory系统。yaml维基更多信息请访问:
用户添加图片