Wilders Security Forums  

Go Back   Wilders Security Forums > Software, Hardware and General Services > all things UNIX
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread
  #126  
Old September 18th, 2012, 10:00 PM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Anyone using Apparmor?

Native Client Helper

Quote:
# Last Modified: Sat Mar 31 04:24:18 2012
#include <tunables/global>

/opt/google/chrome/nacl_helper_bootstrap {
#include <abstractions/base>


deny capability dac_override,
deny capability dac_read_search,
deny capability chown,
deny capability fsetid,
deny capability setgid,
deny capability setuid,
deny capability sys_admin,
deny capability sys_chroot,
deny capability sys_ptrace,


/opt/google/chrome/nacl_helper mr,
/opt/google/chrome/nacl_irt_x86_64.nexe r,
/run/shm/* mrw,
/sys/devices/system/cpu/cpu0/** r,
owner /tmp/** mwr,

network inet tcp,
network inet6 tcp,
}

Chrome Sandbox

Quote:
# Last Modified: Wed Sep 19 08:34:21 2012
#include <tunables/global>

/opt/google/chrome/chrome-sandbox {
# Be fanatical since it is setuid root and don't use an abstraction
/lib/libgcc_s.so* mr,
/lib{,32,64}/libm-*.so* mr,
/lib/@{multiarch}/libm-*.so* mr,
/lib{,32,64}/libpthread-*.so* mr,
/lib/@{multiarch}/libpthread-*.so* mr,
/lib{,32,64}/libc-*.so* mr,
/lib/@{multiarch}/libc-*.so* mr,
/lib{,32,64}/libld-*.so* mr,
/lib/@{multiarch}/libld-*.so* mr,
/lib{,32,64}/ld-*.so* mr,
/lib/@{multiarch}/ld-*.so* mr,
/lib/tls/*/{cmov,nosegneg}/libm-*.so* mr,
/lib/tls/*/{cmov,nosegneg}/libpthread-*.so* mr,
/lib/tls/*/{cmov,nosegneg}/libc-*.so* mr,
/usr/lib/libstdc++.so* mr,
/etc/ld.so.cache r,

# Required for dropping into PID namespace. Keep in mind that until the
# process drops this capability it can escape confinement, but once it
# drops CAP_SYS_ADMIN we are ok.
capability sys_admin,

# All of these are for sanely dropping from root and chrooting
capability chown,
capability fsetid,
capability setgid,
capability setuid,
capability dac_override,
capability sys_chroot,

# *Sigh*
capability sys_ptrace,

@{PROC}/ r,
@{PROC}/[0-9]*/ r,
@{PROC}/[0-9]*/fd/ r,
@{PROC}/[0-9]*/oom_adj w,
@{PROC}/[0-9]*/oom_score_adj w,
@{PROC}/[0-9]*/task/[0-9]*/stat r,

/opt/google/chrome r,
/opt/google/chrome/chrome Px,
/opt/google/chrome/chrome-sandbox r,

owner /tmp/** rw,
}

Chrome

Quote:
# Last Modified: Wed Sep 19 16:18:52 2012
#include <tunables/global>

/opt/google/chrome/chrome {

capability sys_ptrace

network inet stream,
network inet tcp,
network inet6 stream,
network inet6 tcp,

deny /usr/bin/lsb_release x,

/opt/google/chrome/google-chrome ixr,


/usr/lib/libdee-*.so.* mr,
/usr/lib/libicui18n.so.* r,
/usr/lib/libunity.so.* mr,

/dev/ r,
/dev/dri/card* rw,
/dev/null rw,
/dev/ptmx rw,
/dev/random r,
/dev/snd/controlC* rw,
/dev/snd/pcm* rw,
/dev/snd/timer r,
/dev/urandom r,
/dev/video* r,
/etc/fonts/** r,
/etc/gai.conf r,
/etc/group r,
/etc/host.conf r,
/etc/hosts mr,
/etc/ld.so.cache mr,
/etc/locale.alias r,
/etc/localtime r,
/etc/lsb-release r,
/etc/mtab r,
/etc/nss_mdns.conf r,
/etc/nsswitch.conf r,
/etc/opt/chrome/policies/managed/ r,
/etc/opt/chrome/policies/managed/test_policy.json r,
/etc/opt/chrome/policies/recommended/ r,
/etc/passwd mr,
/etc/protocols r,
/etc/pulse/client.conf r,
/etc/python*/sitecustomize.py r,
/etc/resolvconf/run/resolv.conf r,
/etc/samba/lmhosts r,
/etc/services r,
/etc/udev/udev.conf r,
/home/*/.Xauthority r,
/home/*/.cache/dconf/user mrw,
/home/*/.config/dconf/user r,
/home/*/.config/google-chrome/ r,
/home/*/.config/google-chrome/.com.google.Chrome.* rw,
"/home/*/.config/google-chrome/Certificate Revocation Lists" rw,
"/home/*/.config/google-chrome/Consent To Send Stats" rw,
/home/*/.config/google-chrome/Default/ r,
/home/*/.config/google-chrome/Default/* rw,
"/home/*/.config/google-chrome/Default/Application Cache/" mrw,
"/home/*/.config/google-chrome/Default/Application Cache/Index" mrwk,
"/home/*/.config/google-chrome/Default/Application Cache/Index-journal" mrw,
"/home/*/.config/google-chrome/Default/Archived History" rwk,
"/home/*/.config/google-chrome/Default/Archived History-journal" rw,
/home/*/.config/google-chrome/Default/Bookmarks rw,
/home/*/.config/google-chrome/Default/Bookmarks.bak w,
/home/*/.config/google-chrome/Default/Cookies rwk,
/home/*/.config/google-chrome/Default/Cookies-journal rw,
"/home/*/.config/google-chrome/Default/Current Session" rw,
"/home/*/.config/google-chrome/Default/Current Tabs" rw,
"/home/*/.config/google-chrome/Default/Custom Dictionary.txt" r,
"/home/*/.config/google-chrome/Default/Extension Cookies" rwk,
"/home/*/.config/google-chrome/Default/Extension Cookies-journal" rw,
"/home/*/.config/google-chrome/Default/Extension State/" r,
"/home/*/.config/google-chrome/Default/Extension State/*.dbtmp" rw,
"/home/*/.config/google-chrome/Default/Extension State/*.log" rw,
"/home/*/.config/google-chrome/Default/Extension State/*.sst" r,
"/home/*/.config/google-chrome/Default/Extension State/CURRENT" rw,
"/home/*/.config/google-chrome/Default/Extension State/LOCK" rw,
"/home/*/.config/google-chrome/Default/Extension State/MANIFEST-*" rw,
/home/*/.config/google-chrome/Default/Extensions/ r,
/home/*/.config/google-chrome/Default/Extensions/** rw,
/home/*/.config/google-chrome/Default/Extensions/*/*/*/*.so mrw,
/home/*/.config/google-chrome/Default/Favicons rwk,
/home/*/.config/google-chrome/Default/Favicons-journal rw,
"/home/*/.config/google-chrome/Default/File System/*/*/.usage" rw,
"/home/*/.config/google-chrome/Default/File System/*/*/Paths/LOCK" rw,
"/home/*/.config/google-chrome/Default/File System/Origins/" r,
"/home/*/.config/google-chrome/Default/File System/Origins/*.dbtmp" rw,
"/home/*/.config/google-chrome/Default/File System/Origins/*.log" mrw,
"/home/*/.config/google-chrome/Default/File System/Origins/*.sst" r,
"/home/*/.config/google-chrome/Default/File System/Origins/CURRENT" rw,
"/home/*/.config/google-chrome/Default/File System/Origins/LOCK" rw,
"/home/*/.config/google-chrome/Default/File System/Origins/MANIFEST-*" rw,
/home/*/.config/google-chrome/Default/History* rwk,
/home/*/.config/google-chrome/Default/IndexedDB/ r,
/home/*/.config/google-chrome/Default/IndexedDB/*.leveldb/ mrw,
/home/*/.config/google-chrome/Default/IndexedDB/*/LOCK rw,
"/home/*/.config/google-chrome/Default/Last Session" w,
"/home/*/.config/google-chrome/Default/Last Tabs" rw,
"/home/*/.config/google-chrome/Default/Local Storage/" r,
"/home/*/.config/google-chrome/Default/Local Storage/*" rwk,
"/home/*/.config/google-chrome/Default/Login Data" rwk,
"/home/*/.config/google-chrome/Default/Login Data-journal" rw,
"/home/*/.config/google-chrome/Default/Managed Mode Settings" rw,
"/home/*/.config/google-chrome/Default/Network Action Predictor" rwk,
"/home/*/.config/google-chrome/Default/Network Action Predictor-journal" rw,
"/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/*" rw,
"/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/CacheWritableAdobeRoot/AssetCache/" mr,
"/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/CacheWritableAdobeRoot/AssetCache/**" mrw,
"/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/#SharedObjects/" r,
"/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/#SharedObjects/**" rw,
"/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/macromedia.com/support/flashplayer/sys/**" rw,
/home/*/.config/google-chrome/Default/Preferences rw,
/home/*/.config/google-chrome/Default/QuotaManager rwk,
/home/*/.config/google-chrome/Default/QuotaManager-journal rw,
/home/*/.config/google-chrome/Default/Shortcuts rwk,
/home/*/.config/google-chrome/Default/Shortcuts-journal rw,
"/home/*/.config/google-chrome/Default/Sync Data/" rwk,
"/home/*/.config/google-chrome/Default/Sync Data/SyncData.sqlite3" rwk,
"/home/*/.config/google-chrome/Default/Sync Data/SyncData.sqlite3-journal" rw,
"/home/*/.config/google-chrome/Default/Sync Extension Settings/*/" r,
"/home/*/.config/google-chrome/Default/Sync Extension Settings/*/*.dbtmp" rw,
"/home/*/.config/google-chrome/Default/Sync Extension Settings/*/*.log" rw,
"/home/*/.config/google-chrome/Default/Sync Extension Settings/*/*.sst" r,
"/home/*/.config/google-chrome/Default/Sync Extension Settings/*/CURRENT" rw,
"/home/*/.config/google-chrome/Default/Sync Extension Settings/*/LOCK" rw,
"/home/*/.config/google-chrome/Default/Sync Extension Settings/*/MANIFEST-*" rw,
"/home/*/.config/google-chrome/Default/Top Sites" rwk,
"/home/*/.config/google-chrome/Default/Top Sites-journal" rw,
/home/*/.config/google-chrome/Default/TransportSecurity rw,
"/home/*/.config/google-chrome/Default/User StyleSheets/Custom.css" rw,
"/home/*/.config/google-chrome/Default/Visited Links" rw,
"/home/*/.config/google-chrome/Default/Web Data" rwk,
"/home/*/.config/google-chrome/Default/Web Data-journal" rw,
/home/*/.config/google-chrome/Default/databases/ rw,
/home/*/.config/google-chrome/Default/databases/Databases.db rwk,
/home/*/.config/google-chrome/Default/databases/Databases.db-journal rw,
/home/*/.config/google-chrome/Default/databases/chrome-extension*/* rwk,
/home/*/.config/google-chrome/Dictionaries/en-US-*.bdic r,
"/home/*/.config/google-chrome/Local State" rw,
/home/*/.config/google-chrome/PepperFlash/ r,
"/home/*/.config/google-chrome/Safe Browsing Bloom" rw,
"/home/*/.config/google-chrome/Safe Browsing Bloom Filter 2" rw,
"/home/*/.config/google-chrome/Safe Browsing Bloom_new" rw,
"/home/*/.config/google-chrome/Safe Browsing Cookies" rwk,
"/home/*/.config/google-chrome/Safe Browsing Cookies-journal" rw,
"/home/*/.config/google-chrome/Safe Browsing Csd Whitelist" rw,
"/home/*/.config/google-chrome/Safe Browsing Csd Whitelist_new" rw,
"/home/*/.config/google-chrome/Safe Browsing Download" rw,
"/home/*/.config/google-chrome/Safe Browsing Download Whitelist" rw,
"/home/*/.config/google-chrome/Safe Browsing Download Whitelist_new" rw,
"/home/*/.config/google-chrome/Safe Browsing Download_new" rw,
/home/*/.config/google-chrome/SingletonCookie rw,
/home/*/.config/google-chrome/SingletonLock rw,
/home/*/.config/google-chrome/SingletonSocket rw,
/home/*/.config/google-chrome/Temp/scoped_dir_*/CRX_INSTALL/ rw,
/home/*/.config/google-chrome/Temp/scoped_dir_*/CRX_INSTALL/*.png rw,
/home/*/.config/google-chrome/Temp/scoped_dir_*/CRX_INSTALL/_locales/ rw,
/home/*/.config/google-chrome/chrome_shutdown_ms.txt rw,
/home/*/.gtk-bookmarks r,
/home/*/.java/deployment/deployment.properties rwk,
/home/*/.local/share/icons/ r,
/home/*/.local/share/icons/hicolor/*x*/apps/ r,
/home/*/.local/share/mime/* mr,
/home/*/.pki/nssdb/cert9.db mrwk,
/home/*/.pki/nssdb/key4.db rwk,
/home/*/.pki/nssdb/pkcs11.txt rw,
/home/*/.pulse-cookie rwk,
/home/*/.thumbnails/normal/* r,
/home/*/Downloads/ r,
/home/*/Pictures/ r,
/home/*/Pictures/* r,
/lib/x86_64-linux-gnu/ld-*.so r,
/lib/x86_64-linux-gnu/libbz2.so.* mr,
/lib/x86_64-linux-gnu/libc-*.so mr,
/lib/x86_64-linux-gnu/libcom_err.so.* mr,
/lib/x86_64-linux-gnu/libdbus-*.so.* mr,
/lib/x86_64-linux-gnu/libdl-*.so mr,
/lib/x86_64-linux-gnu/libexpat.so.* mr,
/lib/x86_64-linux-gnu/libgcc_s.so.* mr,
/lib/x86_64-linux-gnu/libgcrypt.so.* mr,
/lib/x86_64-linux-gnu/libglib-*.so.* mr,
/lib/x86_64-linux-gnu/libgpg-error.so.* mr,
/lib/x86_64-linux-gnu/libkeyutils.so.* mr,
/lib/x86_64-linux-gnu/libm-*.so mr,
/lib/x86_64-linux-gnu/libnsl-*.so mr,
/lib/x86_64-linux-gnu/libnss_dns-*.so mr,
/lib/x86_64-linux-gnu/libnss_files-*.so mr,
/lib/x86_64-linux-gnu/libpci.so.* mr,
/lib/x86_64-linux-gnu/libpcre.so.* mr,
/lib/x86_64-linux-gnu/libpng*.so.* mr,
/lib/x86_64-linux-gnu/libpthread-*.so mr,
/lib/x86_64-linux-gnu/libresolv-*.so mr,
/lib/x86_64-linux-gnu/librt-*.so mr,
/lib/x86_64-linux-gnu/libselinux.so.* mr,
/lib/x86_64-linux-gnu/libudev.so.* mr,
/lib/x86_64-linux-gnu/libwrap.so.* mr,
/lib/x86_64-linux-gnu/libz.so.* mr,
/opt/google/chrome/*.png r,
/opt/google/chrome/PepperFlash/libpepflashplayer.so mr,
/opt/google/chrome/chrome mrix,
/opt/google/chrome/chrome-sandbox rPx,
/opt/google/chrome/chrome.pak r,
/opt/google/chrome/default_apps/ r,
/opt/google/chrome/default_apps/external_extensions.json r,
/opt/google/chrome/extensions/ w,
/opt/google/chrome/libffmpegsumo.so mr,
/opt/google/chrome/libpdf.so mr,
/opt/google/chrome/libppGoogleNaClPluginChrome.so mr,
/opt/google/chrome/locales/en-US.pak r,
/opt/google/chrome/nacl_helper_bootstrap Px,
/opt/google/chrome/nacl_irt_x86_64.nexe r,
/opt/google/chrome/resources.pak r,
/opt/google/chrome/theme_resources_*_percent.pak r,
/opt/google/chrome/ui_resources_*_percent.pak r,
/proc/*/auxv r,
/proc/*/coredump_filter rw,
/proc/*/maps r,
/proc/cpuinfo r,
/proc/filesystems r,
/proc/meminfo r,
/run/shm/ r,
/run/shm/.com.google.Chrome.* rw,
/run/shm/pulse-shm-* rw,
/selinux/ r,
/sys/bus/pci/devices/ r,
/sys/devices/*/*/resource r,
/sys/devices/pci*/*/0000*/class r,
/sys/devices/pci*/*/0000*/device r,
/sys/devices/pci*/*/0000*/irq r,
/sys/devices/pci*/*/0000*/resource r,
/sys/devices/pci*/*/0000*/vendor r,
/sys/devices/pci*/0000:*/class r,
/sys/devices/pci*/0000:*/device r,
/sys/devices/pci*/0000:*/irq r,
/sys/devices/pci*/0000:*/vendor r,
/sys/devices/system/cpu/ r,
/sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_*_freq r,
/sys/devices/system/cpu/online r,
/tmp/ r,
owner /tmp/** mrwk,
/tmp/chrome/** mrw,
/usr/bin/lsb_release r,
/usr/bin/xdg-open Cx,
/usr/bin/xdg-settings Cx,
/usr/include/python*/pyconfig.h r,
/usr/lib/gtk-*/*/menuproxies/libappmenu.so mr,
/usr/lib/jvm/java-*-oracle/jre/bin/java mrPx,
/usr/lib/jvm/java-*-oracle/jre/lib/** mr,
/usr/lib/liboverlay-scrollbar*.so.* mr,
/usr/lib/locale/** r,
/usr/lib/mozilla/plugins/ r,
/usr/lib/x86_64-linux-gnu/*/*/*modules/*.so mr,
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_conf_pulse.so mr,
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so mr,
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate.so mr,
/usr/lib/x86_64-linux-gnu/dri/libdricore.so mr,
/usr/lib/x86_64-linux-gnu/dri/libgallium.so mr,
/usr/lib/x86_64-linux-gnu/dri/libglsl.so mr,
/usr/lib/x86_64-linux-gnu/dri/r*_dri.so mr,
/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so mr,
/usr/lib/x86_64-linux-gnu/gconv/gconv-modules r,
/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache r,
/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders.cache r,
/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-png.so mr,
/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-svg.so mr,
/usr/lib/x86_64-linux-gnu/gio/modules/ r,
/usr/lib/x86_64-linux-gnu/gio/modules/giomodule.cache r,
/usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so mr,
/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so r,
/usr/lib/x86_64-linux-gnu/gio/modules/libgiolibproxy.so r,
/usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so mr,
/usr/lib/x86_64-linux-gnu/gtk-*/*/engines/libmurrine.so mr,
/usr/lib/x86_64-linux-gnu/gtk-2.0/*/gtk.immodules r,
/usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libcanberra-gtk-module.so mr,
/usr/lib/x86_64-linux-gnu/gvfs/libgvfscommon.so mr,
/usr/lib/x86_64-linux-gnu/libFLAC.so.* mr,
/usr/lib/x86_64-linux-gnu/libLLVM-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libX11-xcb.so.* mr,
/usr/lib/x86_64-linux-gnu/libX11.so.* mr,
/usr/lib/x86_64-linux-gnu/libXau.so.* mr,
/usr/lib/x86_64-linux-gnu/libXcomposite.so.* mr,
/usr/lib/x86_64-linux-gnu/libXcursor.so.* mr,
/usr/lib/x86_64-linux-gnu/libXdamage.so.* mr,
/usr/lib/x86_64-linux-gnu/libXdmcp.so.* mr,
/usr/lib/x86_64-linux-gnu/libXext.so.* mr,
/usr/lib/x86_64-linux-gnu/libXfixes.so.* mr,
/usr/lib/x86_64-linux-gnu/libXi.so.* mr,
/usr/lib/x86_64-linux-gnu/libXinerama.so.* mr,
/usr/lib/x86_64-linux-gnu/libXrandr.so.* mr,
/usr/lib/x86_64-linux-gnu/libXrender.so.* mr,
/usr/lib/x86_64-linux-gnu/libXss.so.* mr,
/usr/lib/x86_64-linux-gnu/libXxf86vm.so.* mr,
/usr/lib/x86_64-linux-gnu/libasound.so.* mr,
/usr/lib/x86_64-linux-gnu/libasyncns.so.* mr,
/usr/lib/x86_64-linux-gnu/libatk-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libavahi-client.so.* mr,
/usr/lib/x86_64-linux-gnu/libavahi-common.so.* mr,
/usr/lib/x86_64-linux-gnu/libcairo.so.* mr,
/usr/lib/x86_64-linux-gnu/libcanberra-gtk.so.* mr,
/usr/lib/x86_64-linux-gnu/libcanberra.so.* mr,
/usr/lib/x86_64-linux-gnu/libcroco-0.6.so.* mr,
/usr/lib/x86_64-linux-gnu/libcups.so.* mr,
/usr/lib/x86_64-linux-gnu/libdbus-glib-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libdbusmenu-glib.so.* mr,
/usr/lib/x86_64-linux-gnu/libdbusmenu-gtk.so.* mr,
/usr/lib/x86_64-linux-gnu/libdrm.so.* mr,
/usr/lib/x86_64-linux-gnu/libffi.so.* mr,
/usr/lib/x86_64-linux-gnu/libfontconfig.so.* mr,
/usr/lib/x86_64-linux-gnu/libfreetype.so.* mr,
/usr/lib/x86_64-linux-gnu/libgconf-2.so.* mr,
/usr/lib/x86_64-linux-gnu/libgdk-x11-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libgee.so.* mr,
/usr/lib/x86_64-linux-gnu/libgio-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libglapi.so.* mr,
/usr/lib/x86_64-linux-gnu/libgmodule-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libgnome-keyring.so.* mr,
/usr/lib/x86_64-linux-gnu/libgnutls.so.* mr,
/usr/lib/x86_64-linux-gnu/libgobject-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.* mr,
/usr/lib/x86_64-linux-gnu/libgthread-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libgtk-x11-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libibus-*.*.so.* mr,
/usr/lib/x86_64-linux-gnu/libjson.so.* mr,
/usr/lib/x86_64-linux-gnu/libk5crypto.so.* mr,
/usr/lib/x86_64-linux-gnu/libkrb5.so.* mr,
/usr/lib/x86_64-linux-gnu/libkrb5support.so.* mr,
/usr/lib/x86_64-linux-gnu/libltdl.so.* mr,
/usr/lib/x86_64-linux-gnu/libnspr*.so mr,
/usr/lib/x86_64-linux-gnu/libnss*.so mr,
/usr/lib/x86_64-linux-gnu/libogg.so.* mr,
/usr/lib/x86_64-linux-gnu/libp11-kit.so.* mr,
/usr/lib/x86_64-linux-gnu/libpango-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libpangocairo-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libpangoft2-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libpixman-*.so.* mr,
/usr/lib/x86_64-linux-gnu/libplc*.so mr,
/usr/lib/x86_64-linux-gnu/libplds*.so mr,
/usr/lib/x86_64-linux-gnu/libpulse.so.* mr,
/usr/lib/x86_64-linux-gnu/libpulsecommon-*.so mr,
/usr/lib/x86_64-linux-gnu/librsvg-2.so.* mr,
/usr/lib/x86_64-linux-gnu/libsmime*.so mr,
/usr/lib/x86_64-linux-gnu/libsndfile.so.* mr,
/usr/lib/x86_64-linux-gnu/libspeexdsp.so.* mr,
/usr/lib/x86_64-linux-gnu/libsqlite3.so.* mr,
/usr/lib/x86_64-linux-gnu/libstdc*.so.* mr,
/usr/lib/x86_64-linux-gnu/libtasn1.so.* mr,
/usr/lib/x86_64-linux-gnu/libtdb.so.* mr,
/usr/lib/x86_64-linux-gnu/libvorbis.so.* mr,
/usr/lib/x86_64-linux-gnu/libvorbisenc.so.* mr,
/usr/lib/x86_64-linux-gnu/libvorbisfile.so.* mr,
/usr/lib/x86_64-linux-gnu/libxcb-glx.so.* mr,
/usr/lib/x86_64-linux-gnu/libxcb-render.so.* mr,
/usr/lib/x86_64-linux-gnu/libxcb-shm.so.* mr,
/usr/lib/x86_64-linux-gnu/libxcb.so.* mr,
/usr/lib/x86_64-linux-gnu/libxml2.so.* mr,
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.* mr,
/usr/lib/x86_64-linux-gnu/nss/libfreebl*.so mr,
/usr/lib/x86_64-linux-gnu/nss/libnssckbi.so mr,
/usr/lib/x86_64-linux-gnu/nss/libsoftokn*.so mr,
/usr/lib/x86_64-linux-gnu/pango/*/module-files.d/ r,
/usr/lib/x86_64-linux-gnu/pango/*/module-files.d/libpango*.*.modules r,
/usr/local/lib/python2.7/dist-packages/ r,
/usr/local/share/icons/ r,
/usr/local/share/icons/hicolor/*/apps/*chrome.png r,
/usr/local/share/icons/hicolor/*x*/apps/ r,
/usr/local/share/icons/hicolor/scalable/apps/ r,
/usr/share/** r,
/var/cache/*/*.cache-* mr,
/var/cache/nscd/group r,
/var/cache/nscd/passwd r,
/var/lib/dbus/machine-id r,
/var/tmp/ r,
/var/tmp/* rw,
/{,var/}run/.nscd_socket rw,
/{,var/}run/mdnsd w,
/{,var/}run/nscd/socket rw,
/{,var/}run/resolvconf/resolv.conf r,
/{,var/}run/utmp r,
owner @{HOME}/.cache/** mrw,
owner @{HOME}/.config/** mrw,
@{PROC}/ r,
@{PROC}/[0-9]*/cmdline r,
@{PROC}/[0-9]*/fd/ r,
@{PROC}/[0-9]*/io r,
@{PROC}/[0-9]*/oom_score_adj w,
@{PROC}/[0-9]*/stat r,
@{PROC}/[0-9]*/statm r,
@{PROC}/[0-9]*/status r,
@{PROC}/[0-9]*/task/ r,
@{PROC}/[0-9]*/task/*/stat r,
@{PROC}/sys/kernel/shmmax r,


profile /usr/bin/xdg-open {

/bin/dash r,
/etc/ld.so.cache mr,
/lib/x86_64-linux-gnu/ld-*.so r,
/lib/x86_64-linux-gnu/libc-*.so mr,

}

profile /usr/bin/xdg-settings {


/bin/dash r,
/bin/grep rix,
/bin/mkdir rix,
/bin/readlink rix,
/bin/sed rix,
/bin/touch rix,
/bin/which rix,
/dev/null w,
/etc/gnome/defaults.list r,
/etc/ld.so.cache mr,
/etc/locale.alias r,
/home/*/.local/share/applications/mimeapps.list r,
/home/*/.local/share/applications/mimeapps.list.new w,
/lib/x86_64-linux-gnu/ld-*.so r,
/lib/x86_64-linux-gnu/libc-*.so mr,
/lib/x86_64-linux-gnu/libdbus-1.so.* mr,
/lib/x86_64-linux-gnu/libdl-*.so mr,
/lib/x86_64-linux-gnu/libglib-2.0.so.* mr,
/lib/x86_64-linux-gnu/libm-*.so mr,
/lib/x86_64-linux-gnu/libpcre.so.* mr,
/lib/x86_64-linux-gnu/libpthread-*.so mr,
/lib/x86_64-linux-gnu/libresolv-*.so mr,
/lib/x86_64-linux-gnu/librt-*.so mr,
/lib/x86_64-linux-gnu/libselinux.so.* mr,
/lib/x86_64-linux-gnu/libz.so.* mr,
/proc/*/maps r,
/proc/filesystems r,
/usr/bin/basename Px,
/usr/bin/cut rix,
/usr/bin/dirname rix,
/usr/bin/gawk rix,
/usr/bin/gconftool-2 rix,
/usr/bin/xdg-mime rix,
/usr/bin/xdg-settings r,
/usr/lib/lib*so* r,
/usr/lib/libsigsegv.so.* mr,
/usr/lib/locale/** r,
/usr/lib/x86_64-linux-gnu/gconv/gconv-modules r,
/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache r,
/usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.* mr,
/usr/lib/x86_64-linux-gnu/libffi.so.* mr,
/usr/lib/x86_64-linux-gnu/libgconf-2.so.* mr,
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.* mr,
/usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.* mr,
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.* mr,
/usr/lib/x86_64-linux-gnu/libgthread-2.0.so.* mr,
/usr/lib/x86_64-linux-gnu/libxml2.so.* mr,
/usr/local/share/applications/google-chrome.desktop r,

}
}
__________________

Last edited by Hungry Man : September 19th, 2012 at 05:00 PM.
  #127  
Old September 18th, 2012, 10:53 PM
wat0114's Avatar
wat0114 wat0114 is offline
Frequent Poster
 
Join Date: Aug 2012
Location: Canada
Posts: 731
Default Re: Anyone using Apparmor?

Wow! Maybe mine's overly simple...

Code:
# Last Modified: Sun Sep 16 22:15:41 2012 #include <tunables/global> /opt/google/chrome/google-chrome { #include <abstractions/audio> #include <abstractions/base> #include <abstractions/bash> #include <abstractions/cups-client> #include <abstractions/dbus-session> #include <abstractions/fonts> #include <abstractions/freedesktop.org> #include <abstractions/gnome> #include <abstractions/nameservice> #include <abstractions/nvidia> #include <abstractions/ubuntu-konsole> #include <abstractions/user-tmp> #include <abstractions/user-write> capability dac_override, capability setgid, capability setuid, capability sys_admin, capability sys_chroot, #capability sys_ptrace, /bin/bash ix, /bin/dash rix, /bin/grep rix, /bin/mkdir rix, /bin/readlink rix, /bin/sed rix, /bin/which rix, /dev/ r, /etc/.java/ w, /etc/debian_version r, /etc/lsb-release r, /etc/python2.7/sitecustomize.py r, /etc/timezone r, /home/*/.Xauthority r, /home/*/.cache/dconf/user rw, /home/*/.cache/google-chrome/Default/Cache/* rw, /home/*/.config/dconf/user r, /home/*/.config/google-chrome/.com.google.Chrome.* rw, "/home/*/.config/google-chrome/Certificate Revocation Lists" w, /home/*/.config/google-chrome/Default/ r, /home/*/.config/google-chrome/Default/* rwk, "/home/*/.config/google-chrome/Default/Extension State/" rw, "/home/*/.config/google-chrome/Default/Extension State/*" rw, /home/*/.config/google-chrome/Default/Extensions/ r, /home/*/.config/google-chrome/Default/Extensions/** rw, "/home/*/.config/google-chrome/Default/Local Storage/" r, "/home/*/.config/google-chrome/Default/Local Storage/*" k, "/home/*/.config/google-chrome/Default/Local Storage/chrome-extension_*" rwk, "/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/CacheWritableAdobeRoot/AssetCache/" r, "/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/CacheWritableAdobeRoot/AssetCache/*/" w, "/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/#SharedObjects/" r, "/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/#SharedObjects/**" rw, "/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/macromedia.com/support/flashplayer/sys/ settings.*" rw, "/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/macromedia.com/support/flashplayer/sys/settings.sol" rw, "/home/*/.config/google-chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/macromedia.com/support/flashplayer/sys/settings.sxx" w, "/home/*/.config/google-chrome/Default/User StyleSheets/Custom.css" r, "/home/*/.config/google-chrome/Default/Visited Links" rw, /home/*/.config/google-chrome/Default/databases/ r, /home/*/.config/google-chrome/Default/databases/Databases.db rwk, /home/*/.config/google-chrome/Default/databases/Databases.db* rk, /home/*/.config/google-chrome/Default/databases/chrome-extension_* rwk, /home/*/.config/google-chrome/Default/databases/chrome-extension_*_0/1* rwk, /home/*/.config/google-chrome/Dictionaries/en-GB* rw, "/home/*/.config/google-chrome/Local State" rw, "/home/*/.config/google-chrome/Safe Browsing*" rwk, "/home/*/.config/google-chrome/Service State" r, /home/*/.config/google-chrome/Singleton* w, /home/*/.config/google-chrome/chrome_shutdown_ms.txt rw, /home/*/.config/user-dirs.dirs r, /home/*/.java/deployment/CacheUpgrade.properties r, /home/*/.java/deployment/cache/6.0/** rwk, /home/*/.java/deployment/deployment.properties rwk, /home/*/.local/share/mime/mime.cache r, /home/*/.mozilla/firefox/*.default/.parentlock wk, /home/*/.mozilla/firefox/*.default/compatibility.ini r, /home/*/.mozilla/firefox/profiles.ini r, /home/*/.pki/nssdb/* rwk, /home/*/Downloads/* rw, /home/*/Downloads/*.crx rw, /home/*/Downloads/.com.google.Chrome.* w, /home/*/.java/fonts/** rw, /opt/google/chrome/* r, /opt/google/chrome/PepperFlash/libpepflashplayer.so mr, /opt/google/chrome/chrome rix, /opt/google/chrome/chrome-sandbox rix, /opt/google/chrome/chrome.pak r, /opt/google/chrome/default_apps/ r, /opt/google/chrome/default_apps/external_extensions.json r, /opt/google/chrome/extensions/ w, /opt/google/chrome/google-chrome rix, /opt/google/chrome/lib*.so mr, /opt/google/chrome/locales/en-GB.pak r, /opt/google/chrome/nacl_helper mr, /opt/google/chrome/nacl_helper_bootstrap rix, /proc/ r, /proc/*/ r, /proc/*/coredump_filter rw, /proc/*/fd/ r, /proc/*/io r, /proc/*/maps r, /proc/*/net/* r, /proc/*/oom_score_adj w, /proc/*/stat* r, /proc/*/task/ r, /proc/*/task/*/stat r, /proc/cpuinfo r, /proc/filesystems r, /proc/meminfo r, /proc/sys/kernel/shmmax r, /run/shm/.com.google.Chrome* rw, /run/shm/com.google.Chrome* rw, /selinux/ r, /sys/bus/pci/devices/ r, /sys/devices/pci0000:00/0000:00:*/** r, /sys/devices/system/cpu/ r, /sys/devices/system/cpu/** r, owner /tmp/** lk, /tmp/** rw, /usr/bin/basename rix, /usr/bin/cut rix, /usr/bin/dirname rix, /usr/bin/gvfs-open rix, /usr/bin/lsb_release rix, /usr/bin/mawk rix, /usr/bin/xdg-* rix, /usr/include/python2.7/pyconfig.h r, /usr/lib/jvm/java-{7,8,9}-oracle/jre/bin/java rix, /usr/lib{,32,64}/** mr, /usr/local/lib/python2.7/dist-packages/ r, /usr/share/glib-2.0/schemas/gschemas.compiled r, /usr/share/misc/pci.ids r, /usr/share/pyshared/* r, owner /var/tmp/** lk, /var/tmp/** rw, }

I guess a lot depends on what's included in the abstractions profiles. I threw in some abstractions that probably aren't needed, but I just wanted to simplify the process of building the profile. I confess there was some guesswork on my part as well Still, yours is obviously far more granular than mine. Are you using the stable release of Chrome? That's what I'm using. Initially I was using the Developer version, then I uninstalled it along with the profile, installed the stable, then re-built the profile.
__________________
Win 7x64 Ultimate

SUA | UAC @ Max | AppLocker w/DLL enforcement | Win fw w/advanced security| EMET 3.5 | Firefox w/NS +AdBlock+ plugins | GPO restrictions | Bitlocker and Truecrypt | ShadowProtect images | IFW data backups + dual boot to XP Pro: GPO, SRP, Jetico firewall w/Process Attack filter
  #128  
Old September 18th, 2012, 11:11 PM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Anyone using Apparmor?

I would rewrite yours, seems pretty loose. All of those capabilities can be dangerous. Strict file access though and that's always important.

Mine isn't working right now. I might start over, I'm having some weird issues.

I use Chrome Beta.

I would suggest you sandbox the chrome-sandbox and then work from there.
__________________
  #129  
Old September 18th, 2012, 11:26 PM
wat0114's Avatar
wat0114 wat0114 is offline
Frequent Poster
 
Join Date: Aug 2012
Location: Canada
Posts: 731
Default Re: Anyone using Apparmor?

I see your profile includes the same capabilities, though, and then some??

I may just have another go at it, however, both for interest sake and to see if I can tighten it down a bit more. Maybe my use of wildcards is too liberal but I didn't want an overwhelmingly large profile. The executable masks confuse me the most as to what to set them at. When I use aa-genprof and scan after I put the program through its paces, it gives me options such as Child, Inherit and Profile. I usually just choose inherit because it seems to always work and then from what I understand it's more secure than Px or Ux. I still have some figuring out to do on Apparmor because as it stands now I don't yet have close to a thorough understanding of how to properly build profiles, other than just going off the aa-genprof scan suggestions.
__________________
Win 7x64 Ultimate

SUA | UAC @ Max | AppLocker w/DLL enforcement | Win fw w/advanced security| EMET 3.5 | Firefox w/NS +AdBlock+ plugins | GPO restrictions | Bitlocker and Truecrypt | ShadowProtect images | IFW data backups + dual boot to XP Pro: GPO, SRP, Jetico firewall w/Process Attack filter
  #130  
Old September 18th, 2012, 11:33 PM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Anyone using Apparmor?

The sandbox profile contains those capabilities but the other profile doesn't.

So an exploit in the sandbox process could do those things but an exploit in the other processes would not be able to.

Reducing file access is really important. Especially to areas of /proc/ and whatnot.

Chrome obviously needs very little help to be secure on Linux what with the sandbox but it's nice to have something on top of it all.

Quote:
I usually just choose inherit because it seems to always work and then from what I understand it's more secure than Px or Ux.
It's more secure than Ux but not Px.

Inherit means it runs with the same rights as your parent profile. If Chrome opens Deluge as Ix Deluge can only access what Chrome can access.

If you separate Deluge into it's own profile (Px) it'll only have access to what it needs - this is ideal.

For something like 'which' or 'wget' it's fine to use Ix because Chrome is using it to modify its own files. Ix is perfect for this.

Cx is good for when you need to open another process that'll access files outside of the Chrome profile but that you don't want to profile separately.

It takes some time to get used to it.

I would suggest you have a look at PaX and Grsecurity too. I'd say it's like EMET on steroids but that doesn't even give it enough credit.
__________________
  #131  
Old September 19th, 2012, 12:07 AM
ComputerSaysNo ComputerSaysNo is offline
Very Frequent Poster
 
Join Date: Aug 2012
Posts: 1,086
Default Re: Anyone using Apparmor?

Way over my head guys, it would nice if you could make a guide or a blog on terminal commands.
  #132  
Old September 19th, 2012, 06:32 AM
tlu's Avatar
tlu tlu is online now
Very Frequent Poster
 
Join Date: Sep 2004
Posts: 2,066
Default Re: Anyone using Apparmor?

Quote:
Originally Posted by ComputerSaysNo
Way over my head guys, it would nice if you could make a guide or a blog on terminal commands.

Well, there are a lot of sources for that.

There are, e.g, the man pages on http://manpages.ubuntu.com/manpages/...pparmor.7.html and http://manpages.ubuntu.com/manpages/...armor.d.5.html.

You'll get more infos on http://wiki.apparmor.net/index.php/Documentation. A very detailed documentation is http://wiki.apparmor.net/index.php/A...licy_Reference

Another good source is http://doc.opensuse.org/documentatio....apparmor.html

Last edited by tlu : September 19th, 2012 at 06:47 AM.
  #133  
Old September 19th, 2012, 06:49 AM
tlu's Avatar
tlu tlu is online now
Very Frequent Poster
 
Join Date: Sep 2004
Posts: 2,066
Default Re: Anyone using Apparmor?

Quote:
Originally Posted by wat0114
When I use aa-genprof and scan after I put the program through its paces, it gives me options such as Child, Inherit and Profile.

More infos on http://doc.opensuse.org/documentatio....profiles.exec AND http://wiki.apparmor.net/index.php/A...#Execute_rules
  #134  
Old September 19th, 2012, 07:48 AM
wat0114's Avatar
wat0114 wat0114 is offline
Frequent Poster
 
Join Date: Aug 2012
Location: Canada
Posts: 731
Default Re: Anyone using Apparmor?

Thanks tlu, i'll check those out

@HM, I'll take aa for another spin profiling Chrome again, just to see if I can't restrict it some more without breaking its functionailty. Thanks!
__________________
Win 7x64 Ultimate

SUA | UAC @ Max | AppLocker w/DLL enforcement | Win fw w/advanced security| EMET 3.5 | Firefox w/NS +AdBlock+ plugins | GPO restrictions | Bitlocker and Truecrypt | ShadowProtect images | IFW data backups + dual boot to XP Pro: GPO, SRP, Jetico firewall w/Process Attack filter

Last edited by wat0114 : September 19th, 2012 at 12:23 PM.
  #135  
Old September 19th, 2012, 11:45 AM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Anyone using Apparmor?

Quote:
Originally Posted by ComputerSaysNo
Way over my head guys, it would nice if you could make a guide or a blog on terminal commands.
https://insanitybit.wordpress.com/20...parmor-how-to/

I wrote a quick guide a while ago.
__________________
  #136  
Old September 19th, 2012, 02:30 PM
chronomatic chronomatic is offline
Very Frequent Poster
 
Join Date: Apr 2009
Posts: 1,324
Default Re: Anyone using Apparmor?

OK, I switched from Chromium to Chrome on 12.04. I created a profile from scratch for both Chrome and the sandbox. I was as restrictive as I could be. Yes, I did use some abstractions, but I checked each one to make sure there was nothing superfluous (also checked to make sure there were no Ux, etc.).

Here's the Chrome profile:

Code:
# Last Modified: Wed Sep 19 08:49:42 2012 #include <tunables/global> /opt/google/chrome/chrome { #include <abstractions/X> #include <abstractions/audio> #include <abstractions/base> #include <abstractions/cups-client> #include <abstractions/fonts> #include <abstractions/freedesktop.org> #include <abstractions/ubuntu-browsers.d/java> #include <abstractions/user-tmp> # For networking. Decided not to use abstractions here. network inet stream, network inet6 stream, network inet dgram, network inet6 dgram, /etc/host.conf r, /etc/hosts r, /etc/nsswitch.conf r, /etc/resolv.conf r, @{PROC}/[0-9]*/net/if_inet6 r, @{PROC}/[0-9]*/net/ipv6_route r, # Python stuff /etc/python2.7/sitecustomize.py r, /usr/include/python2.7/ r, /usr/include/python2.7/** r, /usr/local/lib/python2.7/ r, /usr/local/lib/python2.7/** r, /usr/share/pyshared/ r, /usr/share/pyshared/** r, /opt/google/chrome/ r, /opt/google/chrome/** m, /opt/google/chrome/** rwkl, /dev/ r, /dev/nvidiactl rw, /dev/nvidia0 rw, /etc/debian_version r, /etc/group r, /etc/lsb-release r, /etc/gai.conf r, /etc/mtab r, /etc/mime.types r, /etc/mailcap r, /etc/passwd r, /etc/xdg/xubuntu/applications/defaults.list r, /run/shm/*.google** rw, /selinux/ r, /var/lib/dbus/machine-id r, owner @{HOME}/.config/google-chrome/Default/Shortcuts rwk, owner @{HOME}/.local/share/applications/defaults.list r, owner @{HOME}/.local/share/applications/mimeinfo.cache r, owner @{HOME}/.cache/dconf/user rw, owner @{HOME}/.config/dconf/user r, owner @{HOME}/.config/google-chrome/ r, owner @{HOME}/.config/google-chrome/** rwkl, owner @{HOME}/.config/ibus/bus/ rw, owner @{HOME}/.cache/google-chrome/Default/Cache/ r, owner @{HOME}/.cache/google-chrome/Default/Cache/** rw, @{PROC}/[0-9]*/fd/ r, @{PROC}/filesystems r, @{PROC}/ r, @{PROC}/[0-9]*/task/[0-9]*/stat r, @{PROC}/*/oom_score_adj rw, @{PROC}/sys/kernel/shmmax r, @{PROC}/*/task/ r, owner @{PROC}/[0-9]*/cmdline r, owner @{PROC}/[0-9]*/io r, owner @{PROC}/[0-9]*/stat r, owner @{PROC}/[0-9]*/status r, # Newer chromium needs these now /sys/devices/pci[0-9]*/**/class r, /sys/devices/pci[0-9]*/**/device r, /sys/devices/pci[0-9]*/**/irq r, /sys/devices/pci[0-9]*/**/resource r, /sys/devices/pci[0-9]*/**/vendor r, /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq r, /sys/bus/pci/devices/ r, # Default profile allows downloads to ~/Downloads and uploads from ~/Public owner @{HOME}/ r, owner @{HOME}/Public/ r, owner @{HOME}/Public/* r, owner @{HOME}/Downloads/ r, owner @{HOME}/Downloads/* rw, /bin/dash ixr, /usr/bin/lsb_release ixr, /usr/bin/xdg-open ixr, /usr/bin/gnome-open ixr, /usr/bin/gvfs-open ixr, owner @{HOME}/.pki/nssdb/* rwk, # Libraries Chrome needs /usr/lib/x86_64-linux-gnu/pango/*/modules/*.so mr, /usr/lib/x86_64-linux-gnu/gtk-2.0/*/immodules/*.so mr, # For themes /usr/share/misc/ r, /usr/share/misc/** r, /usr/share/glib-2.0/schemas/ r, /usr/share/glib-2.0/schemas/** r, /usr/share/themes/ r, /usr/share/themes/** r, # Allow transitions to ourself and our sandbox /opt/google/chrome/chrome-sandbox Pxr, /opt/google/chrome/google-chrome ixr, /opt/google/chrome/chrome ixr, /opt/google/chrome/nacl_helper_bootstrap ixr, /usr/bin/xdg-settings Px, }


Here's the sandbox profile (I made a separate profile for it). With this profile, I actually copied the original Chromium profile that comes with Ubuntu and added a line here and there. The default profile in Ubuntu was always pretty restrictive (for the sandbox at least):

Code:
# Last Modified: Wed Sep 19 08:34:21 2012 #include <tunables/global> /opt/google/chrome/chrome-sandbox { # Be fanatical since it is setuid root and don't use an abstraction /lib/libgcc_s.so* mr, /lib{,32,64}/libm-*.so* mr, /lib/@{multiarch}/libm-*.so* mr, /lib{,32,64}/libpthread-*.so* mr, /lib/@{multiarch}/libpthread-*.so* mr, /lib{,32,64}/libc-*.so* mr, /lib/@{multiarch}/libc-*.so* mr, /lib{,32,64}/libld-*.so* mr, /lib/@{multiarch}/libld-*.so* mr, /lib{,32,64}/ld-*.so* mr, /lib/@{multiarch}/ld-*.so* mr, /lib/tls/*/{cmov,nosegneg}/libm-*.so* mr, /lib/tls/*/{cmov,nosegneg}/libpthread-*.so* mr, /lib/tls/*/{cmov,nosegneg}/libc-*.so* mr, /usr/lib/libstdc++.so* mr, /etc/ld.so.cache r, # Required for dropping into PID namespace. Keep in mind that until the # process drops this capability it can escape confinement, but once it # drops CAP_SYS_ADMIN we are ok. capability sys_admin, # All of these are for sanely dropping from root and chrooting capability chown, capability fsetid, capability setgid, capability setuid, capability dac_override, capability sys_chroot, # *Sigh* capability sys_ptrace, @{PROC}/ r, @{PROC}/[0-9]*/ r, @{PROC}/[0-9]*/fd/ r, @{PROC}/[0-9]*/oom_adj w, @{PROC}/[0-9]*/oom_score_adj w, @{PROC}/[0-9]*/task/[0-9]*/stat r, /opt/google/chrome r, /opt/google/chrome/chrome Px, /opt/google/chrome/chrome-sandbox r, owner /tmp/** rw, }


Also I made a profile for /usr/bin/xdg-settings. You will need this for the profile to work correctly. It is below:

Code:
# Last Modified: Wed Sep 19 08:51:52 2012 #include <tunables/global> /usr/bin/xdg-settings { #include <abstractions/base> /bin/dash rix, /bin/grep rix, /bin/readlink rix, /bin/sed rix, /bin/which rix, /home/*/.local/share/applications/* r, /proc/*/maps r, /proc/filesystems r, /usr/bin/basename rix, /usr/bin/cut rix, /usr/bin/gawk rix, /usr/bin/gconftool-2 rix, /usr/bin/xdg-mime rix, /usr/bin/xdg-settings r, }


So, you will have three files in /etc/apparmor.d:

1) opt.google.chrome.chrome
2) opt.google.chrome.chrome-sandbox
3) usr.bin.xdg-settings

Try it out and let me know how it goes.

TO DO: I am going to try and make more sub-profiles for things like /bin/which, /bin/grep, /bin/sed, /bin/dash, /gnome-open, etc..
  #137  
Old September 19th, 2012, 02:45 PM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Anyone using Apparmor?

For things like which and grep and sed and dash etc it makes more sense to do child profiles.

Becaues Chrome might just use grep to pull in a single file to a single location. But a full grep profile would likely need access to a lot more than that, so a child profile woudl be tighter.

edit: Finished up the Chrome profile - no more abstractions. Removed access to a lot of libraries.
__________________

Last edited by Hungry Man : September 19th, 2012 at 04:34 PM.
  #138  
Old September 19th, 2012, 04:36 PM
chronomatic chronomatic is offline
Very Frequent Poster
 
Join Date: Apr 2009
Posts: 1,324
Default Re: Anyone using Apparmor?

Quote:
Originally Posted by Hungry Man
For things like which and grep and sed and dash etc it makes more sense to do child profiles.

I tried /bin/dash, got this message:

Quote:
/bin/dash is currently marked as a program that should not have it's own profile. Usually, programs are marked this way if creating a profile for them is likely to break the rest of the system. If you know what you're doing and are certain you want to create a profile for this program, edit the corresponding entry in the [qualifiers] section in /etc/apparmor/logprof.conf.

So I guess that is a no-go. I will try others and see if the same warnings occur.
  #139  
Old September 20th, 2012, 08:37 PM
wat0114's Avatar
wat0114 wat0114 is offline
Frequent Poster
 
Join Date: Aug 2012
Location: Canada
Posts: 731
Default Re: Anyone using Apparmor?

Here's a question for you apparmor experts: how do you know what type executable qualifier to use for a given executable path when you're generating rules? In a few cases I changed ix to Px but it ended up breaking the desired action, so of course I had to revert to ix. Do you just choose the most restrictive qualifier then "downgrade' to something more liberal if it doesn't break, or do you know what to choose? aa-genprof offers several choices but in most cases I'm completely guessing which one to choose. I always get a warning something to the effect of: some require "LD_PRELOAD" or "LD_LIBRARY_PATH" if I choose Px

Also, I can't help but notice "different folks =different strokes" when I compare Hungry Man's Chrome profile to chronomatic's. They are so completely different! Who's right and who's wrong?? Or do both of you have a solid profile with just a different approach?
__________________
Win 7x64 Ultimate

SUA | UAC @ Max | AppLocker w/DLL enforcement | Win fw w/advanced security| EMET 3.5 | Firefox w/NS +AdBlock+ plugins | GPO restrictions | Bitlocker and Truecrypt | ShadowProtect images | IFW data backups + dual boot to XP Pro: GPO, SRP, Jetico firewall w/Process Attack filter

Last edited by wat0114 : September 20th, 2012 at 08:42 PM.
  #140  
Old September 20th, 2012, 09:53 PM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Anyone using Apparmor?

Quote:
how do you know what type executable qualifier to use for a given executable path when you're generating rules?
It's a case by case basis.

For example... I have Java run with a separate profile because I know that when Chrome launches Java Java will need to access files besides what Chrome uses.

But I have an inherit (ix) flag for /bin/which because Chrome is going to use /bin/which on its own files - it needs no new rights.

I use Child when I need to give the new process new rights but when I don't want that process to *always* run in a profile, only when launched by Chrome.

Quote:
I always get a warning something to the effect of: some require "LD_PRELOAD" or "LD_LIBRARY_PATH" if I choose Px
This has to do with sanitizing. You won't always get this warning.

Quote:
Also, I can't help but notice "different folks =different strokes" when I compare Hungry Man's Chrome profile to chronomatic's. They are so completely different! Who's right and who's wrong?? Or do both of you have a solid profile with just a different approach?
Our sandbox profile is the same.

I also removed all abstractions and I avoided variables wherever I could.

I'd say mine is more secure but I wouldn't say his is insecure by any means, both profiles avoid any Ux or writing to dangerous places.

It's all a matter of understanding what each action does and after that things get a lot simpler.
__________________
  #141  
Old September 21st, 2012, 12:17 AM
ComputerSaysNo ComputerSaysNo is offline
Very Frequent Poster
 
Join Date: Aug 2012
Posts: 1,086
Default Re: Anyone using Apparmor?

Thanks for the links tlu, still way over my head. I'll read up on it though.1111
  #142  
Old September 21st, 2012, 04:34 PM
chronomatic chronomatic is offline
Very Frequent Poster
 
Join Date: Apr 2009
Posts: 1,324
Default Re: Anyone using Apparmor?

Quote:
Originally Posted by wat0114
Here's a question for you apparmor experts: how do you know what type executable qualifier to use for a given executable path when you're generating rules? In a few cases I changed ix to Px but it ended up breaking the desired action, so of course I had to revert to ix. Do you just choose the most restrictive qualifier then "downgrade' to something more liberal if it doesn't break, or do you know what to choose? aa-genprof offers several choices but in most cases I'm completely guessing which one to choose. I always get a warning something to the effect of: some require "LD_PRELOAD" or "LD_LIBRARY_PATH" if I choose Px

Always use "ix" unless you have a separate profile for that process. In that case you can use Px. If you select Px when there is no profile defined, apparmor will begin writing a profile for that process.

Some apps may not work with "ix" which is why you sometimes see Ux. Instead of using Ux, you should take the time to write a separate profile for that process. Then you can use Px.

Quote:
Also, I can't help but notice "different folks =different strokes" when I compare Hungry Man's Chrome profile to chronomatic's. They are so completely different! Who's right and who's wrong?? Or do both of you have a solid profile with just a different approach?

It will vary slightly based on which version of Chrome and what exactly you use Chrome for. I use abstractions, HM doesn't. However, the abstractions I use have all been checked for weaknesses and I haven't found any. I try to stay away from "base" and a few others, but some of the abstractions are fine to use. For instance, "fonts" and "dbus-session" and "gnome" are fine to use. I have checked them and they are pretty restrictive and have no "Ux" entries.

But all in all, I feel my Chrome profile is pretty restrictive.
  #143  
Old September 21st, 2012, 05:08 PM
wat0114's Avatar
wat0114 wat0114 is offline
Frequent Poster
 
Join Date: Aug 2012
Location: Canada
Posts: 731
Default Re: Anyone using Apparmor?

Thank you so much for the help, HM and chronomatic! That helps clear things up, especially re the Px leading to a separate profile. HM had mentoioned something along those lines several posts back when he advised I use Px then create a separate profile for Java, but I coinfess I didn't fully understand at the time.
__________________
Win 7x64 Ultimate

SUA | UAC @ Max | AppLocker w/DLL enforcement | Win fw w/advanced security| EMET 3.5 | Firefox w/NS +AdBlock+ plugins | GPO restrictions | Bitlocker and Truecrypt | ShadowProtect images | IFW data backups + dual boot to XP Pro: GPO, SRP, Jetico firewall w/Process Attack filter
  #144  
Old September 21st, 2012, 05:25 PM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Anyone using Apparmor?

Having Chrome open Java in a separate profile is useful. If you use ix you effectively combine your Java and Chrome profiles. That's why its good to separate them.

I posted the Java and Chrome profiles on my blog for reference.

My profile won't work for everyone. I don't use chrome to print - it needs access to new libraries that I haven't allowed.

But by blocking access to those libraries and others I've reduced the visible attack surface a lot.

That + the multitude of security enhancements in PaX and Grsecurity means Chrome is just not a viable process to attack.

I would suggest you look at grsecurity if you're interested in taking your security setup as far as it can go.
__________________
  #145  
Old September 21st, 2012, 05:28 PM
chronomatic chronomatic is offline
Very Frequent Poster
 
Join Date: Apr 2009
Posts: 1,324
Default Re: Anyone using Apparmor?

Quote:
Originally Posted by Hungry Man
I would suggest you look at grsecurity if you're interested in taking your security setup as far as it can go.

I compiled a Grsec kernel for 12.04 and while it will boot, I cannot install the nvidia graphics drivers, so I gave up.
  #146  
Old September 21st, 2012, 05:30 PM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Anyone using Apparmor?

Yeah the GPU drivers can be the biggest issue. I use the open source ones. I've got it working well with the open source ATI drivers. The closed source ones work too but you have to disable one of the PaX features.
__________________
  #147  
Old September 21st, 2012, 08:09 PM
wat0114's Avatar
wat0114 wat0114 is offline
Frequent Poster
 
Join Date: Aug 2012
Location: Canada
Posts: 731
Default Re: Anyone using Apparmor?

Since I use nVidia gpus I better hold off on GRsecurity at least for now.
__________________
Win 7x64 Ultimate

SUA | UAC @ Max | AppLocker w/DLL enforcement | Win fw w/advanced security| EMET 3.5 | Firefox w/NS +AdBlock+ plugins | GPO restrictions | Bitlocker and Truecrypt | ShadowProtect images | IFW data backups + dual boot to XP Pro: GPO, SRP, Jetico firewall w/Process Attack filter
  #148  
Old September 21st, 2012, 09:47 PM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Anyone using Apparmor?

There's probably a specific grsecurity feature that doesn't work with it. You could always just stick to safe ones like chroot hardening and restrictions. Just stay away from PaX features.
__________________
  #149  
Old September 22nd, 2012, 10:02 AM
Ocky's Avatar
Ocky Ocky is offline
Very Frequent Poster
 
Join Date: May 2006
Location: George, S.Africa
Posts: 2,537
Default Re: Anyone using Apparmor?

Another apparmor profile combined with an apparmor sandbox profile for your perusal.

http://www.broadbandreports.com/foru...-On-the-Planet
__________________
Ubuntu Kubuntu Xubuntu Scientific Linux
  #150  
Old September 22nd, 2012, 11:19 AM
chronomatic chronomatic is offline
Very Frequent Poster
 
Join Date: Apr 2009
Posts: 1,324
Default Re: Anyone using Apparmor?

Quote:
Originally Posted by Ocky
Another apparmor profile combined with an apparmor sandbox profile for your perusal.

http://www.broadbandreports.com/foru...-On-the-Planet

I wrote that. I am KodiacZiller on BBR.com.
 

Wilders Security Forums > Software, Hardware and General Services > all things UNIX « Previous Thread | Next Thread »

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Settings
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 07:40 AM.


Powered by vBulletin® Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2013, Wilders Security Forums