compose.scheduler.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. services:
  2. scheduler:
  3. image: irdb-scheduler:latest
  4. build: { context: ./scheduler }
  5. environment:
  6. INTERNAL_JOB_TOKEN: ${INTERNAL_JOB_TOKEN}
  7. # SEC_REVIEW F22: dependencies (curl, tini, ca-certificates) are now
  8. # baked into the image at build time with pinned versions, against a
  9. # digest-pinned alpine base. The previous `image: alpine:3` +
  10. # `apk add` at container start trusted the apk mirror on every
  11. # restart and would have given a mirror compromise a foothold in the
  12. # container that holds INTERNAL_JOB_TOKEN.
  13. read_only: true
  14. # busybox crond writes a tiny tempfile when the schedule fires; /run
  15. # has to be writable for that. Everything else stays read-only.
  16. tmpfs:
  17. - /run:mode=0755
  18. - /tmp:mode=1777
  19. # busybox crond calls initgroups() before each exec, which needs
  20. # CAP_SETGID even when the target user is the same root it is
  21. # already running as — full cap_drop crashes it with
  22. # "can't set groups: Operation not permitted". Hardening the
  23. # process to non-root would mean shipping a custom cron binary;
  24. # not worth the maintenance cost given the container has no
  25. # persistent volume, no exposed port, and only INTERNAL_JOB_TOKEN
  26. # in env. `no-new-privileges` is still useful: there is no setuid
  27. # binary in the image and we want to keep it that way.
  28. security_opt:
  29. - no-new-privileges:true
  30. depends_on:
  31. api:
  32. condition: service_healthy
  33. restart: unless-stopped