代管 Kubernetes 服務 (MKS)

CRUD 作業

CRUD 作業包括:

  • NodePoolClaim 資料
  • AddressPoolClaim 資料
  • SubnetClaim 資料
  • CIDRClaim 資料
  • 叢集資料
  • NodePool 資料
  • MKS 叢集資料

下表包含 NodePoolClaim 資料的範例 (CRUD 作業):

記錄項目中包含稽核資訊的欄位
稽核中繼資料 稽核欄位名稱
使用者或服務身分 user

執行動作的使用者:

user.username: system:serviceaccount:kube-system:anthos-cluster-operator-1.13.2

完整物件程式碼片段:

"user":{
  "username": "system:serviceaccount:kube-system:anthos-cluster-operator-1.13.2",
  "uid": "4ebfd4f7-f371-4c40-9f88-ea0709a7039e",
  "groups": [
    "system:serviceaccounts",
    "system:serviceaccounts:kube-system",
    "system:authenticated"
  ],
  "extra": {
     "authentication.kubernetes.io/pod-name": [
       "anthos-cluster-operator-1.13.2-bc6b7467d-22z88"
     ],
     "authentication.kubernetes.io/pod-uid": [
       "004e1b37-6d4d-4959-b77d-0e69dce5ef4a"
     ]
  }
}

目標

(KRM object being acted upon)

objectRef/requestURI

特定物件參考資料:

"objectRef": {
  "resource": "nodepoolclaims",
  "namespace": "org-1",
  "name": "admin-control-plane-node-pool",
  "apiGroup": "baremetal.cluster.gke.io",
  "apiVersion": "v1",
  "subresource": "status"
}

要求 URI:

/apis/baremetal.cluster.gke.io/v1/namespaces/org-1/nodepoolclaims/admin-control-plane-node-pool/status

動作

(執行的 CRUD 作業)

verb

執行的作業:update

(其他可能的值:get、create、apply、patch、delete、list、watch)

事件時間戳記 requestReceivedTimestamp

2022-11-23T23:19:42.690064Z

動作來源 _gdch_clustersourceIPs

叢集:root-admin

來源 IP 位址:["10.253.128.74"]

結果 responseStatusstage

階段:ResponseComplete

回應狀態:

"responseStatus": {
  "metadata": {},
  "code": 200
}

(代碼 200 表示成功)

其他實用欄位 auditIDannotations、「搜尋篩選器」

稽核 ID:0539ea3a-b858-4a43-b516-812fc7e80dbd

註解包含授權詳細資料。

搜尋篩選器: {service_name="apiserver"} |= `"resource":"nodepoolclaims"`

範例記錄

{
  "responseStatus": {
    "metadata": {},
    "code": 200
  },
  "_gdch_cluster": "root-admin",
  "sourceIPs": [
    "10.253.128.74"
  ],
  "annotations": {
    "authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"operator-rolebinding-1.13.2\" of ClusterRole \"anthos-baremetal-operator-1.13.2\" to ServiceAccount \"anthos-cluster-operator-1.13.2/kube-system\"",
    "authorization.k8s.io/decision": "allow"
  },
  "requestReceivedTimestamp": "2022-11-23T23:19:42.690064Z",
  "stageTimestamp": "2022-11-23T23:19:42.695372Z",
  "_gdch_fluentbit_pod": "anthos-audit-logs-forwarder-4hlmv",
  "apiVersion": "audit.k8s.io/v1",
  "level": "Metadata",
  "user": {
    "extra": {
      "authentication.kubernetes.io/pod-name": [
        "anthos-cluster-operator-1.13.2-bc6b7467d-22z88"
      ],
      "authentication.kubernetes.io/pod-uid": [
        "004e1b37-6d4d-4959-b77d-0e69dce5ef4a"
      ]
    },
    "groups": [
      "system:serviceaccounts",
      "system:serviceaccounts:kube-system",
      "system:authenticated"
    ],
    "username": "system:serviceaccount:kube-system:anthos-cluster-operator-1.13.2",
    "uid": "4ebfd4f7-f371-4c40-9f88-ea0709a7039e"
  },
  "stage": "ResponseComplete",
  "requestURI": "/apis/baremetal.cluster.gke.io/v1/namespaces/org-1/nodepoolclaims/admin-control-plane-node-pool/status",
  "kind": "Event",
  "objectRef": {
    "resource": "nodepoolclaims",
    "namespace": "org-1",
    "subresource": "status",
    "name": "admin-control-plane-node-pool",
    "apiVersion": "v1",
    "apiGroup": "baremetal.cluster.gke.io",
    "resourceVersion": "878163",
    "uid": "b2e1bec0-0f7c-4a57-869b-3fcb969ba7e2"
  },
  "verb": "update",
  "userAgent": "operator/v0.0.0 (linux/amd64) kubernetes/$Format",
  "auditID": "0539ea3a-b858-4a43-b516-812fc7e80dbd",
  "_gdch_service_name": "apiserver"
}