Managed Kubernetes Service (MKS)

Log audit di Google Distributed Cloud (GDC) dengan air gap mencatat aktivitas pembuatan, pembacaan, pembaruan, dan penghapusan (CRUD) di seluruh cluster Kubernetes Anda. Dokumen ini mencantumkan operasi yang dilacak, kolom payload, dan contoh entri untuk resource kustom NodePoolClaim, AddressPoolClaim, SubnetClaim, CIDRClaim, dan NodePool.

Operasi CRUD

Operasi CRUD meliputi:

  • Data NodePoolClaim
  • Data AddressPoolClaim
  • Data SubnetClaim
  • Data CIDRClaim
  • Data cluster
  • Data NodePool
  • Data Cluster MKS

Tabel berikut berisi contoh untuk data NodePoolClaim (operasi CRUD):

Kolom dalam entri log yang berisi informasi audit
Metadata audit Nama kolom audit Nilai
Identitas pengguna atau layanan user

Pengguna yang melakukan tindakan:

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

Cuplikan objek lengkap:

"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"
     ]
  }
}

Target

(Objek KRM yang ditindaklanjuti)

objectRef/requestURI

Referensi objek tertentu:

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

URI Permintaan:

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

Tindakan

(Operasi CRUD yang dilakukan)

verb

Operasi yang dilakukan: update

(Nilai lain yang mungkin: get, create, apply, patch, delete, list, watch)

Stempel waktu peristiwa requestReceivedTimestamp

2022-11-23T23:19:42.690064Z

Sumber tindakan _gdch_cluster, sourceIPs

Cluster: root-admin

Alamat IP sumber: ["10.253.128.74"]

Hasil responseStatus, stage

Tahap: ResponseComplete

Status Respons:

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

(Kode 200 menunjukkan keberhasilan)

Kolom berguna lainnya auditID, annotations, Filter Penelusuran

ID Audit: 0539ea3a-b858-4a43-b516-812fc7e80dbd

Anotasi menyertakan detail otorisasi.

Filter Penelusuran: {service_name="apiserver"} |= `"resource":"nodepoolclaims"`

Contoh log

{
  "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"
}