diff --git a/actions/tcpdump_pcap_write.yaml b/actions/tcpdump_pcap_write.yaml new file mode 100644 index 0000000..160aa66 --- /dev/null +++ b/actions/tcpdump_pcap_write.yaml @@ -0,0 +1,54 @@ +--- +description: "Run tcpdump against an interface and collect pcap data." +enabled: true +name: "tcpdump_pcap_write" +pack: "networking_utils" + +parameters: + interface: + type: "string" + description: "Interface identifier" + required: true + + snaplen: + type: "number" + description: "Snaplength." + default: 0 + required: false + + file: + type: "string" + description: "Path to capture file." + required: true + + mode: + description: "Capture mode - write to file or read from file" + type: "string" + enum: + - w + - r + default: "w" + + time: + description: "Time for which tcpdump capture should be run" + type: "number" + required: false + default: 120 # seconds + + timeout: + default: 1000 + + tcpdump_opts: + description: "Specify other tcpdump options as you specify on a shell." + type: "string" + required: false + default: "-G {{ time }} -W 1 -C 1 -l -nn" + + sudo: + default: true + immutable: true + + cmd: + default: 'sudo timeout {{ time }} tcpdump -i {{ interface }} -s {{ snaplen }} -{{ mode }} {{ file }} {{ tcpdump_opts }} || exit 0' + +runner_type: "remote-shell-cmd" diff --git a/actions/tshark_pcap_write.yaml b/actions/tshark_pcap_write.yaml new file mode 100644 index 0000000..8f67f46 --- /dev/null +++ b/actions/tshark_pcap_write.yaml @@ -0,0 +1,54 @@ +--- +description: "Run tcpdump against an interface and collect pcap data." +enabled: true +name: "tshark_pcap_write" +pack: "networking_utils" + +parameters: + interface: + type: "string" + description: "Interface identifier" + required: true + + snaplen: + type: "number" + description: "Snaplength." + default: 0 + required: false + + file: + type: "string" + description: "Path to capture file." + required: true + + mode: + description: "Capture mode - write to file or read from file" + type: "string" + enum: + - w + - r + default: "w" + + time: + description: "Time for which tcpdump capture should be run" + type: "number" + required: false + default: 120 # seconds + + timeout: + default: 1000 + + tshark_opts: + description: "Specify other tcpdump options as you specify on a shell." + type: "string" + required: false + default: "-n" + + sudo: + default: true + immutable: true + + cmd: + default: 'sudo tshark -i {{ interface }} -s {{ snaplen }} -{{ mode }} {{ file }} -a duration:{{ time }} {{ tshark_opts }}' + +runner_type: "remote-shell-cmd"