Egress control fails open at trial start under Podman: the second `compose up` recreates the sidecar

Open
#4,508 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@yuyz-cyber is already working on this.

Since Nov 28, 2026.

  • #4512 by @yuyz-cyber — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
docker, linux, python

Research direction

Locate the start() sequence and _wait_until_egress_sidecar_ready() helper that manage the egress sidecar when supports_compose_wait is false. Add the readiness wait after the second compose up so the main service cannot start before the sidecar applies its rules. Verify with the described Podman trial: the external probe must be blocked from t=0, and confirm the sidecar is not recreated during the second up.

Written by the indexing model from the issue text.

Description

Harbor 0.27.0, -e podman, rootless Podman 4.9.3 (Ubuntu 24.04), compose provider podman compose -> docker-compose 2.40.3.

With supports_compose_wait=False, start() brings up the egress sidecar alone, waits for its ready file, then runs a second up --detach for all services. In our runs that second up recreates the sidecar, and the main container starts before the new sidecar has applied its nftables rules. Nothing waits for the ready file again, and the main service depends on the sidecar with condition: service_started only.

podman events for one no-network trial:

15:57:01.633 start   ...-egress-control-sidecar-1
15:57:05.203 create  c93b5c28e301_...-egress-control-sidecar-1   (old container renamed)
15:57:05.268 died    ...-egress-control-sidecar-1
15:57:05.835 start   ...-egress-control-sidecar-1                (new container)
15:57:05.893 start   ...-main-1                                  (58 ms later)

The task's solution curls an external host once per second from t=0: t=0 returns HTTP 200, t>=1 s is blocked.

Calling _wait_until_egress_sidecar_ready() again after the second up when supports_compose_wait is False closes the window for us: every probe is blocked from t=0. The start() sequence is the same on main (cf4bd004).

Dominant language
Python
Stars
5.6k
Forks
1.9k
Avg merge
1d 17h
Merged PRs (30d)
156

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from harbor-framework/harbor

All issues in harbor-framework/harbor

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.