选择您在用户集群配置文件的 cloudAuditLogging 部分中配置的 Google Cloud 项目。
输入过滤条件。您可以在以下部分中找到适用于 Binary Authorization for Distributed Cloud 日志条目的示例过滤条件。
选择活动日志:
选择日志名称组合框。
在文本字段中输入 externalaudit.googleapis.com。
选择名为 externalaudit.googleapis.com 的日志。
点击添加。
确保选择事件发生的时间段。
点击运行查询。
查看被拒绝的 Deployment 日志条目
如需查找拒绝的 Deployment 的 Cloud Audit Logs 条目,请使用以下查询:
resource.type="k8s_cluster"
(protoPayload.methodName="io.k8s.core.v1.pods.create" OR
protoPayload.methodName="io.k8s.core.v1.pods.update")
protoPayload.response.status="Failure"
查看试运行日志条目
如需查找与启用试运行模式时进行的 Pod 创建或更新操作相关的 Cloud Audit Logs 条目,请使用以下查询:
resource.type="k8s_cluster"
(protoPayload.methodName="io.k8s.core.v1.pods.create" OR
protoPayload.methodName="io.k8s.core.v1.pods.update")
labels."binaryauthorization.googleapis.com/dry-run"="true"
查看 Breakglass 日志条目
如需查找与启用 Breakglass 的 Pod 创建或更新相关的 Cloud Audit Logs 条目,请使用以下查询:
resource.type="k8s_cluster"
(protoPayload.methodName="io.k8s.core.v1.pods.create" OR
protoPayload.methodName="io.k8s.core.v1.pods.update")
(labels."binaryauthorization.googleapis.com/break-glass"="true" OR
protoPayload.request.metadata.labels."image-policy.k8s.io/break-glass"="true")
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-26。"],[[["This guide explains how to view log entries generated by Binary Authorization for Google Distributed Cloud, which are valuable for system troubleshooting."],["You must configure your Distributed Cloud user cluster to forward log entries to Cloud Audit Logs, but you can also view local audit logs if forwarding is not set up."],["Cloud Audit Logs can be queried via the Google Cloud console or the Cloud Audit Logs API."],["Specific queries are provided to find log entries for rejected deployments, dry run operations, and breakglass events, each using unique filters."],["To successfully query the logs, ensure you select the correct Google Cloud project and the `externalaudit.googleapis.com` log, as well as the appropriate time period when events occurred."]]],[]]