# Basic profile for dotnet
# Should work without modifications with Ubuntu/Debian packages
# Author: Darknet Villain <supervillain@riseup.net>
#
#include <tunables/global>

/usr/sbin/dotnet {
  #include <abstractions/base>

  network inet dgram,
  network inet stream,
  network inet6 dgram,
  network inet6 stream,
  network netlink raw,

  /etc/gai.conf r,
  /etc/host.conf r,
  /etc/hosts r,
  /etc/nsswitch.conf r,
  /etc/resolv.conf r,
  /run/resolvconf/resolv.conf r,
  /run/systemd/resolve/stub-resolv.conf r,

  # path specific (feel free to modify if you have another paths)
  /etc/dotnet/** r,
  /run/dotnet/dotnet.pid rwk,
  /var/lib/dotnet/** rw,
  /var/log/dotnet/dotnet.log w,
  /var/run/dotnet/dotnet.pid rwk,
  /usr/sbin/dotnet mr,
  /usr/share/dotnet/** r,

  # user homedir (if started not by init.d or systemd)
  owner @{HOME}/.dotnet/   rw,
  owner @{HOME}/.dotnet/** rwk,
}