Documentation ¶
Overview ¶
Starts a live capture session by opening a websocket stream to the capture service, and then piping the packet capture stream into the pipe (fifo) made available by Wireshark. This module has basically outsourced most of its functionality to the csharg standalone package for better re-use.
Additionally, also edits the beginning of the packet capture stream in order to insert meta data about the container capture origin, such as cluster identity, container identity, et cetera.
An external capture plugin for Wireshark for capturing network packets from inside containers (Docker, others) without having to prepare these containers for capturing. These containers can be deployed on single hosts, but also in Kubernetes clusters.
This OpenSource module implements capture clients for capturing from container hosts (including a KinD host). The following two extcap interfaces are implemented:
- [MobyNif] connects to a capture service via http: and https: protocol URLs.
- [PacketflixNif] connects to a capture service described by a packetflix: protocol URL. Under the hood, the packetflix: protocol encodes http: or https: URLs. The use case for packetflix: URLs is to allow easy hand-over from web-browser based UIs to Wireshark.
Index ¶
- Constants
- func Capture(st csharg.SharkTank) int
- func ExtcapCapture() int
- func ExtcapConfigure(w io.Writer) int
- func ExtcapDlts(w io.Writer) int
- func ExtcapInterfaces(w io.Writer) int
- func ExtcapNifNames() []string
- func ReloadContainerNifs(w io.Writer)
- type ExtcapNif
- type ExtcapNifActions
- type ExtcapNifDLT
Constants ¶
const ( // HelpURL points to the help page for this external capture plugin; // when a Wireshark user clicks on the "help" button in the configuration // dialog for this plugin, then this web page will be navigated to. HelpURL = "https://github.com/siemens/cshargextcap" // ServiceDefaultPort is the default port of the Packetflix+GhostWire // capture service for streaming packet captures snatched up in containers. ServiceDefaultPort = int32(5001) )
const SemVersion = "0.9.2"
SemVersion is the semantic version string of the cshargextcap module.
Variables ¶
This section is empty.
Functions ¶
func Capture ¶
Capture is the workhorse: it opens the named pipe (fifo) offered by Wireshark, then starts a new Capture stream using the given SharkTank client and container target description. Then it lets csharg pump all packet Capture data arriving from the underlying websocket connected to the capture service into the Wireshark pipe.
func ExtcapCapture ¶
func ExtcapCapture() int
Implements the "--capture" action: it routes the capture action to the specified extcap network interface.
func ExtcapConfigure ¶
Wireshark wants either to know the configuration args for a specific extcap network interface, or it wants to update the value(s) of a specific single configuration arg of a network interface.
func ExtcapDlts ¶
Lists the DLTs for a specific external capture network interface, by querying the specified (internally-registered) extcap nif, and finally correctly formatting the answer.
func ExtcapInterfaces ¶
Lists the available (internally registered) external capture network interfaces.
func ExtcapNifNames ¶
func ExtcapNifNames() []string
ExtcapNifNames returns the list of names of the registered external capture network interfaces. The names in the returned list are in no particular order.
func ReloadContainerNifs ¶
ReloadContainerNifs reloads the list of network interfaces of a specific container. That is, it refreshes the list of the interface selector config arg. This helper is exported so additional extcaps can make use of it.
Types ¶
type ExtcapNif ¶
type ExtcapNif struct {
// contains filtered or unexported fields
}
ExtcapNif represents an individual, named external capture network interface.
func NewExtcapNif ¶
func (*ExtcapNif) Description ¶
Description returns the short description of an external capture network interface.
type ExtcapNifActions ¶
type ExtcapNifActions interface { Name() string // name of extcap network interface Description() string // short description DLTs() []ExtcapNifDLT // data-link layer encapsulation data type Configure(w io.Writer) int // dump configuration options ReloadOption(w io.Writer) // dump up-to-date value(s) of specific configuration options Capture() int // start packet capture }
ExtcapNifActions represents the actions that can be carried out on external capture network interfaces. These actions reflect the actions Wireshark signals to external capture plugins when invoking them. The only additional "internal" action here is returning the name of a specific external capture interface, which is used for looking up --ext-interface arguments.
func ExtcapNifByName ¶
func ExtcapNifByName(name string) (ExtcapNifActions, bool)
ExtcapNifByName returns the external capture network interface with the specified name. Please note that capture network interfaces need to register their ExtcapNifActions implementation in the plugger group typed as ExtcapNifActions.
type ExtcapNifDLT ¶
ExtcapNifDLT describes a single DLT in terms of its number and description.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package cfg defines the ID numbers as well as descriptions of config arguments used in the extcap configuration dialogs.
|
Package cfg defines the ID numbers as well as descriptions of config arguments used in the extcap configuration dialogs. |
action
Package action implements the handling of Wireshark's extcap CLI action flag.
|
Package action implements the handling of Wireshark's extcap CLI action flag. |
all
Package all ensures to pull in the required packages for (obscure) CLI args as well as the set of extcap implementations
|
Package all ensures to pull in the required packages for (obscure) CLI args as well as the set of extcap implementations |
cliplugin
Package cliplugin defines the plugin group types for setting up the extcap plugin CLI args in a modular way.
|
Package cliplugin defines the plugin group types for setting up the extcap plugin CLI args in a modular way. |
debug
Package debug implements the “--debug” and “--debug-file” CLI args.
|
Package debug implements the “--debug” and “--debug-file” CLI args. |
cmd
|
|
internal
|
|
Package nif implements the “moby” and “packetflix” extcap network interfaces for Wireshark.
|
Package nif implements the “moby” and “packetflix” extcap network interfaces for Wireshark. |