본문으로 건너뛰기

Docker Container Logs Integration

Overview

Docker containers generate application and runtime logs essential for security monitoring. KYRA MDR collects Docker container logs via the syslog logging driver or Fluentd for centralized security analysis. Supports Docker Engine 20.x and later.

Prerequisites

  • A KYRA MDR Collector installed and running
  • Docker Engine installed on the host
  • Root or docker group access on the Docker host
  • Network connectivity from Docker host to the collector on port 514

Configuration

Configure Docker to send container logs via syslog:

  1. Edit /etc/docker/daemon.json:
{
"log-driver": "syslog",
"log-opts": {
"syslog-address": "tcp://<collector-ip>:514",
"syslog-facility": "local0",
"tag": "{{.Name}}/{{.ID}}"
}
}
  1. Restart Docker:
Terminal window
sudo systemctl restart docker

Per-container logging:

Terminal window
docker run --log-driver=syslog \
--log-opt syslog-address=tcp://<collector-ip>:514 \
--log-opt tag="{{.Name}}" <image>

Collected Log Types

Log TypeDescriptionSecurity Use
Container StdoutApplication standard outputApplication monitoring
Container StderrApplication errorsError detection, debugging
Docker EventsContainer lifecycle eventsContainer security monitoring
Health ChecksContainer health statusService availability
Security EventsSeccomp and AppArmor eventsContainer runtime security
Network EventsContainer networking eventsNetwork security analysis

Troubleshooting

No container logs: Verify the syslog driver is configured in daemon.json. Check docker info to confirm the logging driver.

Existing containers unaffected: Changing the daemon configuration only affects new containers. Recreate existing containers.

Log format: Use the tag option to include the container name for proper identification.

Contact kyra@seekerslab.com for support.