# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only

# TODO: Rethink this profile. Should not be called by another profile.

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/sysctl
profile sysctl @{exec_path} {
  include <abstractions/base>
  include <abstractions/consoles>

  capability net_admin,
  capability sys_admin,
  capability sys_resource,

  @{exec_path} mr,

  /etc/sysctl.conf r,
  /etc/sysctl.d/{,**} r,
  /usr/lib/sysctl.d/{,**} r,

  @{PROC}/sys/ r,
  @{PROC}/sys/** rw,

  # Inherit Silencer
  deny network inet6 stream,
  deny network inet stream,

  /etc/ufw/sysctl.conf r, # Add support for ufw

  include if exists <local/sysctl>
}

# vim:syntax=apparmor
