Skip to content

fix: block link-local addresses by default in NetworkPolicy - #54

Merged
danbugs merged 1 commit into
mainfrom
fix/block-link-local
May 16, 2026
Merged

fix: block link-local addresses by default in NetworkPolicy#54
danbugs merged 1 commit into
mainfrom
fix/block-link-local

Conversation

@danbugs

@danbugs danbugs commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Blocks 169.254.0.0/16 (IPv4) and fe80::/10 (IPv6) at the top of NetworkPolicy::check(), before the policy-variant match — applies to AllowAll, BlockList, and AllowList alike
  • In cloud environments the IPv4 link-local range hosts the instance metadata service (169.254.169.254) which hands out credentials without authentication; every major container/VM runtime (Docker, Firecracker, gVisor) blocks this by default
  • Adds net_link_local_blocked test covering both address families under AllowAll and BlockList policies

Test plan

  • cargo test --lib net_link_local_blocked passes
  • Full cargo test --lib (49 tests) passes
  • cargo fmt and cargo clippy clean

Signed-off-by: danbugs <danilochiarlone@gmail.com>
@danbugs
danbugs enabled auto-merge May 15, 2026 23:54

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux Benchmarks

Details
Benchmark suite Current: 188e138 Previous: a4831d7 Ratio
hello_world (median) 20 ms 20 ms 1
pandas (median) 100 ms 110 ms 0.91
density (per VM) 7 MB 7 MB 1
snapshot (disk) 385 MiB 385 MiB 1

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows Benchmarks

Details
Benchmark suite Current: 188e138 Previous: a4831d7 Ratio
hello_world (median) 177 ms 255 ms 0.69
pandas (median) 519 ms 829 ms 0.63
density (per VM) 6 MB 6 MB 1
snapshot (disk) 392 MiB 392 MiB 1

This comment was automatically generated by workflow using github-action-benchmark.

@danbugs
danbugs merged commit e2d16db into main May 16, 2026
79 checks passed
@danbugs
danbugs deleted the fix/block-link-local branch May 16, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant