abi <abi/3.0>,

include <tunables/global>

profile wireshark-tshark /usr/bin/tshark {
  include <abstractions/wireshark>
  include <abstractions/wireshark-exec>

  /usr/bin/tshark rm,

  include if exists <local/wireshark-tshark>
}

profile wireshark /usr/bin/wireshark {
  include <abstractions/wireshark>
  include <abstractions/wireshark-exec>

  include <abstractions/X>
  include <abstractions/gtk>
  include <abstractions/qt6>
  include <abstractions/fonts>
  include <abstractions/freedesktop.org>
  include <abstractions/dconf>

  network,

  /proc/@{pid}/net/dev r,

  /usr/bin/wireshark rm,

  owner @{HOME}/.config/wireshark/** rwlk,

  /etc/libnl/classid r,
  /usr/share/icu/[0-9]*.[0-9]*/*.dat r,

  include if exists <local/wireshark>
}

profile wireshark-tool-dumpcap /usr/bin/dumpcap {
  include <abstractions/wireshark-tools>

  /usr/bin/dumpcap rm,

  network,
  capability net_admin,
  capability net_raw,

  /sys/devices/pci*/**/net/*/type r,
  /sys/devices/virtual/net/*/type r,

  include if exists <local/wireshark-tool-dumpcap>
}

profile wireshark-tool-androiddump /usr/lib{,64}/wireshark/extcap/androiddump {
  include  <abstractions/wireshark-tools>

  /usr/lib{,64}/wireshark/extcap/androiddump rm,

  network inet stream,
  network inet6 stream,

  include if exists <local/wireshark-tool-androiddump>
}


profile wireshark-tool-ciscodump /usr/lib{,64}/wireshark/extcap/ciscodump {
  include  <abstractions/wireshark-tools>
  include <abstractions/nameservice-strict>

  /usr/lib{,64}/wireshark/extcap/ciscodump rm,

  network netlink raw,

  include if exists <local/wireshark-tool-ciscodump>
}


profile wireshark-tool-dpauxmon /usr/lib{,64}/wireshark/extcap/dpauxmon {
  include  <abstractions/wireshark-tools>

  /usr/lib{,64}/wireshark/extcap/dpauxmon rm,

  include if exists <local/wireshark-tool-dpauxmon>
}


profile wireshark-tool-randpktdump /usr/lib{,64}/wireshark/extcap/randpktdump {
  include  <abstractions/wireshark-tools>

  /usr/lib{,64}/wireshark/extcap/randpktdump rm,

  include if exists <local/wireshark-tool-dpauxmon>
}


profile wireshark-tool-sdjournal /usr/lib{,64}/wireshark/extcap/sdjournal {
  include  <abstractions/wireshark-tools>

  /usr/lib{,64}/wireshark/extcap/sdjournal rm,

  include if exists <local/wireshark-tool-sdjournal>
}


profile wireshark-tool-sshdump /usr/lib{,64}/wireshark/extcap/sshdump {
  include  <abstractions/wireshark-tools>

  /usr/lib{,64}/wireshark/extcap/sshdump rm,

  network netlink raw,

  include if exists <local/wireshark-tool-sshdump>
}


profile wireshark-tool-udpdump /usr/lib{,64}/wireshark/extcap/udpdump {
  include  <abstractions/wireshark-tools>

  /usr/lib{,64}/wireshark/extcap/udpdump rm,

  include if exists <local/wireshark-tool-udpdump>
}


profile wireshark-tool-wifidump /usr/lib{,64}/wireshark/extcap/wifidump {
  include  <abstractions/wireshark-tools>

  /usr/lib{,64}/wireshark/extcap/wifidump rm,

  include if exists <local/wireshark-tool-wifidump>
}

