What are Kubernetes audit logs?


Audit logs record requests to the Kubernetes API. Because the API server processes all changes to Kubernetes state—and serves as the gatekeeper to the backend database that stores this state—the API server is an ideal point for capturing all changes that occur within a cluster. The API server processes requests from various internal and external components, including:

  • The control plane (built-in controllers, the scheduler)
  • Node daemons (the kubelet, kube-proxy, and others)
  • Cluster services (e.g., the cluster autoscaler, kube-state-metrics, CoreDNS, etc.)
  • Users making kubectl requests
  • Applications, controllers, and operators that send requests through a kube client
  • Even the API server itself

Audit logs help keep tabs on all of this complexity by recording which users or services requested access to cluster resources—and why the API server authorized or rejected those requests.

Audit logs are structured in JSON. Each log contains rich metadata in the form of key attributes like the HTTP method, the URL path requested, and the user who sent the request. For instance, you can inspect these attributes to obtain more information about an unusual request, or use a monitoring service to analyze API traffic to detect trends or identify possible threats.

Why should you monitor Kubernetes audit logs?


Although Kubernetes audit logs are not enabled by default, we recommend leveraging this feature to debug issues in your cluster. Kubernetes events are key to understanding the behavior of a cluster. By default events are stored in the Kubernetes backend database, etcd, with only one hour of retention. Audit logs allow you to capture events, create/read/update/delete actions, and even the heartbeats sent from the nodes to the API server.

By persisting audit logs to longer term storage, it’s possible to go back in time and answer questions such as, “Why was this pod evicted?” and “What lifecycle operations occur when we update a deployment?”

You can also set up automated alerts to keep tabs on any unexpected activity in your Kubernetes audit logs, such as create/update/patch/delete requests during an operational freeze period. Below, we’ll walk through some examples of using audit logs to monitor:

  • Authentication issues
  • Slow API requests

Kubernetes 审计日志


您所知,Kubernetes 有一个控制平面来管理整个集群生命周期,这个控制平面由多个组件组成。在我看来,Kubernetes API Server 是其中最关键的组件。基本上,我们认为 Kubernetes API Server 是集群的大脑。所以有时我们想知道大脑内部发生了什么。

Kubernetes APIServer安全 审计日志相关推荐

  1. Kubernetes审计日志方案

    前言 当前Kubernetes(K8S)已经成为事实上的容器编排标准,大家关注的重点也不再是最新发布的功能.稳定性提升等,正如Kubernetes项目创始人和维护者谈到,Kubernetes已经不再是 ...

  2. KubernetesAPI审计日志方案

    KubernetesAPI审计日志方案 当前Kubernetes(K8S)已经成为事实上的容器编排标准,大家关注的重点也不再是最新发布的功能.稳定性提升等,正如Kubernetes项目创始人和维护者谈 ...

  3. Kubernetes 审计日志

    启用审计日志功能:参考文档 审计 | Kubernetes vi /etc/kubernetes/manifests/kube-apiserver.yaml - - --audit-policy-fi ...

  4. OpenShift 4 - 集群节点日志和API审计日志策略

    <OpenShift / RHEL / DevSecOps 汇总目录> 说明:本文已经在OpenShift 4.8 环境中验证 文章目录 集群节点日志 集群节点日志类型 收集集群节点日志 ...

  5. Kubernetes 稳定性保障手册 -- 日志专题

    作者 | 悟鹏.沉醉 来源 | 阿里巴巴云原生公众号 <Kubernetes 稳定性保障手册>系列文章: Kubernetes 稳定性保障手册 – 极简版 Kubernetes 稳定性保障 ...

  6. java audit模块实现_Apollo 源码解析 —— Config Service 操作审计日志 Audit

    > 摘要: 原创出处 http://www.iocoder.cn/Apollo/config-service-audit/ 「芋道源码」欢迎转载,保留摘要,谢谢! 1. 概述 本文分享 Conf ...

  7. 审计文件的作用以及记录的内容,审计日志的记录,以及审计日志包括的内容

    对DBA(数据库管理员)而言,审计就是记录数据库中正在作什么的过程. 审计文件的作用 审计功能把用户对数据库的所有操作自动记录下来,放入审计日志中,审计员可以利用审计日志监控数据库中的各种行为,重现导 ...

  8. 审计日志删除 oracle,oracle audit,怎么审计ORACLE日志

    Oracle 的审计实在是鸡肋,审计日志增加猛速,而且加大系统负荷,降低系统性能. 依我们在生产系统的作法就是禁用审计,禁用后清除审计日志. 处理方法: 1.查看审计功能是否开启sqlplus &qu ...

  9. Kubernetes APIServer机制概述

    断断续续研究Kubernetes代码已经大半年时间了,一直在看APIServer相关的代码,因为API是一个系统的入口,是所有功能对外的抽象体现,同时也是其他组件都依赖的一个组件,处于非常核心的地位, ...

最新文章

  1. 4个实验,彻底搞懂TCP连接的断开
  2. html怎么设置取当前日期格式,js获取当前日期,格式为YYYY-MM-DD
  3. Web开发者必备的12款超赞jQuery插件
  4. zynq 文件系统中加载PL fpga.bit笔记
  5. PyCharm 安装详细图片(linux)版
  6. activex for chrome扩展程序 下载”_提升前端开发效率:你应该知道的10个Chrome扩展程序...
  7. hdu 1228 A + B
  8. Linux 目录所属组设置,Linux系统用户与组管理命令及配置文件总结
  9. 2021年浙江省高考成绩查询时间,2021年浙江高考成绩什么时候出来 时间
  10. gcc g++ 支持c++11编译的标准和区别
  11. Linux命令----cat
  12. Spring中IOC容器概念
  13. 电脑有独显内存还被占用_什么是电脑显卡,显卡是按什么来分类的
  14. [APK签名] .pk8、.x509.pem转化为.keystore签名
  15. R语言使用mean函数计算dataframe指定数据列的均值
  16. MyCms 活码二维码(动态二维码)源码版介绍
  17. 【笔记】项目工作中总结(三)
  18. 1.13.Mark1
  19. 大学英语六级超全复习资料
  20. Java字节码角度分析多态原理 ——提升硬实力8

热门文章

  1. 霸王的大陆3.29版java_你能接受Java 9的下一个版本是Java 18.3吗?
  2. [14-2] JAVA文件操作实训之模拟记事本Notepad
  3. php_bz2作用,Linux中bzip2命令起什么作用呢?
  4. 使用EasyNVR、easy-player-element.js在web端实现视频直播
  5. Armv8/Armv9 MMU学习的28问
  6. 利用iperf工具测试IPv6网络
  7. 光模块发射光功率的重要性
  8. 成人网站性能提升20倍之经验谈
  9. GitHub的私有(Private)项目添加合作者(collaborator)
  10. myeclipse建java项目_myeclipse如何创建并运行java项目