← Back to Pull requests

feat: Make capturing on all interfaces (-i any) the default behavior for retina captures #1649

Closed
unknown closed this pull request without merging on Jun 19, 2025 10:59 UTC
View on GitHub
unknown unknown commented on May 30, 2025 20:22 UTC
Author

Problem

Currently, when kubectl retina capture create is run without any additional options, retina only captures packets on the first available interface (typically eth0). This limits the visibility of network traffic that may be flowing through other interfaces on the node.

Solution

This PR changes the default behavior to capture on all interfaces by using the -i any tcpdump flag when no custom tcpdump filter is specified. This provides better network visibility out of the box while maintaining backward compatibility.

Changes Made

1. Modified pkg/capture/provider/network_capture_unix.go: Updated the tcpdump command construction to include -i any by default when no raw tcpdump filter is specified.

2. Added comprehensive tests in pkg/capture/provider/network_capture_test.go to verify:
- Default behavior includes -i any when no raw filter is set
- User-specified raw filters override the default behavior
- Backward compatibility is maintained

3. Updated documentation in docs/04-Captures/02-cli.md to clarify the new default behavior and provide an example of capturing on a specific interface.

Backward Compatibility

Users can still override the default behavior by using the --tcpdump-filter flag:

# Capture on all interfaces (new default)
kubectl retina capture create --name my-capture

# Capture on specific interface (override)
kubectl retina capture create --name my-capture --tcpdump-filter="-i eth0"

Testing

All existing tests continue to pass, and new tests verify the correct command construction for both default and override scenarios.

Fixes #1648.

---

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Diff: 238 lines (+178 / -60) across 2 files Reviewer: vakalapa Review duration: 28236m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 238 lines diff across 2 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.328
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1649"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 37.2% (MEDIUM) · Higher = larger blast radius
37.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.7% · Safe to merge
14.7%