diff --git a/tests/fixtures/centos-7.7/ss-sudo-a.json b/tests/fixtures/centos-7.7/ss-sudo-a.json new file mode 100644 index 00000000..4454b35f --- /dev/null +++ b/tests/fixtures/centos-7.7/ss-sudo-a.json @@ -0,0 +1 @@ +[{"netid": "nl", "state": "UNCONN", "recv_q": 768, "send_q": 0, "peer_address": "*", "pid": 1220, "channel": "rtnl:dockerd-current"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "rtnl:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 878, "channel": "rtnl:NetworkManager"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 878, "channel": "rtnl:NetworkManager"}, {"netid": "nl", "state": "UNCONN", "recv_q": 4352, "send_q": 0, "peer_address": "*", "pid": 11360, "channel": "tcpdiag:ss"}, {"netid": "nl", "state": "UNCONN", "recv_q": 768, "send_q": 0, "peer_address": "*", "channel": "tcpdiag:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1220, "channel": "xfrm:dockerd-current"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "xfrm:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "selinux:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "selinux:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 787, "channel": "selinux:dbus-daemon"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 787, "channel": "selinux:dbus-daemon"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "selinux:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "audit:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 754, "channel": "audit:auditd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 11358, "channel": "audit:sudo"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "audit:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "fiblookup:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "connector:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "nft:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1218, "channel": "uevent:tuned"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-4118"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-4120"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-4107"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 783, "channel": "uevent:systemd-logind"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-4117"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 878, "channel": "uevent:NetworkManager"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-4119"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "uevent:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1218, "channel": "uevent:tuned"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-4120"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 878, "channel": "uevent:NetworkManager"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-4119"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-4118"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-4117"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 783, "channel": "uevent:systemd-logind"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-4107"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "uevent:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "genl:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 878, "channel": "genl:NetworkManager"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "scsi-trans:kernel"}, {"netid": "p_raw", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "link_layer": "*", "interface": "ens33"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "8971", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/notify"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "8973", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/cgroups-agent"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "8981", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "22040", "peer_address": "*", "peer_port": "0", "path": "/var/run/docker.sock"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "8984", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/journal/socket"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "8986", "peer_address": "*", "peer_port": "0", "path": "/dev/log"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22610", "peer_address": "*", "peer_port": "0", "path": "public/pickup"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22623", "peer_address": "*", "peer_port": "0", "path": "private/tlsmgr"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 10, "local_port": "20787", "peer_address": "*", "peer_port": "0", "path": "/var/run/NetworkManager/private-dhcp"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "23141", "peer_address": "*", "peer_port": "0", "path": "/run/docker/libnetwork/35ee6333bf93cc6652841e66c2c6dfb2e0a14ff20208fe6c4ad28a33dad48423.sock"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "17775", "peer_address": "*", "peer_port": "0", "path": "/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22616", "peer_address": "*", "peer_port": "0", "path": "public/cleanup"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "14206", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/shutdownd"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22619", "peer_address": "*", "peer_port": "0", "path": "public/qmgr"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22644", "peer_address": "*", "peer_port": "0", "path": "public/flush"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "14005", "peer_address": "*", "peer_port": "0", "path": "/run/lvm/lvmetad.socket"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "14021", "peer_address": "*", "peer_port": "0", "path": "/run/lvm/lvmpolld.socket"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22659", "peer_address": "*", "peer_port": "0", "path": "public/showq"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "18375", "peer_address": "*", "peer_port": "0", "path": "/var/run/chrony/chronyd.sock"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22629", "peer_address": "*", "peer_port": "0", "path": "private/rewrite"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22632", "peer_address": "*", "peer_port": "0", "path": "private/bounce"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22635", "peer_address": "*", "peer_port": "0", "path": "private/defer"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22638", "peer_address": "*", "peer_port": "0", "path": "private/trace"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22641", "peer_address": "*", "peer_port": "0", "path": "private/verify"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22647", "peer_address": "*", "peer_port": "0", "path": "private/proxymap"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "13776", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/private"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22650", "peer_address": "*", "peer_port": "0", "path": "private/proxywrite"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22653", "peer_address": "*", "peer_port": "0", "path": "private/smtp"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22656", "peer_address": "*", "peer_port": "0", "path": "private/relay"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22662", "peer_address": "*", "peer_port": "0", "path": "private/error"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22665", "peer_address": "*", "peer_port": "0", "path": "private/retry"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22668", "peer_address": "*", "peer_port": "0", "path": "private/discard"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22673", "peer_address": "*", "peer_port": "0", "path": "private/local"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22676", "peer_address": "*", "peer_port": "0", "path": "private/virtual"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22679", "peer_address": "*", "peer_port": "0", "path": "private/lmtp"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22682", "peer_address": "*", "peer_port": "0", "path": "private/anvil"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_port": "22685", "peer_address": "*", "peer_port": "0", "path": "private/scache"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "22259", "peer_address": "*", "peer_port": "0", "path": "/var/run/docker/libcontainerd/docker-containerd.sock"}, {"netid": "u_seq", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "13820", "peer_address": "*", "peer_port": "0", "path": "/run/udev/control"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22658", "peer_address": "*", "peer_port": "22657", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "19150", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "19064", "peer_address": "*", "peer_port": "19063", "path": "/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22657", "peer_address": "*", "peer_port": "22658", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "21607", "peer_address": "*", "peer_port": "21606", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22660", "peer_address": "*", "peer_port": "22661", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "19176", "peer_address": "*", "peer_port": "19175", "path": "/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "21606", "peer_address": "*", "peer_port": "21607", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "14820", "peer_address": "*", "peer_port": "14821", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22661", "peer_address": "*", "peer_port": "22660", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "18334", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "17615", "peer_address": "*", "peer_port": "17614", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "14877", "peer_address": "*", "peer_port": "14878", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22663", "peer_address": "*", "peer_port": "22664", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "14878", "peer_address": "*", "peer_port": "14877", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18347", "peer_address": "*", "peer_port": "18416", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "63240", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18416", "peer_address": "*", "peer_port": "18347", "path": "/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "21589", "peer_address": "*", "peer_port": "21590", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18181", "peer_address": "*", "peer_port": "18180", "path": "/run/systemd/journal/stdout"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "14846", "peer_address": "*", "peer_port": "8984", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "108562", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22652", "peer_address": "*", "peer_port": "22651", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "19253", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22651", "peer_address": "*", "peer_port": "22652", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18180", "peer_address": "*", "peer_port": "18181", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18817", "peer_address": "*", "peer_port": "18818", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22654", "peer_address": "*", "peer_port": "22655", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22655", "peer_address": "*", "peer_port": "22654", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22645", "peer_address": "*", "peer_port": "22646", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "21590", "peer_address": "*", "peer_port": "21589", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22646", "peer_address": "*", "peer_port": "22645", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22649", "peer_address": "*", "peer_port": "22648", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22648", "peer_address": "*", "peer_port": "22649", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18818", "peer_address": "*", "peer_port": "18817", "path": "/run/systemd/journal/stdout"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "62145", "peer_address": "*", "peer_port": "8984", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "63245", "peer_address": "*", "peer_port": "63246", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22637", "peer_address": "*", "peer_port": "22636", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "63246", "peer_address": "*", "peer_port": "63245", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22636", "peer_address": "*", "peer_port": "22637", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "14821", "peer_address": "*", "peer_port": "14820", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22639", "peer_address": "*", "peer_port": "22640", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "19063", "peer_address": "*", "peer_port": "19064", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "19175", "peer_address": "*", "peer_port": "19176", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18390", "peer_address": "*", "peer_port": "18417", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22640", "peer_address": "*", "peer_port": "22639", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22643", "peer_address": "*", "peer_port": "22642", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22642", "peer_address": "*", "peer_port": "22643", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "107686", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "20820", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22618", "peer_address": "*", "peer_port": "22617", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "21745", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22617", "peer_address": "*", "peer_port": "22618", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22464", "peer_address": "*", "peer_port": "22463", "path": "/var/run/docker/libcontainerd/docker-containerd.sock"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "20314", "peer_address": "*", "peer_port": "20315", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18299", "peer_address": "*", "peer_port": "18300", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "20315", "peer_address": "*", "peer_port": "20314", "path": "/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18300", "peer_address": "*", "peer_port": "18299", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22463", "peer_address": "*", "peer_port": "22464", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22633", "peer_address": "*", "peer_port": "22634", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22621", "peer_address": "*", "peer_port": "22620", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22631", "peer_address": "*", "peer_port": "22630", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "21741", "peer_address": "*", "peer_port": "21740", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22620", "peer_address": "*", "peer_port": "22621", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "14010", "peer_address": "*", "peer_port": "8971", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "14671", "peer_address": "*", "peer_port": "14672", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "21740", "peer_address": "*", "peer_port": "21741", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22681", "peer_address": "*", "peer_port": "22680", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18413", "peer_address": "*", "peer_port": "18414", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22680", "peer_address": "*", "peer_port": "22681", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22609", "peer_address": "*", "peer_port": "22608", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "18867", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22683", "peer_address": "*", "peer_port": "22684", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18414", "peer_address": "*", "peer_port": "18413", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "19127", "peer_address": "*", "peer_port": "19126", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22684", "peer_address": "*", "peer_port": "22683", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22614", "peer_address": "*", "peer_port": "22613", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "14672", "peer_address": "*", "peer_port": "14671", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22687", "peer_address": "*", "peer_port": "22686", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22634", "peer_address": "*", "peer_port": "22633", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22613", "peer_address": "*", "peer_port": "22614", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22686", "peer_address": "*", "peer_port": "22687", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22608", "peer_address": "*", "peer_port": "22609", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "19126", "peer_address": "*", "peer_port": "19127", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22628", "peer_address": "*", "peer_port": "22627", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22675", "peer_address": "*", "peer_port": "22674", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22674", "peer_address": "*", "peer_port": "22675", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22765", "peer_address": "*", "peer_port": "22766", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22677", "peer_address": "*", "peer_port": "22678", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "18896", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22627", "peer_address": "*", "peer_port": "22628", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22766", "peer_address": "*", "peer_port": "22765", "path": "/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "17614", "peer_address": "*", "peer_port": "17615", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22678", "peer_address": "*", "peer_port": "22677", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "18318", "peer_address": "*", "peer_port": "8984", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "22793", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18415", "peer_address": "*", "peer_port": "18302", "path": "/run/dbus/system_bus_socket"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "22030", "peer_address": "*", "peer_port": "8984", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22664", "peer_address": "*", "peer_port": "22663", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18302", "peer_address": "*", "peer_port": "18415", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22667", "peer_address": "*", "peer_port": "22666", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "18417", "peer_address": "*", "peer_port": "18390", "path": "/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22666", "peer_address": "*", "peer_port": "22667", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "22581", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "23190", "peer_address": "*", "peer_port": "23191", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22669", "peer_address": "*", "peer_port": "22670", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22630", "peer_address": "*", "peer_port": "22631", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "22715", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "17605", "peer_address": "*", "peer_port": "8986", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "22670", "peer_address": "*", "peer_port": "22669", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "23191", "peer_address": "*", "peer_port": "23190", "path": "/run/dbus/system_bus_socket"}, {"netid": "raw", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_address": "[::]", "local_port": "ipv6-icmp", "peer_address": "[::]", "peer_port": "*"}, {"netid": "udp", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_address": "*", "local_port": "bootpc", "peer_address": "*", "peer_port": "*"}, {"netid": "udp", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_address": "127.0.0.1", "local_port": "323", "peer_address": "*", "peer_port": "*"}, {"netid": "udp", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_address": "[::1]", "local_port": "323", "peer_address": "[::]", "peer_port": "*"}, {"netid": "tcp", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_address": "127.0.0.1", "local_port": "smtp", "peer_address": "*", "peer_port": "*"}, {"netid": "tcp", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_address": "*", "local_port": "ssh", "peer_address": "*", "peer_port": "*"}, {"netid": "tcp", "state": "LISTEN", "recv_q": 0, "send_q": 100, "local_address": "[::1]", "local_port": "smtp", "peer_address": "[::]", "peer_port": "*"}, {"netid": "tcp", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_address": "[::]", "local_port": "ssh", "peer_address": "[::]", "peer_port": "*"}, {"netid": "tcp", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_address": "[::1]", "local_port": "ssh", "peer_address": "[::1]", "peer_port": "38134"}, {"netid": "tcp", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_address": "[::1]", "local_port": "38134", "peer_address": "[::1]", "peer_port": "ssh", "local_port_num": 38134}] diff --git a/tests/fixtures/centos-7.7/ss-sudo-a.out b/tests/fixtures/centos-7.7/ss-sudo-a.out new file mode 100644 index 00000000..514e1ad3 --- /dev/null +++ b/tests/fixtures/centos-7.7/ss-sudo-a.out @@ -0,0 +1,204 @@ +Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port +nl UNCONN 768 0 rtnl:dockerd-current/1220 * +nl UNCONN 0 0 rtnl:kernel * +nl UNCONN 0 0 rtnl:NetworkManager/878 * +nl UNCONN 0 0 rtnl:NetworkManager/878 * +nl UNCONN 4352 0 tcpdiag:ss/11360 * +nl UNCONN 768 0 tcpdiag:kernel * +nl UNCONN 0 0 xfrm:dockerd-current/1220 * +nl UNCONN 0 0 xfrm:kernel * +nl UNCONN 0 0 selinux:kernel * +nl UNCONN 0 0 selinux:systemd/1 * +nl UNCONN 0 0 selinux:dbus-daemon/787 * +nl UNCONN 0 0 selinux:dbus-daemon/787 * +nl UNCONN 0 0 selinux:systemd/1 * +nl UNCONN 0 0 audit:kernel * +nl UNCONN 0 0 audit:auditd/754 * +nl UNCONN 0 0 audit:sudo/11358 * +nl UNCONN 0 0 audit:systemd/1 * +nl UNCONN 0 0 fiblookup:kernel * +nl UNCONN 0 0 connector:kernel * +nl UNCONN 0 0 nft:kernel * +nl UNCONN 0 0 uevent:tuned/1218 * +nl UNCONN 0 0 uevent:-4118 * +nl UNCONN 0 0 uevent:-4120 * +nl UNCONN 0 0 uevent:-4107 * +nl UNCONN 0 0 uevent:systemd-logind/783 * +nl UNCONN 0 0 uevent:-4117 * +nl UNCONN 0 0 uevent:kernel * +nl UNCONN 0 0 uevent:NetworkManager/878 * +nl UNCONN 0 0 uevent:-4119 * +nl UNCONN 0 0 uevent:systemd/1 * +nl UNCONN 0 0 uevent:tuned/1218 * +nl UNCONN 0 0 uevent:-4120 * +nl UNCONN 0 0 uevent:NetworkManager/878 * +nl UNCONN 0 0 uevent:-4119 * +nl UNCONN 0 0 uevent:-4118 * +nl UNCONN 0 0 uevent:-4117 * +nl UNCONN 0 0 uevent:systemd-logind/783 * +nl UNCONN 0 0 uevent:-4107 * +nl UNCONN 0 0 uevent:systemd/1 * +nl UNCONN 0 0 genl:kernel * +nl UNCONN 0 0 genl:NetworkManager/878 * +nl UNCONN 0 0 scsi-trans:kernel * +p_raw UNCONN 0 0 *:ens33 * +u_dgr UNCONN 0 0 /run/systemd/notify 8971 * 0 +u_dgr UNCONN 0 0 /run/systemd/cgroups-agent 8973 * 0 +u_str LISTEN 0 128 /run/systemd/journal/stdout 8981 * 0 +u_str LISTEN 0 128 /var/run/docker.sock 22040 * 0 +u_dgr UNCONN 0 0 /run/systemd/journal/socket 8984 * 0 +u_dgr UNCONN 0 0 /dev/log 8986 * 0 +u_str LISTEN 0 100 public/pickup 22610 * 0 +u_str LISTEN 0 100 private/tlsmgr 22623 * 0 +u_str LISTEN 0 10 /var/run/NetworkManager/private-dhcp 20787 * 0 +u_str LISTEN 0 128 /run/docker/libnetwork/35ee6333bf93cc6652841e66c2c6dfb2e0a14ff20208fe6c4ad28a33dad48423.sock 23141 * 0 +u_str LISTEN 0 128 /run/dbus/system_bus_socket 17775 * 0 +u_str LISTEN 0 100 public/cleanup 22616 * 0 +u_dgr UNCONN 0 0 /run/systemd/shutdownd 14206 * 0 +u_str LISTEN 0 100 public/qmgr 22619 * 0 +u_str LISTEN 0 100 public/flush 22644 * 0 +u_str LISTEN 0 128 /run/lvm/lvmetad.socket 14005 * 0 +u_str LISTEN 0 128 /run/lvm/lvmpolld.socket 14021 * 0 +u_str LISTEN 0 100 public/showq 22659 * 0 +u_dgr UNCONN 0 0 /var/run/chrony/chronyd.sock 18375 * 0 +u_str LISTEN 0 100 private/rewrite 22629 * 0 +u_str LISTEN 0 100 private/bounce 22632 * 0 +u_str LISTEN 0 100 private/defer 22635 * 0 +u_str LISTEN 0 100 private/trace 22638 * 0 +u_str LISTEN 0 100 private/verify 22641 * 0 +u_str LISTEN 0 100 private/proxymap 22647 * 0 +u_str LISTEN 0 128 /run/systemd/private 13776 * 0 +u_str LISTEN 0 100 private/proxywrite 22650 * 0 +u_str LISTEN 0 100 private/smtp 22653 * 0 +u_str LISTEN 0 100 private/relay 22656 * 0 +u_str LISTEN 0 100 private/error 22662 * 0 +u_str LISTEN 0 100 private/retry 22665 * 0 +u_str LISTEN 0 100 private/discard 22668 * 0 +u_str LISTEN 0 100 private/local 22673 * 0 +u_str LISTEN 0 100 private/virtual 22676 * 0 +u_str LISTEN 0 100 private/lmtp 22679 * 0 +u_str LISTEN 0 100 private/anvil 22682 * 0 +u_str LISTEN 0 100 private/scache 22685 * 0 +u_str LISTEN 0 128 /var/run/docker/libcontainerd/docker-containerd.sock 22259 * 0 +u_seq LISTEN 0 128 /run/udev/control 13820 * 0 +u_str ESTAB 0 0 * 22658 * 22657 +u_dgr UNCONN 0 0 * 19150 * 8986 +u_str ESTAB 0 0 /run/dbus/system_bus_socket 19064 * 19063 +u_str ESTAB 0 0 * 22657 * 22658 +u_str ESTAB 0 0 /run/systemd/journal/stdout 21607 * 21606 +u_str ESTAB 0 0 * 22660 * 22661 +u_str ESTAB 0 0 /run/dbus/system_bus_socket 19176 * 19175 +u_str ESTAB 0 0 * 21606 * 21607 +u_str ESTAB 0 0 * 14820 * 14821 +u_str ESTAB 0 0 * 22661 * 22660 +u_dgr UNCONN 0 0 * 18334 * 8986 +u_str ESTAB 0 0 * 17615 * 17614 +u_dgr UNCONN 0 0 * 14877 * 14878 +u_str ESTAB 0 0 * 22663 * 22664 +u_dgr UNCONN 0 0 * 14878 * 14877 +u_str ESTAB 0 0 * 18347 * 18416 +u_dgr UNCONN 0 0 * 63240 * 8986 +u_str ESTAB 0 0 /run/dbus/system_bus_socket 18416 * 18347 +u_str ESTAB 0 0 * 21589 * 21590 +u_str ESTAB 0 0 /run/systemd/journal/stdout 18181 * 18180 +u_dgr UNCONN 0 0 * 14846 * 8984 +u_dgr UNCONN 0 0 * 108562 * 8986 +u_str ESTAB 0 0 * 22652 * 22651 +u_dgr UNCONN 0 0 * 19253 * 8986 +u_str ESTAB 0 0 * 22651 * 22652 +u_str ESTAB 0 0 * 18180 * 18181 +u_str ESTAB 0 0 * 18817 * 18818 +u_str ESTAB 0 0 * 22654 * 22655 +u_str ESTAB 0 0 * 22655 * 22654 +u_str ESTAB 0 0 * 22645 * 22646 +u_str ESTAB 0 0 /run/systemd/journal/stdout 21590 * 21589 +u_str ESTAB 0 0 * 22646 * 22645 +u_str ESTAB 0 0 * 22649 * 22648 +u_str ESTAB 0 0 * 22648 * 22649 +u_str ESTAB 0 0 /run/systemd/journal/stdout 18818 * 18817 +u_dgr UNCONN 0 0 * 62145 * 8984 +u_str ESTAB 0 0 * 63245 * 63246 +u_str ESTAB 0 0 * 22637 * 22636 +u_str ESTAB 0 0 * 63246 * 63245 +u_str ESTAB 0 0 * 22636 * 22637 +u_str ESTAB 0 0 /run/systemd/journal/stdout 14821 * 14820 +u_str ESTAB 0 0 * 22639 * 22640 +u_str ESTAB 0 0 * 19063 * 19064 +u_str ESTAB 0 0 * 19175 * 19176 +u_str ESTAB 0 0 * 18390 * 18417 +u_str ESTAB 0 0 * 22640 * 22639 +u_str ESTAB 0 0 * 22643 * 22642 +u_str ESTAB 0 0 * 22642 * 22643 +u_dgr UNCONN 0 0 * 107686 * 8986 +u_dgr UNCONN 0 0 * 20820 * 8986 +u_str ESTAB 0 0 * 22618 * 22617 +u_dgr UNCONN 0 0 * 21745 * 8986 +u_str ESTAB 0 0 * 22617 * 22618 +u_str ESTAB 0 0 /var/run/docker/libcontainerd/docker-containerd.sock 22464 * 22463 +u_str ESTAB 0 0 * 20314 * 20315 +u_str ESTAB 0 0 * 18299 * 18300 +u_str ESTAB 0 0 /run/dbus/system_bus_socket 20315 * 20314 +u_str ESTAB 0 0 /run/systemd/journal/stdout 18300 * 18299 +u_str ESTAB 0 0 * 22463 * 22464 +u_str ESTAB 0 0 * 22633 * 22634 +u_str ESTAB 0 0 * 22621 * 22620 +u_str ESTAB 0 0 * 22631 * 22630 +u_str ESTAB 0 0 /run/systemd/journal/stdout 21741 * 21740 +u_str ESTAB 0 0 * 22620 * 22621 +u_dgr UNCONN 0 0 * 14010 * 8971 +u_str ESTAB 0 0 * 14671 * 14672 +u_str ESTAB 0 0 * 21740 * 21741 +u_str ESTAB 0 0 * 22681 * 22680 +u_str ESTAB 0 0 * 18413 * 18414 +u_str ESTAB 0 0 * 22680 * 22681 +u_str ESTAB 0 0 * 22609 * 22608 +u_dgr UNCONN 0 0 * 18867 * 8986 +u_str ESTAB 0 0 * 22683 * 22684 +u_str ESTAB 0 0 * 18414 * 18413 +u_str ESTAB 0 0 /run/systemd/journal/stdout 19127 * 19126 +u_str ESTAB 0 0 * 22684 * 22683 +u_str ESTAB 0 0 * 22614 * 22613 +u_str ESTAB 0 0 /run/systemd/journal/stdout 14672 * 14671 +u_str ESTAB 0 0 * 22687 * 22686 +u_str ESTAB 0 0 * 22634 * 22633 +u_str ESTAB 0 0 * 22613 * 22614 +u_str ESTAB 0 0 * 22686 * 22687 +u_str ESTAB 0 0 * 22608 * 22609 +u_str ESTAB 0 0 * 19126 * 19127 +u_str ESTAB 0 0 * 22628 * 22627 +u_str ESTAB 0 0 * 22675 * 22674 +u_str ESTAB 0 0 * 22674 * 22675 +u_str ESTAB 0 0 * 22765 * 22766 +u_str ESTAB 0 0 * 22677 * 22678 +u_dgr UNCONN 0 0 * 18896 * 8986 +u_str ESTAB 0 0 * 22627 * 22628 +u_str ESTAB 0 0 /run/dbus/system_bus_socket 22766 * 22765 +u_str ESTAB 0 0 * 17614 * 17615 +u_str ESTAB 0 0 * 22678 * 22677 +u_dgr UNCONN 0 0 * 18318 * 8984 +u_dgr UNCONN 0 0 * 22793 * 8986 +u_str ESTAB 0 0 /run/dbus/system_bus_socket 18415 * 18302 +u_dgr UNCONN 0 0 * 22030 * 8984 +u_str ESTAB 0 0 * 22664 * 22663 +u_str ESTAB 0 0 * 18302 * 18415 +u_str ESTAB 0 0 * 22667 * 22666 +u_str ESTAB 0 0 /run/dbus/system_bus_socket 18417 * 18390 +u_str ESTAB 0 0 * 22666 * 22667 +u_dgr UNCONN 0 0 * 22581 * 8986 +u_str ESTAB 0 0 * 23190 * 23191 +u_str ESTAB 0 0 * 22669 * 22670 +u_str ESTAB 0 0 * 22630 * 22631 +u_dgr UNCONN 0 0 * 22715 * 8986 +u_dgr UNCONN 0 0 * 17605 * 8986 +u_str ESTAB 0 0 * 22670 * 22669 +u_str ESTAB 0 0 /run/dbus/system_bus_socket 23191 * 23190 +raw UNCONN 0 0 [::]:ipv6-icmp [::]:* +udp UNCONN 0 0 *:bootpc *:* +udp UNCONN 0 0 127.0.0.1:323 *:* +udp UNCONN 0 0 [::1]:323 [::]:* +tcp LISTEN 0 100 127.0.0.1:smtp *:* +tcp LISTEN 0 128 *:ssh *:* +tcp LISTEN 0 100 [::1]:smtp [::]:* +tcp LISTEN 0 128 [::]:ssh [::]:* +tcp ESTAB 0 0 [::1]:ssh [::1]:38134 +tcp ESTAB 0 0 [::1]:38134 [::1]:ssh diff --git a/tests/fixtures/ubuntu-18.04/ss-sudo-a.json b/tests/fixtures/ubuntu-18.04/ss-sudo-a.json new file mode 100644 index 00000000..1931369d --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ss-sudo-a.json @@ -0,0 +1 @@ +[{"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "rtnl:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 893, "channel": "rtnl:systemd-resolve"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "rtnl:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 893, "channel": "rtnl:systemd-resolve"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "rtnl:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 768, "send_q": 0, "peer_address": "*", "channel": "tcpdiag:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 4352, "send_q": 0, "peer_address": "*", "pid": 25293, "channel": "tcpdiag:ss"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "selinux:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "iscsi:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "audit:-1100095455"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "audit:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 25292, "channel": "audit:sudo"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "audit:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "audit:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "fiblookup:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "connector:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-15116454"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1018, "channel": "uevent:systemd-logind"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 4229, "channel": "uevent:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "uevent:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-866834182"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-1118001981"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-400364679"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 874, "channel": "uevent:systemd-network"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 970, "channel": "uevent:snapd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 4229, "channel": "uevent:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 970, "channel": "uevent:snapd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-400364679"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-866834182"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-1118001981"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1018, "channel": "uevent:systemd-logind"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 874, "channel": "uevent:systemd-network"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "uevent:-15116454"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 1, "channel": "uevent:systemd"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "genl:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "pid": 874, "channel": "genl:systemd-network"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "scsi-trans:kernel"}, {"netid": "nl", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "channel": "rdma:kernel"}, {"netid": "p_raw", "state": "UNCONN", "recv_q": 0, "send_q": 0, "peer_address": "*", "link_layer": "LLDP", "interface": "ens33"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "93066", "peer_address": "*", "peer_port": "0", "path": "/run/user/1000/systemd/notify"}, {"netid": "u_seq", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "20699", "peer_address": "*", "peer_port": "0", "path": "/run/udev/control"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "93069", "peer_address": "*", "peer_port": "0", "path": "/run/user/1000/systemd/private"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "93073", "peer_address": "*", "peer_port": "0", "path": "/run/user/1000/gnupg/S.dirmngr"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "93074", "peer_address": "*", "peer_port": "0", "path": "/run/user/1000/gnupg/S.gpg-agent"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "93075", "peer_address": "*", "peer_port": "0", "path": "/run/user/1000/gnupg/S.gpg-agent.extra"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "93076", "peer_address": "*", "peer_port": "0", "path": "/run/user/1000/gnupg/S.gpg-agent.ssh"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "93077", "peer_address": "*", "peer_port": "0", "path": "/run/user/1000/gnupg/S.gpg-agent.browser"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "20676", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/notify"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "20679", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/private"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "20689", "peer_address": "*", "peer_port": "0", "path": "/run/lvm/lvmetad.socket"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "20692", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/journal/stdout"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "20694", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/journal/socket"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "20701", "peer_address": "*", "peer_port": "0", "path": "/run/lvm/lvmpolld.socket"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "20891", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/journal/syslog"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "21046", "peer_address": "*", "peer_port": "0", "path": "/run/systemd/journal/dev-log"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "27320", "peer_address": "*", "peer_port": "0", "path": "/var/lib/lxd/unix.socket"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 32, "local_port": "25903", "peer_address": "*", "peer_port": "0", "path": "/var/run/vmware/guestServicePipe"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "27335", "peer_address": "*", "peer_port": "0", "path": "/run/acpid.socket"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "27345", "peer_address": "*", "peer_port": "0", "path": "/run/snapd.socket"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "27347", "peer_address": "*", "peer_port": "0", "path": "/run/snapd-snap.socket"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "27358", "peer_address": "*", "peer_port": "0", "path": "/var/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "27362", "peer_address": "*", "peer_port": "0", "path": "/var/run/docker.sock"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "27366", "peer_address": "*", "peer_port": "0", "path": "/run/uuidd/request"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "30955", "peer_address": "*", "peer_port": "0", "path": "/run/containerd/containerd.sock"}, {"netid": "u_str", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_port": "27357", "peer_address": "*", "peer_port": "0", "path": "@ISCSIADM_ABSTRACT_NAMESPACE"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "25672", "peer_address": "*", "peer_port": "25671", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29901", "peer_address": "*", "peer_port": "29903", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "25635", "peer_address": "*", "peer_port": "25636", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "25608", "peer_address": "*", "peer_port": "25610", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "93027", "peer_address": "*", "peer_port": "93023", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29596", "peer_address": "*", "peer_port": "29594", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29816", "peer_address": "*", "peer_port": "29515", "path": "/var/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "30026", "peer_address": "*", "peer_port": "30140", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "93030", "peer_address": "*", "peer_port": "21046", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "28214", "peer_address": "*", "peer_port": "28300", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "25674", "peer_address": "*", "peer_port": "25673", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "25671", "peer_address": "*", "peer_port": "25672", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "28301", "peer_address": "*", "peer_port": "28298", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "27703", "peer_address": "*", "peer_port": "27780", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29809", "peer_address": "*", "peer_port": "29810", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "30839", "peer_address": "*", "peer_port": "30840", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "28135", "peer_address": "*", "peer_port": "28299", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "25673", "peer_address": "*", "peer_port": "25674", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "28299", "peer_address": "*", "peer_port": "28135", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29594", "peer_address": "*", "peer_port": "29596", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "30140", "peer_address": "*", "peer_port": "30026", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "27623", "peer_address": "*", "peer_port": "27626", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "28298", "peer_address": "*", "peer_port": "28301", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "21255", "peer_address": "*", "peer_port": "21770", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "29734", "peer_address": "*", "peer_port": "21046", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29903", "peer_address": "*", "peer_port": "29901", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "93023", "peer_address": "*", "peer_port": "93027", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "25636", "peer_address": "*", "peer_port": "25635", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "25610", "peer_address": "*", "peer_port": "25608", "path": "/run/systemd/journal/stdout"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "93035", "peer_address": "*", "peer_port": "20694", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29515", "peer_address": "*", "peer_port": "29816", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 4, "send_q": 0, "local_port": "25485", "peer_address": "*", "peer_port": "25486", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "28300", "peer_address": "*", "peer_port": "28214", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "27780", "peer_address": "*", "peer_port": "27703", "path": "/run/systemd/journal/stdout"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "29808", "peer_address": "*", "peer_port": "21046", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "30840", "peer_address": "*", "peer_port": "30839", "path": "/var/run/dbus/system_bus_socket"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "62021", "peer_address": "*", "peer_port": "20694", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29810", "peer_address": "*", "peer_port": "29809", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "92910", "peer_address": "*", "peer_port": "21046", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "22601", "peer_address": "*", "peer_port": "22602", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "21485", "peer_address": "*", "peer_port": "20676", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "26725", "peer_address": "*", "peer_port": "26726", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "20678", "peer_address": "*", "peer_port": "20677", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "26709", "peer_address": "*", "peer_port": "20694", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29815", "peer_address": "*", "peer_port": "28703", "path": "/var/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "26886", "peer_address": "*", "peer_port": "26820", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "30141", "peer_address": "*", "peer_port": "30134", "path": "/run/systemd/journal/stdout"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "21731", "peer_address": "*", "peer_port": "20694", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "30635", "peer_address": "*", "peer_port": "30636", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "27361", "peer_address": "*", "peer_port": "29811", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "93067", "peer_address": "*", "peer_port": "93068", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "26726", "peer_address": "*", "peer_port": "26725", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "25780", "peer_address": "*", "peer_port": "0", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "93068", "peer_address": "*", "peer_port": "93067", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "30696", "peer_address": "*", "peer_port": "30695", "path": "/var/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "30134", "peer_address": "*", "peer_port": "30141", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29814", "peer_address": "*", "peer_port": "27995", "path": "/var/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "27993", "peer_address": "*", "peer_port": "27996", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "26820", "peer_address": "*", "peer_port": "26886", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "25668", "peer_address": "*", "peer_port": "20694", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "21770", "peer_address": "*", "peer_port": "21255", "path": "/run/systemd/journal/stdout"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "26959", "peer_address": "*", "peer_port": "20694", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "27996", "peer_address": "*", "peer_port": "27993", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "28703", "peer_address": "*", "peer_port": "29815", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "30695", "peer_address": "*", "peer_port": "30696", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "27995", "peer_address": "*", "peer_port": "29814", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29812", "peer_address": "*", "peer_port": "27364", "path": "/var/run/dbus/system_bus_socket"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "20677", "peer_address": "*", "peer_port": "20678", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "21558", "peer_address": "*", "peer_port": "21775", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "30636", "peer_address": "*", "peer_port": "30635", "path": "/var/run/dbus/system_bus_socket"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "26667", "peer_address": "*", "peer_port": "26668", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "163478", "peer_address": "*", "peer_port": "21046", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "27626", "peer_address": "*", "peer_port": "27623", "path": "/run/systemd/journal/stdout"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "28684", "peer_address": "*", "peer_port": "20694", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "26069", "peer_address": "*", "peer_port": "26068", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "26068", "peer_address": "*", "peer_port": "26069", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "26728", "peer_address": "*", "peer_port": "26727", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "26668", "peer_address": "*", "peer_port": "26667", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "21775", "peer_address": "*", "peer_port": "21558", "path": "/run/systemd/journal/stdout"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "27364", "peer_address": "*", "peer_port": "29812", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 768, "local_port": "25486", "peer_address": "*", "peer_port": "25485", "path": "*"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "26727", "peer_address": "*", "peer_port": "26728", "path": "*"}, {"netid": "u_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_port": "29811", "peer_address": "*", "peer_port": "27361", "path": "/var/run/dbus/system_bus_socket"}, {"netid": "u_dgr", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_port": "22602", "peer_address": "*", "peer_port": "22601", "path": "*"}, {"netid": "icmp6", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_address": "*", "local_port": "ipv6-icmp", "peer_address": "*", "peer_port": "*", "interface": "ens33"}, {"netid": "udp", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_address": "127.0.0.53", "local_port": "domain", "peer_address": "0.0.0.0", "peer_port": "*", "interface": "lo"}, {"netid": "udp", "state": "UNCONN", "recv_q": 0, "send_q": 0, "local_address": "192.168.71.131", "local_port": "bootpc", "peer_address": "0.0.0.0", "peer_port": "*", "interface": "ens33"}, {"netid": "tcp", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_address": "127.0.0.53", "local_port": "domain", "peer_address": "0.0.0.0", "peer_port": "*", "interface": "lo"}, {"netid": "tcp", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_address": "0.0.0.0", "local_port": "ssh", "peer_address": "0.0.0.0", "peer_port": "*"}, {"netid": "tcp", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_address": "127.0.0.1", "local_port": "35485", "peer_address": "0.0.0.0", "peer_port": "*"}, {"netid": "tcp", "state": "LISTEN", "recv_q": 0, "send_q": 128, "local_address": "[::]", "local_port": "ssh", "peer_address": "[::]", "peer_port": "*"}, {"netid": "v_str", "state": "ESTAB", "recv_q": 0, "send_q": 0, "local_address": "999900439", "local_port": "1023", "peer_address": "0", "peer_port": "976", "local_port_num": 1023, "peer_port_num": 976}] diff --git a/tests/fixtures/ubuntu-18.04/ss-sudo-a.out b/tests/fixtures/ubuntu-18.04/ss-sudo-a.out new file mode 100644 index 00000000..d7b878f8 --- /dev/null +++ b/tests/fixtures/ubuntu-18.04/ss-sudo-a.out @@ -0,0 +1,159 @@ +Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port +nl UNCONN 0 0 rtnl:kernel * +nl UNCONN 0 0 rtnl:systemd-resolve/893 * +nl UNCONN 0 0 rtnl:systemd/1 * +nl UNCONN 0 0 rtnl:systemd-resolve/893 * +nl UNCONN 0 0 rtnl:systemd/1 * +nl UNCONN 768 0 tcpdiag:kernel * +nl UNCONN 4352 0 tcpdiag:ss/25293 * +nl UNCONN 0 0 selinux:kernel * +nl UNCONN 0 0 iscsi:kernel * +nl UNCONN 0 0 audit:-1100095455 * +nl UNCONN 0 0 audit:kernel * +nl UNCONN 0 0 audit:sudo/25292 * +nl UNCONN 0 0 audit:systemd/1 * +nl UNCONN 0 0 audit:systemd/1 * +nl UNCONN 0 0 fiblookup:kernel * +nl UNCONN 0 0 connector:kernel * +nl UNCONN 0 0 uevent:-15116454 * +nl UNCONN 0 0 uevent:systemd-logind/1018 * +nl UNCONN 0 0 uevent:systemd/4229 * +nl UNCONN 0 0 uevent:systemd/1 * +nl UNCONN 0 0 uevent:-866834182 * +nl UNCONN 0 0 uevent:-1118001981 * +nl UNCONN 0 0 uevent:-400364679 * +nl UNCONN 0 0 uevent:systemd-network/874 * +nl UNCONN 0 0 uevent:kernel * +nl UNCONN 0 0 uevent:snapd/970 * +nl UNCONN 0 0 uevent:systemd/4229 * +nl UNCONN 0 0 uevent:snapd/970 * +nl UNCONN 0 0 uevent:-400364679 * +nl UNCONN 0 0 uevent:-866834182 * +nl UNCONN 0 0 uevent:-1118001981 * +nl UNCONN 0 0 uevent:systemd-logind/1018 * +nl UNCONN 0 0 uevent:systemd-network/874 * +nl UNCONN 0 0 uevent:-15116454 * +nl UNCONN 0 0 uevent:systemd/1 * +nl UNCONN 0 0 genl:kernel * +nl UNCONN 0 0 genl:systemd-network/874 * +nl UNCONN 0 0 scsi-trans:kernel * +nl UNCONN 0 0 rdma:kernel * +p_raw UNCONN 0 0 LLDP:ens33 * +u_dgr UNCONN 0 0 /run/user/1000/systemd/notify 93066 * 0 +u_seq LISTEN 0 128 /run/udev/control 20699 * 0 +u_str LISTEN 0 128 /run/user/1000/systemd/private 93069 * 0 +u_str LISTEN 0 128 /run/user/1000/gnupg/S.dirmngr 93073 * 0 +u_str LISTEN 0 128 /run/user/1000/gnupg/S.gpg-agent 93074 * 0 +u_str LISTEN 0 128 /run/user/1000/gnupg/S.gpg-agent.extra 93075 * 0 +u_str LISTEN 0 128 /run/user/1000/gnupg/S.gpg-agent.ssh 93076 * 0 +u_str LISTEN 0 128 /run/user/1000/gnupg/S.gpg-agent.browser 93077 * 0 +u_dgr UNCONN 0 0 /run/systemd/notify 20676 * 0 +u_str LISTEN 0 128 /run/systemd/private 20679 * 0 +u_str LISTEN 0 128 /run/lvm/lvmetad.socket 20689 * 0 +u_str LISTEN 0 128 /run/systemd/journal/stdout 20692 * 0 +u_dgr UNCONN 0 0 /run/systemd/journal/socket 20694 * 0 +u_str LISTEN 0 128 /run/lvm/lvmpolld.socket 20701 * 0 +u_dgr UNCONN 0 0 /run/systemd/journal/syslog 20891 * 0 +u_dgr UNCONN 0 0 /run/systemd/journal/dev-log 21046 * 0 +u_str LISTEN 0 128 /var/lib/lxd/unix.socket 27320 * 0 +u_str LISTEN 0 32 /var/run/vmware/guestServicePipe 25903 * 0 +u_str LISTEN 0 128 /run/acpid.socket 27335 * 0 +u_str LISTEN 0 128 /run/snapd.socket 27345 * 0 +u_str LISTEN 0 128 /run/snapd-snap.socket 27347 * 0 +u_str LISTEN 0 128 /var/run/dbus/system_bus_socket 27358 * 0 +u_str LISTEN 0 128 /var/run/docker.sock 27362 * 0 +u_str LISTEN 0 128 /run/uuidd/request 27366 * 0 +u_str LISTEN 0 128 /run/containerd/containerd.sock 30955 * 0 +u_str LISTEN 0 128 @ISCSIADM_ABSTRACT_NAMESPACE 27357 * 0 +u_dgr UNCONN 0 0 * 25672 * 25671 +u_str ESTAB 0 0 * 29901 * 29903 +u_str ESTAB 0 0 * 25635 * 25636 +u_str ESTAB 0 0 * 25608 * 25610 +u_str ESTAB 0 0 /run/systemd/journal/stdout 93027 * 93023 +u_str ESTAB 0 0 /run/systemd/journal/stdout 29596 * 29594 +u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 29816 * 29515 +u_str ESTAB 0 0 * 30026 * 30140 +u_dgr UNCONN 0 0 * 93030 * 21046 +u_str ESTAB 0 0 * 28214 * 28300 +u_dgr UNCONN 0 0 * 25674 * 25673 +u_dgr UNCONN 0 0 * 25671 * 25672 +u_str ESTAB 0 0 /run/systemd/journal/stdout 28301 * 28298 +u_str ESTAB 0 0 * 27703 * 27780 +u_str ESTAB 0 0 * 29809 * 29810 +u_str ESTAB 0 0 * 30839 * 30840 +u_str ESTAB 0 0 * 28135 * 28299 +u_dgr UNCONN 0 0 * 25673 * 25674 +u_str ESTAB 0 0 /run/systemd/journal/stdout 28299 * 28135 +u_str ESTAB 0 0 * 29594 * 29596 +u_str ESTAB 0 0 /run/systemd/journal/stdout 30140 * 30026 +u_str ESTAB 0 0 * 27623 * 27626 +u_str ESTAB 0 0 * 28298 * 28301 +u_str ESTAB 0 0 * 21255 * 21770 +u_dgr UNCONN 0 0 * 29734 * 21046 +u_str ESTAB 0 0 /run/systemd/journal/stdout 29903 * 29901 +u_str ESTAB 0 0 * 93023 * 93027 +u_str ESTAB 0 0 /run/systemd/journal/stdout 25636 * 25635 +u_str ESTAB 0 0 /run/systemd/journal/stdout 25610 * 25608 +u_dgr UNCONN 0 0 * 93035 * 20694 +u_str ESTAB 0 0 * 29515 * 29816 +u_dgr UNCONN 4 0 * 25485 * 25486 +u_str ESTAB 0 0 /run/systemd/journal/stdout 28300 * 28214 +u_str ESTAB 0 0 /run/systemd/journal/stdout 27780 * 27703 +u_dgr UNCONN 0 0 * 29808 * 21046 +u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 30840 * 30839 +u_dgr UNCONN 0 0 * 62021 * 20694 +u_str ESTAB 0 0 * 29810 * 29809 +u_dgr UNCONN 0 0 * 92910 * 21046 +u_dgr UNCONN 0 0 * 22601 * 22602 +u_dgr UNCONN 0 0 * 21485 * 20676 +u_dgr UNCONN 0 0 * 26725 * 26726 +u_dgr UNCONN 0 0 * 20678 * 20677 +u_dgr UNCONN 0 0 * 26709 * 20694 +u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 29815 * 28703 +u_str ESTAB 0 0 /run/systemd/journal/stdout 26886 * 26820 +u_str ESTAB 0 0 /run/systemd/journal/stdout 30141 * 30134 +u_dgr UNCONN 0 0 * 21731 * 20694 +u_str ESTAB 0 0 * 30635 * 30636 +u_str ESTAB 0 0 * 27361 * 29811 +u_dgr UNCONN 0 0 * 93067 * 93068 +u_dgr UNCONN 0 0 * 26726 * 26725 +u_dgr UNCONN 0 0 * 25780 * 0 +u_dgr UNCONN 0 0 * 93068 * 93067 +u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 30696 * 30695 +u_str ESTAB 0 0 * 30134 * 30141 +u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 29814 * 27995 +u_str ESTAB 0 0 * 27993 * 27996 +u_str ESTAB 0 0 * 26820 * 26886 +u_dgr UNCONN 0 0 * 25668 * 20694 +u_str ESTAB 0 0 /run/systemd/journal/stdout 21770 * 21255 +u_dgr UNCONN 0 0 * 26959 * 20694 +u_str ESTAB 0 0 /run/systemd/journal/stdout 27996 * 27993 +u_str ESTAB 0 0 * 28703 * 29815 +u_str ESTAB 0 0 * 30695 * 30696 +u_str ESTAB 0 0 * 27995 * 29814 +u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 29812 * 27364 +u_dgr UNCONN 0 0 * 20677 * 20678 +u_str ESTAB 0 0 * 21558 * 21775 +u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 30636 * 30635 +u_str ESTAB 0 0 * 26667 * 26668 +u_dgr UNCONN 0 0 * 163478 * 21046 +u_str ESTAB 0 0 /run/systemd/journal/stdout 27626 * 27623 +u_dgr UNCONN 0 0 * 28684 * 20694 +u_str ESTAB 0 0 /run/systemd/journal/stdout 26069 * 26068 +u_str ESTAB 0 0 * 26068 * 26069 +u_dgr UNCONN 0 0 * 26728 * 26727 +u_str ESTAB 0 0 /run/systemd/journal/stdout 26668 * 26667 +u_str ESTAB 0 0 /run/systemd/journal/stdout 21775 * 21558 +u_str ESTAB 0 0 * 27364 * 29812 +u_dgr UNCONN 0 768 * 25486 * 25485 +u_dgr UNCONN 0 0 * 26727 * 26728 +u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 29811 * 27361 +u_dgr UNCONN 0 0 * 22602 * 22601 +icmp6 UNCONN 0 0 *%ens33:ipv6-icmp *:* +udp UNCONN 0 0 127.0.0.53%lo:domain 0.0.0.0:* +udp UNCONN 0 0 192.168.71.131%ens33:bootpc 0.0.0.0:* +tcp LISTEN 0 128 127.0.0.53%lo:domain 0.0.0.0:* +tcp LISTEN 0 128 0.0.0.0:ssh 0.0.0.0:* +tcp LISTEN 0 128 127.0.0.1:35485 0.0.0.0:* +tcp LISTEN 0 128 [::]:ssh [::]:* +v_str ESTAB 0 0 999900439:1023 0:976 diff --git a/tests/test_ss.py b/tests/test_ss.py new file mode 100644 index 00000000..05335824 --- /dev/null +++ b/tests/test_ss.py @@ -0,0 +1,40 @@ +import os +import json +import unittest +import jc.parsers.ss + +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) + + +class MyTests(unittest.TestCase): + + def setUp(self): + # input + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ss-sudo-a.out'), 'r') as f: + self.centos_7_7_ss_sudo_a = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ss-sudo-a.out'), 'r') as f: + self.ubuntu_18_4_ss_sudo_a = f.read() + + # output + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ss-sudo-a.json'), 'r') as f: + self.centos_7_7_ss_sudo_a_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ss-sudo-a.json'), 'r') as f: + self.ubuntu_18_4_ss_sudo_a_json = json.loads(f.read()) + + def test_ss_sudo_a_centos_7_7(self): + """ + Test 'sudo ss -a' on Centos 7.7 + """ + self.assertEqual(jc.parsers.ss.parse(self.centos_7_7_ss_sudo_a, quiet=True), self.centos_7_7_ss_sudo_a_json) + + def test_ss_sudo_a_ubuntu_18_4(self): + """ + Test 'sudo ss -a' on Ubuntu 18.4 + """ + self.assertEqual(jc.parsers.ss.parse(self.ubuntu_18_4_ss_sudo_a, quiet=True), self.ubuntu_18_4_ss_sudo_a_json) + + +if __name__ == '__main__': + unittest.main()