Ubuntu Server Guide Changes, errors and bugs
– Stopping the program. –
Download 1.27 Mb. Pdf ko'rish
|
ubuntu-server-guide
- Bu sahifa navigatsiya:
- Further pre-existing Profiles
- Checking and debugging denies
– Stopping the program.
– Reloading the program. – Testing all the commands supported by the init script. • Generate the new profile: Use aa-genprof to generate a new profile. From a terminal: sudo aa−g e n p r o f e x e c u t a b l e For example: 83 sudo aa−g e n p r o f s l a p d • To get your new profile included in the apparmor-profiles package, file a bug in Launchpad against the AppArmor package: – Include your test plan and test cases. – Attach your new profile to the bug. Updating Profiles When the program is misbehaving, audit messages are sent to the log files. The program aa-logprof can be used to scan log files for AppArmor audit messages, review them and update the profiles. From a terminal: sudo aa−l o g p r o f Further pre-existing Profiles The packages apport−profiles and apparmor−profiles−extra ship some experimental profiles for AppArmor security policies. Do not expect these profiles to work out-of-the-box, but they can give you a head start when trynig to create a new profile by starting off a base that exists. These profiles are not considered mature enough to be shipped in enforce mode by default. Therefore they are shipped in complain mode so that users can test them, choose which are desired, and help improve them upstream if needed. Some even more experimental profiles carried by the package are placed in/usr/share/doc/apparmor−profiles /extras/ Checking and debugging denies You will see in ‘dmesg’ and any log that collects kernel messages if you have hit a deny. Right away it is worth to know that this will cover any access that was denied because it was not allowed, but explicit denies will put no message in your logs at all. Examples might look like: [ 1 5 2 1 0 5 6 . 5 5 2 0 3 7 ] a u d i t : type =1400 a u d i t ( 1 5 7 1 8 6 8 4 0 2 . 3 7 8 : 2 4 4 2 5 ) : apparmor=” DENIED” o p e r a t i o n =”open ” p r o f i l e =”/ u s r / s b i n / cups−browsed ” name=”/ var / l i b / l i b v i r t / dnsmasq /” p i d =1128 comm=”cups−browsed ” requested_mask=”r ” denied_mask=”r ” f s u i d =0 o u i d=0 [ 1 4 8 2 1 0 6 . 6 5 1 5 2 7 ] a u d i t : type =1400 a u d i t ( 1 5 7 1 8 2 9 4 5 2 . 3 3 0 : 2 4 3 2 3 ) : apparmor=” DENIED” o p e r a t i o n =”sendmsg ” p r o f i l e =”snap . l x d . l x c ” p i d =24115 comm=” l x c ” l a d d r = 1 0 . 7 . 0 . 6 9 l p o r t =48796 f a d d r = 1 0 . 7 . 0 . 2 3 1 f p o r t =445 f a m i l y =” i n e t ” sock_type=”stream ” p r o t o c o l =6 requested_mask=”send ” denied_mask=”send ” That follows a generic structure starting with a timestamp, an audit tag and the category apparmor=” DENIED”. From the following fields you can derive what was going on and why it was failing. In the examples above that would be First example: * operation: open (program tried to open a file) * profile: /usr/sbin/cups−browsed (you’ll find /etc/apparmor.d/usr.bin.cups−browsed) * name: /var/lib/ libvirt /dnsmasq (what it wanted to access) * pid/comm: the program that did trigger the access * requested_mask/denied_mask/fsuid/ouid: parameters of that open call 84 Second example: * operation: sendmsg (program tried send via network) * profile: snap.lxd. lxc (snaps are special, you’ll find /var/lib/snapd/apparmor/profiles/snap.lxd.lxc) * pid/comm: the program that did trigger the access * laddr/lport/faddr/fport/family/sock_type/protocol: parameters of that sendmsg call That way you know in which profile and at what action you have to start if you consider either debugging or adapting the profiles. Download 1.27 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling