# vim: ft=apparmor

abi <abi/5.0>,

include <tunables/global>

profile oauth2-proxy /usr/sbin/oauth2-proxy {
  include <abstractions/base>
  include <abstractions/ssl_certs>
  include <abstractions/nameservice-strict>

  /usr/sbin/oauth2-proxy rm,

  network inet dgram,
  network inet stream,
  network inet6 dgram,
  network inet6 stream,

  /etc/oauth2-proxy/ r,
  /etc/oauth2-proxy/* r,

  owner /var/lib/oauth2-proxy/ r,
  owner /var/lib/oauth2-proxy/** r,

  owner /proc/@{pids}/{cgroup,mountinfo} r,
  /proc/sys/net/core/somaxconn r,

  include if exists <local/oauth2-proxy>
}

