The invention relates to the technical field of
software development, in particular to a kubernetes-based Pod terminal behavior auditing method and
system. Comprising the following steps: S1, establishing a terminal login request to connect a target Pod at a local
client; s2, acquiring a node for operating the target Pod and an address and a port of the Kubelet through a Kube-Apiserver service; the method comprises the following steps: S1, a Kube-Apiserver service is established, S2, a Kube-Apiserver service is established, S3, when a request of the Kube-Apiserver service is forwarded to a container for operation through Kubeet, S4, a
websocket connection is established between a target Pod and a
client, and an audit-content service is established, S5, an audit-content-
sync service is established, the audit-content-
sync service consumes a message in a kafka
message queue and a message pushed by the audit-content service, the messages are synchronously written into a
database, and through
cooperative work of the audit-content service and the audit-content-
sync service, the information in the Kube-Apiserver service is forwarded to the container for operation. According to the invention, the interaction information between the
client and the target Pod can be completely recorded, and the operation executed by the user
logging in the Pod terminal in the container cloud cluster can be audited.