HUB
Sign inSign up

atomicorp/ossec-docker

By atomicorp

•Updated 6 days ago

OSSEC HIDS 4.5 manager on Rocky 10 with ossec-rules CRS (UDP/1514, authd TCP/1515)

Image
27

1M+

atomicorp/ossec-docker repository overview

⁠OSSEC Docker

Docker image for the OSSEC⁠ HIDS manager (server). Rocky Linux 10, OSSEC 4.5.0 from the Atomicorp⁠ ossec-hids-server RPM.

Image: atomicorp/ossec-docker⁠
Source: https://github.com/ossec/ossec-docker⁠

⁠Quick start

docker volume create ossec-data

docker run -d \
  --name ossec-server \
  -p 1514:1514/udp \
  -p 1515:1515/tcp \
  -v ossec-data:/var/ossec/data \
  atomicorp/ossec-docker

Or:

docker compose up -d
docker exec -it ossec-server /var/ossec/bin/ossec-control status
docker exec -it ossec-server tail -f /var/ossec/logs/ossec.log
PortProtocolPurpose
1514UDPAgent events (ossec-remoted)
1515TCPAgent enrollment (ossec-authd)

Persistent data lives on the volume at /var/ossec/data (etc, logs, stats, queue).

⁠Add agents

Point agents at the manager host on UDP/1514. Enrollment is on by default via authd (TCP/1515). Inside the container you can also manage keys manually:

docker exec -it ossec-server /var/ossec/bin/manage_agents

Disable authd if you only want pre-shared keys:

docker run -d \
  --name ossec-server \
  -p 1514:1514/udp \
  -e AUTO_ENROLLMENT_ENABLED=false \
  -v ossec-data:/var/ossec/data \
  atomicorp/ossec-docker
VariableDefaultMeaning
AUTO_ENROLLMENT_ENABLEDtrueStart ossec-authd on port 1515
AUTHD_OPTIONS(empty)Extra arguments for ossec-authd

⁠Custom configuration

Mount ossec.conf onto the data volume path (not /var/ossec/etc, which is a symlink). The entrypoint fills in any missing files under etc/ (rules.d, decoders.d, internal_options.conf, …) and leaves your config alone:

docker run -d \
  --name ossec-server \
  -p 1514:1514/udp \
  -p 1515:1515/tcp \
  -v ossec-data:/var/ossec/data \
  -v "$PWD/ossec.conf:/var/ossec/data/etc/ossec.conf:ro" \
  atomicorp/ossec-docker
⁠Rules and decoders

The image ships the ossec/ossec-rules⁠ community CRS bundle (v4.0 by default) into:

  • /var/ossec/data/etc/rules.d
  • /var/ossec/data/etc/decoders.d
  • /var/ossec/data/etc/shared (rootcheck / CIS lists)

Drop site rules as extra .xml files under rules.d (use a 99- prefix so they load after the CRS pack) and restart. Pin another rules release at build time with --build-arg OSSEC_RULES_VERSION=v4.0.

⁠Day-to-day

docker stop ossec-server
docker start ossec-server
docker exec -it ossec-server bash
PathContents
/var/ossec/data/etcossec.conf, keys, SSL certs, rules.d, decoders.d
/var/ossec/data/logsossec.log, alerts, archives
/var/ossec/data/statsAnalysisd statistics
/var/ossec/data/queueRuntime queues (including FIM queue/diff)

Alert mail goes through a local Postfix in the container. Point <smtp_server> in ossec.conf at a real MTA if you need delivery outside the container.

⁠Build

docker build \
  --build-arg OSSEC_VERSION=4.5.0 \
  --build-arg OSSEC_RULES_VERSION=v4.0 \
  -t ossec-docker:local .
ArgumentDefaultMeaning
OSSEC_VERSION4.5.0ossec-hids-server RPM version
OSSEC_RULES_VERSIONv4.0ossec-rules⁠ git tag

⁠Troubleshooting

SymptomFix
Missing decoder.xml / rules fail after mounting a configMount at /var/ossec/data/etc/ossec.conf; use a current image so etc/ is seeded
queue/diff / report_changes errorsCurrent image resets queue/diff to root:ossec mode 1770 on start
ossec-authd: SSL ErrorUsually a client/probe handshake issue; check agent-auth usage
No alert mailConfigure an external <smtp_server> or disable mail notifications

Thanks to Dan Parriott and Xetus OSS⁠ for the original container design.

Tag summary
Recent tags
Content type
Image
Digest
sha256:56d17d289…
Size
103.8 MB
Last updated
6 days ago
docker pull atomicorp/ossec-docker:latest