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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/ksecretd
@{att} = /att/ksecretd/
profile ksecretd /{,usr/}bin/ksecretd flags=(attach_disconnected,attach_disconnected.path=@{att},mediate_deleted) {
  include <abstractions/attached/base>
  include <abstractions/kde-strict>
  include <abstractions/graphics>

  @{exec_path} mr,

  owner @{user_config_dirs}/kwalletrc r,

  owner @{user_share_dirs}/kwalletd/ rw,
  owner @{user_share_dirs}/kwalletd/** rwkl -> @{user_share_dirs}/kwalletd/#@{int},

  owner @{run}/user/@{uid}/kwallet5.socket rw,

  @{PROC}/sys/kernel/random/boot_id r,

  /dev/tty r,

  include if exists <local/ksecretd>
}

# vim:syntax=apparmor
