Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kubernetes] Add audit logs fields #4081

Merged
merged 9 commits into from
Aug 31, 2022

Conversation

tetianakravchenko
Copy link
Contributor

What does this PR do?

Add some audit log fields, defined in #3664

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

requestObject.spec.* fields:
Screenshot 2022-08-26 at 17 50 16

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
@tetianakravchenko tetianakravchenko requested a review from a team as a code owner August 26, 2022 15:51
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
@elasticmachine
Copy link

elasticmachine commented Aug 26, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-08-31T13:51:45.125+0000

  • Duration: 33 min 40 sec

Test stats 🧪

Test Results
Failed 0
Passed 90
Skipped 0
Total 90

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Aug 26, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (0/0) 💚
Files 100.0% (0/0) 💚 2.809
Classes 100.0% (0/0) 💚 2.809
Methods 94.872% (74/78) 👍 5.486
Lines 100.0% (0/0) 💚 9.072
Conditionals 100.0% (0/0) 💚

@gsantoro
Copy link
Contributor

@tetianakravchenko if you run elastic-package check from the kubernetes package there is small change in the docs to apply

-| kubernetes.job.name | Name of the Job to which the Pod belongs | keyword |  |
+| kubernetes.job.name | The name of the job resource | keyword |  |

I am not sure how it slipped away but do you mind applying it?

@@ -106,6 +106,9 @@
- name: message
type: text
description: A human-readable description of the status of this operation
- name: reason
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While working on other integrations, I found it quite useful to have a sample_event.json that cover as many fields as possible. That made me discover that some fields that were supposed to be there were not documented. I am wondering if it makes sense to do the same here for these extra fields like reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updates sample_event. Though fields of the event depends on the type of action, and fields can vary and not all fields defined in fields folder might be present in single event

Copy link
Contributor

@gizas gizas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So no changes for the following:
`json

  • annotations.authorization_k8s_io/decision | keyword
  • annotations.authorization_k8s_io/reason | text
    `?

@tetianakravchenko
Copy link
Contributor Author

@gizas I've left a comment on it in the issue - #3664 (comment)

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
@tetianakravchenko
Copy link
Contributor Author

@gsantoro

I am not sure how it slipped away but do you mind applying it?

I've run elastic-package check, but I don't see any changes for mentioned field:

 kubernetes % elastic-package-0.60.0 check
Format the package
Done
Lint the package
Done
Build the package
...
Done

@gsantoro
Copy link
Contributor

hey @tetianakravchenko the change I am talking about is at https://github.com/tetianakravchenko/integrations/blob/1e4cf2d769cd7c4d3dff83b89042bd52bac5174b/packages/kubernetes/data_stream/state_job/fields/fields.yml#L8. The field kubernetes.job.name seems to have changed the description but the docs haven't changed yet.

@gsantoro
Copy link
Contributor

Also since the new fields has been added to the sample_event.json I get these test failures now.

FAILURE DETAILS:
kubernetes/audit_logs Verify sample_event.json:
[0] field "kubernetes.audit.responseObject.reason" is undefined
[1] field "kubernetes.audit.responseObject.apiVersion" is undefined
[2] field "kubernetes.audit.responseObject.code" is undefined
[3] field "kubernetes.audit.responseObject.kind" is undefined
[4] field "kubernetes.audit.responseObject.details.kind" is undefined
[5] field "kubernetes.audit.responseObject.details.name" is undefined
[6] field "kubernetes.audit.responseObject.message" is undefined
[7] field "kubernetes.audit.responseObject.status" is undefined
[8] field "kubernetes.audit.requestObject.apiVersion" is undefined
[9] field "kubernetes.audit.requestObject.kind" is undefined
[10] field "kubernetes.audit.requestObject.spec.tolerations" is undefined
[11] field "kubernetes.audit.requestObject.spec.dnsPolicy" is undefined
[12] field "kubernetes.audit.requestObject.spec.enableServiceLinks" is undefined
[13] field "kubernetes.audit.requestObject.spec.volumes" is undefined
[14] field "kubernetes.audit.requestObject.spec.schedulerName" is undefined
[15] field "kubernetes.audit.requestObject.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms" is undefined
[16] field "kubernetes.audit.requestObject.spec.terminationGracePeriodSeconds" is undefined
[17] field "kubernetes.audit.requestObject.spec.serviceAccount" is undefined
[18] field "input.type" is undefined

@imays11
Copy link
Contributor

imays11 commented Aug 30, 2022

@tetianakravchenko below is the sample log you've asked for, I hope it is helpful and thank you for all your work!

{
  "_index": ".ds-logs-kubernetes.audit_logs-default-2022.08.30-000001",
  "_id": "Ztf77YIBbqdQ-MxgS1Gx",
  "_version": 1,
  "_score": 0,
  "_source": {
    "kubernetes": {
      "audit": {
        "auditID": "136c8f56-e41b-4c6e-bd05-6fc3b7948f0e",
        "requestReceivedTimestamp": "2022-08-30T09:00:44.046993Z",
        "objectRef": {
          "apiVersion": "v1",
          "resource": "pods",
          "namespace": "default",
          "name": "addcaps"
        },
        "level": "RequestResponse",
        "kind": "Event",
        "verb": "create",
        "annotations": {
          "authorization_k8s_io/decision": "allow",
          "pod-security_kubernetes_io/enforce-policy": "privileged:latest",
          "authorization_k8s_io/reason": ""
        },
        "userAgent": "kubectl1.25.0/v1.25.0 (linux/amd64) kubernetes/a866cbe",
        "requestURI": "/api/v1/namespaces/default/pods?fieldManager=kubectl-client-side-apply&fieldValidation=Strict",
        "responseStatus": {
          "metadata": {},
          "code": 201
        },
        "stageTimestamp": "2022-08-30T09:00:44.050257Z",
        "sourceIPs": [
          "172.22.0.5"
        ],
        "responseObject": {
          "apiVersion": "v1",
          "kind": "Pod",
          "spec": {
            "dnsPolicy": "ClusterFirst",
            "terminationGracePeriodSeconds": 30,
            "enableServiceLinks": true,
            "serviceAccountName": "default",
            "volumes": [
              {
                "projected": {
                  "sources": [
                    {
                      "serviceAccountToken": {
                        "path": "token",
                        "expirationSeconds": 3607
                      }
                    },
                    {
                      "configMap": {
                        "name": "kube-root-ca.crt",
                        "items": [
                          {
                            "path": "ca.crt",
                            "key": "ca.crt"
                          }
                        ]
                      }
                    },
                    {
                      "downwardAPI": {
                        "items": [
                          {
                            "path": "namespace",
                            "fieldRef": {
                              "apiVersion": "v1",
                              "fieldPath": "metadata.namespace"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "defaultMode": 420
                },
                "name": "kube-api-access-r9wvx"
              }
            ],
            "serviceAccount": "default",
            "securityContext": {},
            "priority": 0,
            "restartPolicy": "Always",
            "preemptionPolicy": "PreemptLowerPriority",
            "tolerations": [
              {
                "effect": "NoExecute",
                "tolerationSeconds": 300,
                "key": "node.kubernetes.io/not-ready",
                "operator": "Exists"
              },
              {
                "effect": "NoExecute",
                "tolerationSeconds": 300,
                "operator": "Exists",
                "key": "node.kubernetes.io/unreachable"
              }
            ],
            "containers": [
              {
                "image": "ollijanatuinen/capsh",
                "imagePullPolicy": "IfNotPresent",
                "terminationMessagePolicy": "File",
                "terminationMessagePath": "/dev/termination-log",
                "name": "addcaps",
                "resources": {},
                "securityContext": {
                  "capabilities": {
                    "add": [
                      "MKNOD",
                      "SYS_ADMIN",
                      "SYS_MODULE",
                      "SYS_RAWIO",
                      "NET_ADMIN",
                      "SYS_CHROOT",
                      "SYS_PTRACE",
                      "NET_RAW",
                      "SYS_BOOT",
                      "SYSLOG",
                      ""
                    ],
                    "drop": [
                      "all"
                    ]
                  }
                },
                "command": [
                  "/bin/sleep",
                  "3650d"
                ],
                "volumeMounts": [
                  {
                    "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
                    "name": "kube-api-access-r9wvx",
                    "readOnly": true
                  }
                ]
              }
            ],
            "schedulerName": "default-scheduler"
          },
          "status": {
            "phase": "Pending",
            "qosClass": "BestEffort"
          }
        },
        "apiVersion": "audit.k8s.io/v1",
        "stage": "ResponseComplete",
        "requestObject": {
          "apiVersion": "v1",
          "kind": "Pod",
          "spec": {
            "dnsPolicy": "ClusterFirst",
            "terminationGracePeriodSeconds": 30,
            "enableServiceLinks": true,
            "containers": [
              {
                "imagePullPolicy": "IfNotPresent",
                "image": "ollijanatuinen/capsh",
                "terminationMessagePolicy": "File",
                "terminationMessagePath": "/dev/termination-log",
                "name": "addcaps",
                "resources": {},
                "securityContext": {
                  "capabilities": {
                    "add": [
                      "MKNOD",
                      "SYS_ADMIN",
                      "SYS_MODULE",
                      "SYS_RAWIO",
                      "NET_ADMIN",
                      "SYS_CHROOT",
                      "SYS_PTRACE",
                      "NET_RAW",
                      "SYS_BOOT",
                      "SYSLOG",
                      ""
                    ],
                    "drop": [
                      "all"
                    ]
                  }
                },
                "command": [
                  "/bin/sleep",
                  "3650d"
                ]
              }
            ],
            "securityContext": {},
            "schedulerName": "default-scheduler",
            "restartPolicy": "Always"
          },
          "status": {}
        },
        "user": {
          "groups": [
            "system:masters",
            "system:authenticated"
          ],
          "username": "system:admin"
        }
      }
    },
    "input": {
      "type": "filestream"
    },
    "agent": {
      "name": "k3d-iam-cluster-server-0",
      "id": "cb23b7be-e85b-4dc8-8816-c8c01dba9299",
      "ephemeral_id": "aa03e393-34f8-4f33-a44e-63bfff120a82",
      "type": "filebeat",
      "version": "8.4.0"
    },
    "@timestamp": "2022-08-30T09:00:45.500Z",
    "ecs": {
      "version": "8.0.0"
    },
    "log": {
      "file": {
        "path": "/var/log/kubernetes/kube-apiserver-audit.log"
      },
      "offset": 10000205
    },
    "data_stream": {
      "namespace": "default",
      "type": "logs",
      "dataset": "kubernetes.audit_logs"
    },
    "elastic_agent": {
      "id": "cb23b7be-e85b-4dc8-8816-c8c01dba9299",
      "version": "8.4.0",
      "snapshot": false
    },
    "host": {
      "hostname": "k3d-iam-cluster-server-0",
      "os": {
        "kernel": "5.10.16.3-microsoft-standard-WSL2",
        "codename": "focal",
        "name": "Ubuntu",
        "family": "debian",
        "type": "linux",
        "version": "20.04.4 LTS (Focal Fossa)",
        "platform": "ubuntu"
      },
      "containerized": true,
      "ip": [
        "10.42.0.0",
        "10.42.0.1",
        "172.22.0.2"
      ],
      "name": "k3d-iam-cluster-server-0",
      "mac": [
        "02:42:ac:16:00:02",
        "62:e7:7f:bd:56:1f",
        "92:be:b1:a3:16:2d",
        "b2:f2:95:2f:e7:af",
        "d6:ff:45:0e:61:53"
      ],
      "architecture": "x86_64"
    },
    "event": {
      "agent_id_status": "verified",
      "ingested": "2022-08-30T09:00:45Z",
      "dataset": "kubernetes.audit_logs"
    }
  },
  "fields": {
    "elastic_agent.version": [
      "8.4.0"
    ],
    "host.os.name.text": [
      "Ubuntu"
    ],
    "kubernetes.audit.requestObject.spec.enableServiceLinks": [
      true
    ],
    "host.hostname": [
      "k3d-iam-cluster-server-0"
    ],
    "host.mac": [
      "02:42:ac:16:00:02",
      "62:e7:7f:bd:56:1f",
      "92:be:b1:a3:16:2d",
      "b2:f2:95:2f:e7:af",
      "d6:ff:45:0e:61:53"
    ],
    "kubernetes.audit.responseObject.kind": [
      "Pod"
    ],
    "kubernetes.audit.responseObject.spec.dnsPolicy": [
      "ClusterFirst"
    ],
    "kubernetes.audit.responseObject.spec.volumes.projected.sources.serviceAccountToken.expirationSeconds": [
      3607
    ],
    "host.os.version": [
      "20.04.4 LTS (Focal Fossa)"
    ],
    "kubernetes.audit.responseObject.spec.tolerations.effect": [
      "NoExecute",
      "NoExecute"
    ],
    "kubernetes.audit.requestObject.apiVersion": [
      "v1"
    ],
    "agent.name": [
      "k3d-iam-cluster-server-0"
    ],
    "event.agent_id_status": [
      "verified"
    ],
    "kubernetes.audit.responseObject.spec.enableServiceLinks": [
      true
    ],
    "kubernetes.audit.responseObject.spec.containers.terminationMessagePolicy": [
      "File"
    ],
    "host.os.type": [
      "linux"
    ],
    "kubernetes.audit.responseObject.spec.priority": [
      0
    ],
    "kubernetes.audit.responseObject.spec.containers.securityContext.capabilities.add": [
      "MKNOD",
      "SYS_ADMIN",
      "SYS_MODULE",
      "SYS_RAWIO",
      "NET_ADMIN",
      "SYS_CHROOT",
      "SYS_PTRACE",
      "NET_RAW",
      "SYS_BOOT",
      "SYSLOG",
      ""
    ],
    "input.type": [
      "filestream"
    ],
    "kubernetes.audit.verb": [
      "create"
    ],
    "kubernetes.audit.requestObject.spec.containers.securityContext.capabilities.add": [
      "MKNOD",
      "SYS_ADMIN",
      "SYS_MODULE",
      "SYS_RAWIO",
      "NET_ADMIN",
      "SYS_CHROOT",
      "SYS_PTRACE",
      "NET_RAW",
      "SYS_BOOT",
      "SYSLOG",
      ""
    ],
    "host.architecture": [
      "x86_64"
    ],
    "kubernetes.audit.requestObject.kind": [
      "Pod"
    ],
    "agent.id": [
      "cb23b7be-e85b-4dc8-8816-c8c01dba9299"
    ],
    "host.containerized": [
      true
    ],
    "kubernetes.audit.responseObject.spec.restartPolicy": [
      "Always"
    ],
    "kubernetes.audit.responseObject.spec.containers.volumeMounts": [
      {
        "name": "kube-api-access-r9wvx",
        "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
        "readOnly": true
      }
    ],
    "kubernetes.audit.responseObject.spec.volumes.name": [
      "kube-api-access-r9wvx"
    ],
    "kubernetes.audit.responseObject.spec.volumes.projected.sources.configMap.items.key": [
      "ca.crt"
    ],
    "kubernetes.audit.responseObject.spec.containers.image": [
      "ollijanatuinen/capsh"
    ],
    "host.ip": [
      "10.42.0.0",
      "10.42.0.1",
      "172.22.0.2"
    ],
    "kubernetes.audit.requestObject.spec.schedulerName": [
      "default-scheduler"
    ],
    "agent.type": [
      "filebeat"
    ],
    "kubernetes.audit.responseObject.apiVersion": [
      "v1"
    ],
    "kubernetes.audit.responseObject.status.phase": [
      "Pending"
    ],
    "kubernetes.audit.stage": [
      "ResponseComplete"
    ],
    "kubernetes.audit.annotations.pod-security_kubernetes_io/enforce-policy": [
      "privileged:latest"
    ],
    "kubernetes.audit.apiVersion": [
      "audit.k8s.io/v1"
    ],
    "elastic_agent.snapshot": [
      false
    ],
    "kubernetes.audit.requestObject.spec.terminationGracePeriodSeconds": [
      30
    ],
    "kubernetes.audit.responseObject.spec.containers.name": [
      "addcaps"
    ],
    "kubernetes.audit.responseObject.spec.volumes.projected.defaultMode": [
      420
    ],
    "kubernetes.audit.responseObject.spec.volumes.projected.sources.downwardAPI.items.path": [
      "namespace"
    ],
    "elastic_agent.id": [
      "cb23b7be-e85b-4dc8-8816-c8c01dba9299"
    ],
    "host.os.codename": [
      "focal"
    ],
    "kubernetes.audit.responseObject.spec.preemptionPolicy": [
      "PreemptLowerPriority"
    ],
    "kubernetes.audit.responseObject.spec.tolerations.operator": [
      "Exists",
      "Exists"
    ],
    "event.ingested": [
      "2022-08-30T09:00:45.000Z"
    ],
    "@timestamp": [
      "2022-08-30T09:00:45.500Z"
    ],
    "kubernetes.audit.requestURI": [
      "/api/v1/namespaces/default/pods?fieldManager=kubectl-client-side-apply&fieldValidation=Strict"
    ],
    "host.os.platform": [
      "ubuntu"
    ],
    "log.file.path": [
      "/var/log/kubernetes/kube-apiserver-audit.log"
    ],
    "data_stream.dataset": [
      "kubernetes.audit_logs"
    ],
    "kubernetes.audit.level": [
      "RequestResponse"
    ],
    "agent.ephemeral_id": [
      "aa03e393-34f8-4f33-a44e-63bfff120a82"
    ],
    "kubernetes.audit.requestObject.spec.restartPolicy": [
      "Always"
    ],
    "kubernetes.audit.requestObject.spec.containers.name": [
      "addcaps"
    ],
    "kubernetes.audit.auditID": [
      "136c8f56-e41b-4c6e-bd05-6fc3b7948f0e"
    ],
    "kubernetes.audit.requestObject.spec.containers.command": [
      "/bin/sleep",
      "3650d"
    ],
    "kubernetes.audit.requestObject.spec.containers.image": [
      "ollijanatuinen/capsh"
    ],
    "kubernetes.audit.responseStatus.code": [
      201
    ],
    "kubernetes.audit.requestReceivedTimestamp": [
      "2022-08-30T09:00:44.046Z"
    ],
    "kubernetes.audit.objectRef.resource": [
      "pods"
    ],
    "kubernetes.audit.requestObject.spec.containers.terminationMessagePolicy": [
      "File"
    ],
    "kubernetes.audit.userAgent": [
      "kubectl1.25.0/v1.25.0 (linux/amd64) kubernetes/a866cbe"
    ],
    "kubernetes.audit.annotations.authorization_k8s_io/reason": [
      ""
    ],
    "host.os.name": [
      "Ubuntu"
    ],
    "host.name": [
      "k3d-iam-cluster-server-0"
    ],
    "kubernetes.audit.requestObject.spec.containers.securityContext.capabilities.drop": [
      "all"
    ],
    "kubernetes.audit.responseObject.spec.containers.securityContext.capabilities.drop": [
      "all"
    ],
    "kubernetes.audit.user.groups": [
      "system:masters",
      "system:authenticated"
    ],
    "kubernetes.audit.annotations.authorization_k8s_io/decision": [
      "allow"
    ],
    "kubernetes.audit.objectRef.namespace": [
      "default"
    ],
    "kubernetes.audit.responseObject.spec.containers.command": [
      "/bin/sleep",
      "3650d"
    ],
    "kubernetes.audit.sourceIPs": [
      "172.22.0.5"
    ],
    "log.offset": [
      10000205
    ],
    "kubernetes.audit.requestObject.spec.dnsPolicy": [
      "ClusterFirst"
    ],
    "data_stream.type": [
      "logs"
    ],
    "kubernetes.audit.responseObject.spec.schedulerName": [
      "default-scheduler"
    ],
    "ecs.version": [
      "8.0.0"
    ],
    "kubernetes.audit.responseObject.spec.serviceAccount": [
      "default"
    ],
    "agent.version": [
      "8.4.0"
    ],
    "host.os.family": [
      "debian"
    ],
    "kubernetes.audit.responseObject.spec.volumes.projected.sources.downwardAPI.items.fieldRef.fieldPath": [
      "metadata.namespace"
    ],
    "kubernetes.audit.kind": [
      "Event"
    ],
    "kubernetes.audit.user.username": [
      "system:admin"
    ],
    "kubernetes.audit.responseObject.status.qosClass": [
      "BestEffort"
    ],
    "kubernetes.audit.objectRef.name": [
      "addcaps"
    ],
    "kubernetes.audit.requestObject.spec.containers.terminationMessagePath": [
      "/dev/termination-log"
    ],
    "kubernetes.audit.responseObject.spec.terminationGracePeriodSeconds": [
      30
    ],
    "kubernetes.audit.responseObject.spec.containers.terminationMessagePath": [
      "/dev/termination-log"
    ],
    "host.os.kernel": [
      "5.10.16.3-microsoft-standard-WSL2"
    ],
    "kubernetes.audit.stageTimestamp": [
      "2022-08-30T09:00:44.050Z"
    ],
    "kubernetes.audit.responseObject.spec.volumes.projected.sources.serviceAccountToken.path": [
      "token"
    ],
    "kubernetes.audit.requestObject.spec.containers.imagePullPolicy": [
      "IfNotPresent"
    ],
    "data_stream.namespace": [
      "default"
    ],
    "kubernetes.audit.responseObject.spec.volumes.projected.sources.configMap.name": [
      "kube-root-ca.crt"
    ],
    "kubernetes.audit.responseObject.spec.tolerations.key": [
      "node.kubernetes.io/not-ready",
      "node.kubernetes.io/unreachable"
    ],
    "kubernetes.audit.responseObject.spec.volumes.projected.sources.configMap.items.path": [
      "ca.crt"
    ],
    "kubernetes.audit.responseObject.spec.containers.imagePullPolicy": [
      "IfNotPresent"
    ],
    "kubernetes.audit.responseObject.spec.tolerations.tolerationSeconds": [
      300,
      300
    ],
    "kubernetes.audit.objectRef.apiVersion": [
      "v1"
    ],
    "kubernetes.audit.responseObject.spec.volumes.projected.sources.downwardAPI.items.fieldRef.apiVersion": [
      "v1"
    ],
    "event.dataset": [
      "kubernetes.audit_logs"
    ],
    "kubernetes.audit.responseObject.spec.serviceAccountName": [
      "default"
    ]
  }
}

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
@gsantoro
Copy link
Contributor

Also since the new fields has been added to the sample_event.json I get these test failures now.

FAILURE DETAILS:
kubernetes/audit_logs Verify sample_event.json:
[0] field "kubernetes.audit.responseObject.reason" is undefined
[1] field "kubernetes.audit.responseObject.apiVersion" is undefined
[2] field "kubernetes.audit.responseObject.code" is undefined
[3] field "kubernetes.audit.responseObject.kind" is undefined
[4] field "kubernetes.audit.responseObject.details.kind" is undefined
[5] field "kubernetes.audit.responseObject.details.name" is undefined
[6] field "kubernetes.audit.responseObject.message" is undefined
[7] field "kubernetes.audit.responseObject.status" is undefined
[8] field "kubernetes.audit.requestObject.apiVersion" is undefined
[9] field "kubernetes.audit.requestObject.kind" is undefined
[10] field "kubernetes.audit.requestObject.spec.tolerations" is undefined
[11] field "kubernetes.audit.requestObject.spec.dnsPolicy" is undefined
[12] field "kubernetes.audit.requestObject.spec.enableServiceLinks" is undefined
[13] field "kubernetes.audit.requestObject.spec.volumes" is undefined
[14] field "kubernetes.audit.requestObject.spec.schedulerName" is undefined
[15] field "kubernetes.audit.requestObject.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms" is undefined
[16] field "kubernetes.audit.requestObject.spec.terminationGracePeriodSeconds" is undefined
[17] field "kubernetes.audit.requestObject.spec.serviceAccount" is undefined
[18] field "input.type" is undefined

I can see this has been resolved. I'm adding this comment for future reference.

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
- name: procMount
type: keyword
- name: capabilities.add
type: keyword
Copy link
Contributor Author

@tetianakravchenko tetianakravchenko Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example of the document:

"securityContext": {
                    "capabilities": {
                      "add": [
                        "MKNOD",
                        "SYS_ADMIN",
                        "SYS_MODULE",
                        "SYS_RAWIO",
                        "NET_ADMIN",
                        "SYS_CHROOT",
                        "SYS_PTRACE",
                        "NET_RAW",
                        "SYS_BOOT",
                        "SYSLOG",
                        ""
                      ],
                      "drop": [
                        "all"
                      ]
                    }
                  },

there is no need to define it as an array, because in ElasticSearch every field is already an array, doc: https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html#types-array-handling
Any field can contain zero or more values by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants