Add `cf pcap` command to facilitate multi-instance packet captures
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- go
- Lĩnh vực
- cli, networking
Hướng nghiên cứu
Bắt đầu với RFC0048 và giao diện lệnh cf pcap được đề xuất, sau đó kiểm tra các pattern lệnh và SSH hiện có của CLI. Đánh giá dependency pure-Go github.com/gopacket/gopacket và hành vi stream của /tmp/lifecycle/cf-pcap. Được xem là hoàn thành khi các flags đã được tài liệu hóa, việc hợp nhất packet từ nhiều instance, xử lý Ctrl-C và báo cáo output hoạt động như mô tả.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Introduce a new cf pcap command that captures network traffic directly from running application container instances via SSH. This provides operators and developers with a native way to debug networking issues without needing to manually SSH into containers and perform the packet capture.
This is part of RFC0048.
Motivation
With the new cf-pcap feature in diego, app developers can perform packet captures themselves without privileged support from the operator (if enabled). Currently, this requires an understanding of the implementation details of these packet captures which should not be the case. The user should be able to perform packet captures through the same interface as all the other actions, hence a new CLI command. Since this a core feature of diego I opted for a built-in command as opposed to a plugin.
Proposed Changes
New command: cf pcap
cf pcap APP_NAME [--process PROCESS] [-i INDEX]
[-o OUTPUT_FILE] [--filter FILTER] [--interface INTERFACE]
[--snaplen SNAPLEN] [--skip-host-validation]
Flags:
| Flag | Default | Description |
|---|---|---|
--process |
web |
App process type to capture from |
-i, --app-instance-index |
all instances | Specific instance index (omit to capture from all running instances) |
-o, --output |
capture.pcap |
Output file path |
--filter |
(none) | BPF filter expression passed to cf-pcap |
--interface |
eth0 |
Network interface to capture on |
--snaplen |
0 (cf-pcap default) |
Snapshot length for captured packets |
-k, --skip-host-validation |
false |
Skip SSH host key validation |
Behavior:
- Requires an org and space to be targeted
- When
-iis omitted, captures from all instances simultaneously - Opens SSH connections to each target instance and runs
/tmp/lifecycle/cf-pcapremotely - Streams pcap-formatted data over SSH stdout, parses individual packets using
gopacket, and merges packets from all instances into a single output.pcapfile - Capture runs until the user presses Ctrl-C, at which point SIGINT is forwarded to the remote processes and the SSH sessions are torn down after a 5-second grace period
- Displays the output file path and size on completion
To allow merging the packet streams the github.com/gopacket/gopacket dependency needs to be added. I intend to only use the pure Go parts (no cgo) to keep building / installing the CLI simple.
- Ngôn ngữ chính
- Go
- Star
- 1.9k
- Fork
- 989
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudfoundry/cli
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
cloudfoundry/cli#3866 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
cloudfoundry/cli#3863 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
cloudfoundry/cli#3851 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add zsh shell completionĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
cloudfoundry/cli#3794 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
cloudfoundry/cli#3787 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cloudfoundry/cli
Issue tương tự
-
`renderLinkedIssues` overshoots its byte budget: unresolved and omitted lists are never boundedĐang mởagent-butler-finding agent-research-recommend bug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
jordansmall/spindrift#4614 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
weaviate/weaviate-go-client#485 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
litmuschaos/litmus#5641 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày