我有一个 GCP 项目。我创建了一个带有两个 JSON 密钥(密钥 ID)的服务帐户。为简洁起见,我们称它们为Key A
and Key B
。
创建密钥后,我可以在 JSON 文件中看到每个密钥都有一个唯一的private_key_id
属性。两个密钥client_email
显然共享相同,例如foo@project-id-here.iam.gserviceaccount.com
在 Stackdriver 日志记录中,我可以看到client_email
正在使用的服务帐户。但是,审核日志不会区分附加到实际服务帐户的密钥。换句话说,我在日志中看到的只是(此示例显示了对 BigQuery 的访问):
..authenticationInfo: {
principalEmail: "foo@project-id-here.iam.gserviceaccount.com"
}
authorizationInfo: [
0: {
granted: true
permission: "bigquery.jobs.create"
resource: "projects/project-id-here"
}
1: {
granted: true
permission: "bigquery.jobs.create"
resource: "projects/project-id-here"
}
]..
如何查看服务帐户的哪个密钥实际使用了 ieKey A
或Key B
?