Skip to content

[EV-3924] Add network policy egress rules for threat feed pull domains#4621

Open
radixo wants to merge 2 commits intotigera:masterfrom
radixo:ev-3924-auto-allow-egress-domains-ga
Open

[EV-3924] Add network policy egress rules for threat feed pull domains#4621
radixo wants to merge 2 commits intotigera:masterfrom
radixo:ev-3924-auto-allow-egress-domains-ga

Conversation

@radixo
Copy link
Copy Markdown
Contributor

@radixo radixo commented Apr 1, 2026

The intrusion-detection-controller needs to reach external URLs configured in GlobalThreatFeed resources to pull threat intel. When a deny-all policy is in place, these connections are blocked. Watch GlobalThreatFeed resources and dynamically add their HTTP pull hostnames as allowed egress domains in the controller's network policy.

Description

Release Note

TBD

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

The intrusion-detection-controller needs to reach external URLs
configured in GlobalThreatFeed resources to pull threat intel. When a
deny-all policy is in place, these connections are blocked. Watch
GlobalThreatFeed resources and dynamically add their HTTP pull
hostnames as allowed egress domains in the controller's network policy.
@radixo radixo force-pushed the ev-3924-auto-allow-egress-domains-ga branch from 631b446 to 5ec9b39 Compare April 1, 2026 19:08
// URLs so that the network policy can allow egress to those domains.
func threatFeedPullDomains(feeds []v3.GlobalThreatFeed) []string {
seen := map[string]struct{}{}
for i := range feeds {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
for i := range feeds {
for _, feed := ranger feeds {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Aesthetically I'd do the way you recommended, but the Claude implemented this part it is faster, because it gets the pointer of the structure instead of copying it completely. WDYT?

…ests

Simplify threatFeedPullDomains by using slices.Collect(maps.Keys()) instead
of manual map iteration. Add missing threatFeedAPIReady field initialization
in intrusion detection controller tests.
@radixo radixo marked this pull request as ready for review April 3, 2026 07:15
@radixo radixo requested a review from a team as a code owner April 3, 2026 07:15
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.

3 participants