Skip to content

feat(agent): the egress proxy logs the address it connected to, or refused - #535

Merged
samuelmbabhazi merged 2 commits into
mainfrom
feat/egress-log-address
Nov 27, 2026
Merged

samuelmbabhazi merged 2 commits into
mainfrom
feat/egress-log-address

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

The egress proxy (ADR 0023) now logs the address behind each outcome. This was suggested in a comment on the dev.to article about the registry and loopback.

What changed

  • egress tunnel gains address: the address the socket connected to, exactly as the dialer's guard checked it. It is never resolved again.
  • egress refused gains addresses, the addresses the refusal was about:
    • for not_public, the ones that are not public (for a name with one private answer among public ones, only that one);
    • for unreachable, the ones that did not answer;
    • for unresolved, an empty list.
  • SPEC (node egress policy) says what the journal holds.

What did not change

What the proxy allows or refuses is the same:

  • a name with any non-public answer is still refused before any dial;
  • the dialer still checks the address it connects to;
  • each address still gets its share of the time left.

The existing refusal tests pass unchanged. Headers, paths and Proxy-Authorization are still never logged (same test).

How it was tested

  • TestLogsHostsAddressesAndOutcomesOnly checks the exact lines:
    • a tunnel names 8.8.8.8:443;
    • a private name names 10.0.0.5:443;
    • a mixed name names only 169.254.169.254:443;
    • a silent public address gives unreachable with 9.9.9.9:443;
    • the request's credentials, path and query never appear.
  • go test -race ./agent/internal/egress/, go test ./agent/... and golangci-lint are clean.

Security considerations

Addresses go to the server's own journal (journalctl -u shipkeep-egress), next to the host name that was already logged. Nothing else is added.

…fused

A tunnel's line names the address the socket connected to, as the guard checked it; a refusal names the addresses it was about (not public, or not answering). A name that resolves somewhere it should not then leaves its address in the server's journal. Suggested in a dev.to comment on the registry article.

Signed-off-by: samuel mbabhazi <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 56e1cdb and 46a70a7.

Files selected for processing: 3

  • agent/internal/egress/proxy.go
  • agent/internal/egress/proxy_test.go
  • docs/SPEC.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@samuelmbabhazi
samuelmbabhazi merged commit 2ac8bc7 into main Nov 27, 2026
27 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/egress-log-address branch November 27, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant