Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Deutsches Forum (German) Deutsche Dokumentation
  • Search

D6 AppArmor Profile für Daemons

Dokumentation, Tipps und Tricks.
Post Reply
  • Print view
Advanced search
5 posts • Page 1 of 1
Author
Message
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

D6 AppArmor Profile für Daemons

  • Quote

Post by pietinger » Sat Nov 28, 2020 9:53 pm

(Dieser Post ist Teil einer Installation-Anleitung. Falls nicht schon geschehen lies bitte: Installation Guide for Paranoid Dummies Post Nr. 3)



D.6 AppArmor Profile für Daemons


Ich biete Dir hier kein Profil für den "sshd". Ich habe nicht einmal versucht diesen mit einem AA-Profil zu sichern, weil ich der Meinung bin, dass ein laufender SSHD anderweitig gesichert werden muss: Entweder erlaubst Du (mittels Deiner FireWall) nur Zugang von vertrauenswürdigen Admin-Stations von Deinem lokalen Netzwerk und blockst jeglichen Versuch von anderen Netzen, ODER falls Du wirklich aus dem Internet auf den sshd gehen willst, dann mach das NUR über eine VPN-Leitung ! Alles andere ist für mich Harakiri.

  • Profile: /etc/apparmor.d/usr.sbin.privoxy
  • Beschreibung/Bemerkung: Wie Du siehst ist der Privoxy ein ganz ein braver :-) Die Capabilites braucht er damit er den root abgeben kann um dann als User privoxy zu laufen.

Code: Select all

# version 1

abi <kernel>,

profile privoxy /usr/sbin/privoxy
{
include <local/ONLYNETWORK>
capability setgid,
capability setuid,
/run/privoxy.pid  rw,
/var/log/privoxy/privoxy.log  rw,
}
  • Profile: /etc/apparmor.d/sbin.dhcpcd
  • Beschreibung/Bemerkung: Ich bin der Meinung dass dynamische IP-Adresszuweisung nur von Unternehmen mit großen Client-Netzen benötigt wird und für einen privaten Anwender statische IP-Adressen sinnvoller und einfacher zu handeln sind. Ich konnte dieses Profil daher nur rudimentär prüfen. Dabei ist mir aufgefallen, dass der dhcpcd in der Lage ist meine FW zu umgehen ... Ich mag ihn nicht ...

Code: Select all

# version 1

abi <kernel>,

profile dhcpcd /sbin/dhcpcd
{
include <local/ONLYNETWORK>
include <local/USECONSOLE>
/bin/hostname  ix,
/bin/rm  ix,
/bin/sed  ix,
/lib/dhcpcd/**  rix,
/usr/bin/cmp  ix,
capability dac_override,
capability net_admin,
capability net_bind_service,
capability net_raw,
/etc/resolv.conf  rw,
/run/dhcpcd.pid  krw,
/run/dhcpcd.sock  krw,
/run/dhcpcd.unpriv.sock  rw,
/run/dhcpcd/**  rw,
/var/lib/dhcpcd/*  rw,
}
  • Profile: /etc/apparmor.d/usr.sbin.ntpdate
  • Beschreibung/Bemerkung: Ich habe überlegt ob er hier oder eigentlich nach D.7 gehört. Weil er aber von /etc/init.d/ntp-client gestartet wird, habe ich ihn hier rein.

Code: Select all

# version 1

abi <kernel>,

profile ntpdate /usr/sbin/ntpdate
{
include <local/ONLYNETWORK>
capability sys_time,
capability sys_nice,
}
Du bist herzlich eingeladen diesen Thread mit Deinen Profilen zu erweitern.

.
Last edited by pietinger on Mon Nov 30, 2020 9:20 pm, edited 1 time in total.
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Mon Nov 30, 2020 8:51 pm

Dieses Profil ist vermutlich veraltet ! (Da ich kein Update auf die neue Version des ddclient gemacht habe, konnte ich es nicht anpassen.)
  • Profile: /etc/apparmor.d/usr.bin.ddclient
  • Beschreibung/Bemerkung: Jo, mei, der ddclient halt aus /etc/init.d/ddclient.

Code: Select all

# version 1

abi <kernel>,

profile ddclient /usr/bin/ddclient
{
include <local/ONLYNETWORK>
/usr/bin/ddclient  r,
/run/ddclient/ddclient.pid  rwk,
/var/cache/ddclient/**  rw,
}
.
Last edited by pietinger on Tue Apr 18, 2023 11:56 pm, edited 1 time in total.
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Sun Dec 13, 2020 12:36 am

  • Profile: /etc/apparmor.d/usr.sbin.unbound
  • Beschreibung/Bemerkung: Der DNS-Server unbound mit einer Konfiguration wie in B.6 beschrieben.

Code: Select all

# version 1

abi <kernel>,

profile unbound /usr/sbin/unbound
{
include <local/ONLYNETWORK>
capability net_bind_service,
capability setgid,
capability setuid,
capability sys_chroot,
capability sys_resource,
/run/unbound.pid  rw,
}
.
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Mon Apr 03, 2023 3:44 pm

  • Profile: /etc/apparmor.d/usr.sbin.chronyd
  • Beschreibung/Bemerkung: Der NTP-Client/-Server chrony mit einer Konfiguration wie im 5. Post von A.3 beschrieben.

Code: Select all

# version 1

abi <kernel>,

profile chronyd /usr/sbin/chronyd
{
include <local/ONLYNETWORK>
capability sys_time,
capability sys_nice,
capability dac_read_search,
capability dac_override,
capability net_bind_service,
capability setgid,
capability setuid,
/run/chrony/*  rwk,
/var/lib/chrony/*  rwk,
}
.
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

Achtung Umstellung auf merged-usr

  • Quote

Post by pietinger » Wed Apr 03, 2024 1:53 pm

Achtung: Umstellung auf merged-usr

... sorgt für eine böse Überraschung: Einige Profile wurden nicht mehr geladen ... weil ... der Pfad nicht mehr stimmt !

Betroffen sind alle Profile die früher in /usr/sbin/... waren. Leider ist das nach einer Umstellung von split-usr auf merged-usr nicht mehr der Fall, weil /usr/sbin nur noch ein Link auf /usr/bin ist. Wir haben ja in D.4 gelernt dass AppArmor solche Links nicht beachtet ...

Ich musste daher in drei meiner eingesetzten Profilen den Aufruf ändern (das ist die dritte Zeile im jeweiligen Profil):

Code: Select all

profile chronyd /usr/bin/chronyd

profile privoxy /usr/bin/privoxy

profile unbound /usr/bin/unbound
Natürlich habe ich dann den Namen des Profils auch noch geändert obwohl dies nicht zwingend nötig wäre; es soll aber alles seine gute Ordnung haben:

Code: Select all

# lal
...
drwx------  2 root root 4096  7. Mai 2023  local
...
-rw-r--r--  1 root root  299  3. Apr 15:39 usr.bin.chronyd
...
-rw-r--r--  1 root root  187  3. Apr 15:40 usr.bin.privoxy
...
-rw-r--r--  1 root root  230  3. Apr 15:40 usr.bin.unbound
https://wiki.gentoo.org/wiki/User:Pietinger --> https://wiki.gentoo.org/wiki/User:Pieti ... _at_Gentoo
Top
Post Reply
  • Print view

5 posts • Page 1 of 1

Return to “Deutsche Dokumentation”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy