|
| 1 | +[[cloud-nat-sec-kubernetes-dashboard]] |
| 2 | +// Note: This page is intentionally duplicated by docs/dashboards/kubernetes-dashboard.asciidoc. When you update this page, update that page to match. And careful with the anchor links because they should not match. |
| 3 | + |
| 4 | +== Kubernetes dashboard |
| 5 | + |
| 6 | +The Kubernetes dashboard provides insight into Linux process data from your Kubernetes clusters. It shows sessions in detail and in the context of your monitored infrastructure. |
| 7 | + |
| 8 | +image::images/kubernetes-dashboard.png[The Kubernetes dashboard, with numbered labels 1 through 3 for major sections] |
| 9 | +The numbered sections are described below: |
| 10 | + |
| 11 | + 1. The charts at the top of the dashboard provide an overview of your monitored Kubernetes infrastructure. You can hide them by clicking *Hide charts*. |
| 12 | + 2. The tree navigation menu allows you to navigate through your deployments and select the scope of the sessions table to the right. You can select any item in the menu to show its sessions. In Logical view, the menu is organized by Cluster, Namespace, Pod, and Container image. In Infrastructure view, it is organized by Cluster, Node, Pod, and Container image. |
| 13 | + 3. The sessions table displays sessions collected from the selected element of your Kubernetes infrastructure. You can view it in fullscreen by selecting the button in the table's upper right corner. You can sort the table by any of its fields. |
| 14 | + |
| 15 | +You can filter the data using the KQL search bar and date picker at the top of the page. |
| 16 | + |
| 17 | +From the sessions table's Actions column, you can take the following investigative actions: |
| 18 | + |
| 19 | +- View details |
| 20 | +- <<timelines-ui,Open in Timeline>> |
| 21 | +- <<alerts-run-osquery, Run Osquery>> |
| 22 | +- <<visual-event-analyzer, Analyze event>> |
| 23 | +- <<session-view, Open Session View>> |
| 24 | + |
| 25 | +Session View displays Kubernetes metadata under the *Metadata* tab of the Detail panel: |
| 26 | + |
| 27 | +image::images/metadata-tab.png[The Detail panel's metadata tab] |
| 28 | + |
| 29 | +The *Metadata* tab is organized into these expandable sections: |
| 30 | + |
| 31 | +- *Metadata:* `hostname`, `id`, `ip`, `mac`, `name`, Host OS information |
| 32 | +- *Cloud:* `instance.name`, `provider`, `region`, `account.id`, `project.id` |
| 33 | +- *Container:* `id`, `name`, `image.name`, `image.tag`, `image.hash.all` |
| 34 | +- *Orchestrator:* `resource.ip`, `resource.name`, `resource.type`, `namespace`, `cluster.id`, `cluster.name`, `parent.type` |
| 35 | + |
| 36 | + |
| 37 | +[discrete] |
| 38 | +[[cloud-nat-sec-k8s-dash-setup]] |
| 39 | +== Setup |
| 40 | +To collect session data for the dashboard, you'll deploy a Kubernetes DaemonSet to your clusters that implements the {elastic-defend} integration. |
| 41 | + |
| 42 | +**Prerequisites**: |
| 43 | + |
| 44 | +- This feature requires Elastic Stack version 8.4 or newer. |
| 45 | +- You need an active {fleet-guide}/fleet-overview.html[{fleet} Server]. |
| 46 | +- Your Elastic deployment must have the {elastic-defend} integration <<install-endpoint,enabled>>. |
| 47 | +- The {elastic-defend} integration policy must have **Include session data** set to `true`. To modify this setting, go to **Manage -> Policies**, select your policy, and find `Include session data` near the bottom of the `Policy settings` tab. |
| 48 | + |
| 49 | +**Support matrix**: This feature is currently available on GKE and EKS using Linux hosts and Kubernetes versions that match the following specifications: |
| 50 | +|===================== |
| 51 | +| | **Kubernetes versions** | **Node OSes** |
| 52 | +|**EKS**| 1.18; 1.19; 1.20; 1.21 | Amazon Linux 2, Bottlerocket OS |
| 53 | +|**GKE**| Regular (default channel): 1.21 and 1.22; Stable: 1.20 and 1.21; Rapid: 1.22 and 1.23 | Container-optimized OS (COS), Ubuntu |
| 54 | +|===================== |
| 55 | + |
| 56 | +[discrete] |
| 57 | +=== Download and modify the DaemonSet manifest |
| 58 | +The DaemonSet integrates {elastic-endpoint} into your Kubernetes cluster. The {agent} is enrolled to a running {fleet-server} using the `FLEET_URL` parameter, and connected to a specific {agent} policy using the `FLEET_ENROLLMENT_TOKEN`. |
| 59 | + |
| 60 | +You first need to download the DaemonSet manifest `.yaml`, then modify it to include your {fleet} URL and Enrollment Token before you deploy it to the clusters you want to monitor. |
| 61 | + |
| 62 | +. Download the DaemonSet manifest using this command: |
| 63 | ++ |
| 64 | +[source,console] |
| 65 | +---- |
| 66 | +curl -L -O https://raw.githubusercontent.com/elastic/endpoint/main/releases/8.5.0/kubernetes/deploy/elastic-defend.yaml |
| 67 | +---- |
| 68 | + |
| 69 | +. Fill in the manifest's `FLEET_URL` field with your {fleet} server's `Host URL`. To find it, go to **{kib} -> Management -> {fleet} -> Settings**. For more information, refer to {fleet-guide}/fleet-settings.html[Fleet UI settings]. |
| 70 | +. Fill in the manifest's `FLEET_ENROLLMENT_TOKEN` field with a Fleet enrollment token. To find one, go to **{kib} -> Management -> {fleet} -> Enrollment tokens**. For more information, refer to {fleet-guide}/fleet-enrollment-tokens.html[Fleet enrollment tokens]. |
| 71 | + |
| 72 | + |
| 73 | +[discrete] |
| 74 | +=== Apply the modified manifest to your cluster or clusters |
| 75 | + |
| 76 | +To ensure you install {elastic-endpoint} on the desired Kubernetes cluster(s), set the default context using command: `kubectl config use-context <name-of-context>`. |
| 77 | +To check which contexts exist, use `kubectl config get-contexts` to list them from your local kubectl config file. An asterisk indicates the current default context. |
| 78 | + |
| 79 | +You can repeat the following steps for multiple contexts. |
| 80 | + |
| 81 | +**Example:** |
| 82 | + |
| 83 | +- Apply the manifest to a cluster: `kubectl apply -f elastic-endpoint-security.yaml` |
| 84 | +- Check the DaemonSet’s status: `kubectl get pods -A` |
| 85 | + |
| 86 | +Once the DaemonSet is running, Elastic Endpoint will start sending Linux session data from Kubernetes to {kib}. You can then view that data from the Kubernetes dashboard. |
| 87 | + |
| 88 | + |
| 89 | +IMPORTANT: This dashboard uses data from the `logs-*` index pattern, which is included by default in the <<advanced-settings,`securitySolution:defaultIndex` advanced setting>>. To collect data from multiple {es} clusters (as in a cross-cluster deployment), update `logs-*` to `*:logs-*`. |
0 commit comments