Record blocked hosts in trial output when using a network allowlist

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
49/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start by tracing how Harbor configures the gost egress sidecar and saves per-trial outputs; the issue does not name those files or tests. Check how the sidecar can expose blocked host and port details with the active agent or verifier phase, then how trial output and result.json are written. Done means blocked connections are saved per trial and per-phase counts appear in result.json; verify both phases, including an empty summary.

Written by the indexing model from the issue text.

Description

When a task runs with a network allowlist (network_mode = "allowlist"), Harbor's egress sidecar (gost) blocks disallowed hosts, but trial outputs never record which hosts were blocked. Please capture blocked hosts per trial so task authors don't have to guess from tool errors in agent transcripts or verifier logs.

gost already logs the host at debug level (for example, {"msg":"bypass: github.com:443","dst":"github.com:443","sid":"..."}), whereas the default level only emits {"level":"error","msg":"bypass","sid":"..."} and sidecar logs aren't saved with the trial.

  • Record blocked connections with their host in the egress sidecar (for example, by raising gost's log level or adding a bypass log) and tag each entry with the active phase (agent or verifier).
  • Save the blocked connections with the trial output, such as <trial>/network/blocked.jsonl with time, phase, host, and port.
  • Include a per-phase summary in result.json (for example, network: {agent: {blocked: {"github.com": 3}}, verifier: {blocked: {}}}) so viewers and tooling can surface blocks without parsing logs.

This makes missing allowlist entries immediately visible. In a 15-task sweep under an allowlist, two failures—a verifier git clone and a hung Gradle build—took manual log digging to trace back to blocked hosts.

Tested with Harbor 0.24.0 and gost 3.2.7-nightly.20260602. Note that the debug log line above came from gost's HTTP handler; the sidecar uses the red handler with sniffing, which should log the sniffed host similarly, though we haven't confirmed it.

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.