socat: update profile

- Follow profile guideline
 - Change copyright texts
 - Update to use abi 3.0
 - Use `ssl_certs` and `console` abstractions instead of explicit rules

Signed-off-by: Nishit Majithia <nishit.nm@gmail.com>
This commit is contained in:
Nishit Majithia 2024-08-30 18:22:22 +05:30
parent 90e24aa429
commit b9eb783338

View file

@ -1,20 +1,18 @@
#------------------------------------------------------------------ # apparmor.d - Full set of apparmor profiles
# Author: Nishit Majithia (nishitm) # Copyright (C) 2024 Nishit Majithia (nishitm)
# # SPDX-License-Identifier: GPL-2.0-only
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
# SPDX-License-Identifier: GPL-2.0-only
#------------------------------------------------------------------
# vim: ft=apparmor # vim: ft=apparmor
abi <abi/4.0>, abi <abi/3.0>,
include <tunables/global> include <tunables/global>
profile socat /usr/bin/socat { @{exec_path} = /usr/bin/socat
profile socat @{exec_path} {
include <abstractions/base> include <abstractions/base>
include <abstractions/nameservice-strict> include <abstractions/nameservice-strict>
include <abstractions/ssl_certs>
include <abstractions/consoles>
capability dac_read_search, capability dac_read_search,
capability dac_override, capability dac_override,
@ -32,27 +30,17 @@ profile socat /usr/bin/socat {
network, network,
# Enale /dev/ptmx access for testsuite # Enale /dev/ptmx access for testsuite
# file rw /dev/ptmx, # /dev/ptmx rw,
# file rw /dev/pts/*,
# TUN/TAP device # TUN/TAP device
file rw /dev/net/tun, /dev/net/tun rw,
# Process-specific access # Process-specific access
file rw @{PROC}/@{pid}/fd/*, @{PROC}/@{pid}/fdinfo/@{int} rw,
file r @{PROC}/@{pid}/stat, @{PROC}/@{pid}/stat r,
# Allow reading from /dev/tty # For bi-directional communication between vms and host/hypervisor
file rw /dev/tty, /dev/vsock r,
# Allow reading /dev/vsock
file r /dev/vsock,
# certs/keys can be are stored in:
# - /etc/ssl/certs/*.{key,crt}
# - $HOME/.cert/**/*.pem
file r /etc/ssl/certs/{,*.{key,crt}},
file r @{HOME}/.certs/{,**},
# Site-specific additions and overrides. See local/README for details. # Site-specific additions and overrides. See local/README for details.
include if exists <local/socat> include if exists <local/socat>