SlideShare a Scribd company logo
1 of 23
Download to read offline
When ACLs Attack:
Cross-Platform File
Permissions

Andrew Leonard
ISB IT Exchange
July 13, 2012
In the beginning: "Traditional" Unix
Permissions

              Write
                       Execute
          Read
                              Not permitted

             drwxr-x---

                                 Other
           User
                      Group
Playing Nice With Other (Unix) Users
Some tactics:
● drwxrws---: Use setgid bit to force files and
  directories created within a directory to inherit its group
  id, rather than be assigned user's primary group id. (c.
  1972?)
● umask 002: Don't limit group permissions, or
  read/execute permissions for others. (c. 1982?)
● drwxrwxrwt: Only the item's owner, directory's owner,
  or root can rm or mv contained files. (c. 1986)
● User private groups: Group containing single user,
  allows private files when setting umask 002. (Red Hat
  c. 2002)
                            Take dates above with a giant grain of salt, they could be way off.
POSIX.1e ACLs
● Allow setting permissions for multiple users and groups
     per file.
●    Set explicit defaults (beyond the setgid bit).
user::rwx
user:aleonard:rwx
group::r-x
mask::rwx
other::r-x
default:user::rwx
default:user:aleonard:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
Meanwhile, in Redmond...
NTFS ACLs:
  Standard Permissions        Advanced Permissions

   ●   Modify                  ●   Full Control
   ●   Read & Execute          ●   Traverse Folder/Execute
   ●   Read                        File
   ●   Write                   ●   List Folder/Read Data
   ●   List Folder Contents    ●   Read Attributes
                               ●   Read Extended Attributes
                               ●   Create Files/Write Data
                               ●   Create Folders/Append Data
                               ●   Write Attributes
                               ●   Write Extended Attributes
                               ●   Delete Subfolders & Files
                               ●   Delete
                               ●   Read Permissions
                               ●   Change Permissions
                               ●   Take Ownership
Enter NFSv4 ACLs
A Standard, as of 2000:
http://ietfreport.isoc.org/idref/draft-falkner-nfsv4-acls/
https://tools.ietf.org/html/rfc3010
https://tools.ietf.org/html/rfc3530

# file: .
# owner: root
# group: bifx
        group:bifx:rwxpDdaARWcCos:fd----:allow
             owner@:rwxp--aARWcCos:------:allow
             group@:rwxp--a-R-c--s:------:allow
          everyone@:r-x---a-R-c--s:------:allow


 ●    Each Access Control Entry (ACE) is made up of four parts: identifier,
      access rights, flags, type (allow, deny, audit, alarm).
 ●    ACEs are traversed in order.
 ●    Access rights are NTFS compatible.
NFSv4 Privileges and Abbreviations
Privilege (abbreviation):

      Access Privileges (Linux, FreeBSD/Solaris)              Flags (Linux, FreeBSD/Solaris)

        ●   read_data, list_directory              (r,   r)    ●    file_inherit    (f,   f)
        ●   write_data, add_file                   (w,   w)    ●    dir_inherit     (d,   d)
        ●   execute                                (x,   x)    ●    inherit_only    (i,   i)
        ●   append_data, add_subdirectory          (a,   p)    ●    no_propagate    (n,   n)
        ●   delete_child                           (D,   D)
        ●   delete                                 (d,   d)
        ●   read_attributes                        (t,   a)
        ●   write_attributes                       (T,   A)
        ●   read_xattr                             (n,   R)
        ●   write_xattr                            (N,   W)
        ●   read_acl                               (c,   c)
        ●   write_acl                              (C,   C)
        ●   write_owner                            (o,   o)
        ●   synchronize                            (y,   s)
But: ACLs Aren't All Rainbows and
Unicorns
Assuming the trade-off of flexibility for additional complexity
is acceptable:
 ● Does your file system support them? Do your clients?
 ● Tools to manipulate ACLs are inconsistent and
    sometimes inefficient.
 ● Does your backup software preserve ACLs?
 ● Do your everyday file system utilities handle them
    correctly?
 ● Does your vendor understand them? How buggy is
    their implementation?
 ● How do new-style ACLs interact with legacy permission
    schemes?
Specifics: Seattle BioMed NAS
Environment
● NetApp
  β—‹ NFSv3/SMBv2
  β—‹ Mix of "office" and "science" data.
  β—‹ Home directories, group shares.
● FreeBSD/ZFS
  β—‹   ZFS v28
  β—‹   NFSv3, NFSv4/SMBv1
  β—‹   Serves NFSv4 via newnfs
  β—‹   Uses Samba for SMB
  β—‹   Larger shares, mostly scientific data
Specifics: Our Client Environment
Pretty standard stuff, in order of prevalence:
● Windows Desktops - SMBv1, SMBv2
   β—‹ 7, XP
   β—‹ 2000, NT4, sigh.
● OS X - SMB, no NFS
● Linux - NFSv3, NFSv4
   β—‹ CentOS
   β—‹ Ubuntu
Details: ACLs and NetApp
● NetApp has three different security modes
  you can choose from at a volume or qtree
  level.
  β—‹ "unix" mode: Unix-style permission bits.
  β—‹ "ntfs" mode: "For CIFS requests, Windows NT permissions
      determine user access. For NFS requests, the filer generates and
      stores a set of UNIX-style permission bits that are at least as
      restrictive as the Windows NT permissions. The filer grants NFS
      access only if the UNIX-style permission bits allow the user access."
  β—‹ They also have a third "mixed" mode, but nobody
    seems to use it: "A file's security style depends on whether the
      permission was last set from CIFS or NFS."
● (We're not using NFSv4 on NetApp today.)
  β—‹   http://www.netapp.com/us/communities/tech-ontap/nfsv4-0408.html
Details: ACLs and ZFS
ZFS has native NFSv4 ACLs. Important issue:
● What happens to an NFSv4 ACL when you chmod(2) is
     important. If a file has an NFSv4 ACL, do you:
      β—‹ Edit only the file's mode ("passthrough")?
      β—‹ Remove any NFSv4 ACL ("discard")?
      β—‹ Do something in-between ("groupmask")?
      β—‹ Let the admin decide on a per-file system basis?

On ZFS, this is controlled by the "aclmode" property. Sun removed this shortly
before the Oracle acquisition, enforcing "discard" on all ZFS file systems;
however, FreeBSD and Illumos have added "aclmode" back.

http://arc.opensolaris.org/caselog/PSARC/2010/029/20100126_mark.shellenbaum
Usage notes: User mapping matters
You can't share files across platforms if you
can't map identities across platforms.

We use Active Directory as our source of truth
for users and groups; NetApp and FreeBSD
systems access this information using LDAP.
Usage notes: General notes
● Simple permissions solve most of our use
  cases
  β—‹ User home directories are on NetApp, using unix-
    mode, 0700 permissions.
  β—‹ Ntfs-mode qtrees work well for most groups.
  β—‹ Many of our complex permission structures are
    SMB-only and therefore use ntfs-mode.
  β—‹ For those that need them, unix-mode qtrees are
    often enough.
● For everything else, there's NFSv4 ACLs on
  ZFS.
Usage notes: NetApp + ntfs-mode
● What you see with an ntfs qtree over NFS is often not
  what you get:
      $ ls -ld somedir
      drwxrwxrwx 40 root root 8192 Mar 16 10:45 somedir
      $ cd somedir
      -bash: cd: somedir: Permission denied

● Some apps try to be good citizens and check
   permissions before carrying out an action, and then fail.
   Others complain when they can't set permissions within
   an ntfs-mode qtree.
   β—‹ Setting cifs.ntfs_ignore_unix_security_ops (silently
      discard NFS permission operations) and nfs.
      ntacl_display_permissive_perms (displayed permissions are
      based on the maximum access granted to any user) to 'on'can help
      here.
Usage notes: NetApp + unix-mode
For simple configurations, these cifs shares
flags may get you what you need:

Make created files belong to a group:
-forcegroup <groupname>

Set initial permissions of newly created files and directories:
-umask <mask>
-dir_umask <mask>
-file_umask <mask>
Usage notes: ZFS on which
operating system?
We're using FreeBSD 8-STABLE, as we often
need fixes before they wind up in a -RELEASE.

The freebsd-fs@freebsd.org and freebsd-
stable@freebsd.org mailing lists have been
indispensable.

                  On the Solaris side of ZFS, there's always Oracle Solaris 11.
                                As far as Ilumos, Nexenta is always an option,
                          and I hear there's neat stuff being built on OmniOS.
                                                    There's also ZFS-on-Linux.
Usage Notes: ZFS file system
properties
We generally set permissions at the top of a
share, and have them inherited down into the
share, so we:
zfs set aclinherit=passthrough-x
Inherits all inheritable ACL entries without modification, but
inherit execute permission only if the file creation mode
specifies it.

zfs set aclmode=passthrough
When chmod(2) is called, "no changes are made to the
ACL other than creating or updating the necessary ACL
entries to represent the new mode of the file or directory."
Usage notes: Samba configuration -
simple permissions
We frequently use this idiom when configuring Samba
shares, roughly equivalent to umask 007 and a setgid
directory under NFS:
# Bitwise AND file/directory permissions with these masks:
create mask = 0660
directory mask = 2770
# File/directory permission bits that will always be set:
force create mode = 0660
force directory mode = 2770
# Assign group:
force group = "somelab"
# Limit permission bits that can be modified from Windows client -
# these are forced on:
force security mode = 0660
force directory security mode = 2770
Usage notes: Samba configuration -
complex ACLs
Set ACLs using native tools on ZFS as needed.

In smb.conf, remove force group, adjust
mask and mode settings as appropriate... and
let the NFSv4 ACLs at the file system level do
the rest.

(Remember: Samba is just another application
accessing files - v4 ACLs, including inheritance,
are still applied.)
Usage notes: Samba on FreeBSD/ZFS config to
allow ACL manipulation from Windows

We haven't heavily used this, but it seems to work.
Build Samba WITH_ACL_SUPPORT=true from FreeBSD ports; add the
following to smb.conf:

Global config:
unix extensions = no


Within a share definition:
nt acl support = yes
inherit acls = no
map acl inherit = yes
vfs objects = zfsacl
nfs4:mode = special
nfs4:acedup = merge
nfs4:chown = yes
Usage notes: Users increasingly
want to manipulate their own ACLs
In general, our users haven't wanted to
understand or manage their own ACLs, so IT
has done it for them. However, we now have
one group of users - an internal service
provider - that wants to actively manage their
own ACLs on a wide scale.
● They use either nfs4_setfacl on Linux, or
   an IT-supplied script to adjust permissions.
● This is a fairly new development, so it's
   unclear what pitfalls await.
Closing: NFSv4 in 2012
Despite being 12 years old, NFSv4 isn't widely-
or well-supported. Commercial vendors don't
dedicate more resources to it because users
aren't using it heavily; users don't use it heavily
because vendors aren't dedicating resources to
it.

As a consequence, the best implementations
and support today seem to be Open Source.

More Related Content

What's hot

Linux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScITLinux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScITvignesh0009
Β 
HIGH AVAILABLE CLUSTER IN WEB SERVER WITH HEARTBEAT + DRBD + OCFS2
HIGH AVAILABLE CLUSTER IN WEB SERVER WITH  HEARTBEAT + DRBD + OCFS2HIGH AVAILABLE CLUSTER IN WEB SERVER WITH  HEARTBEAT + DRBD + OCFS2
HIGH AVAILABLE CLUSTER IN WEB SERVER WITH HEARTBEAT + DRBD + OCFS2Utah Networxs Consultoria e Treinamento
Β 
Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems senthilamul
Β 
Lecture2 process structure and programming
Lecture2   process structure and programmingLecture2   process structure and programming
Lecture2 process structure and programmingMohammed Farrag
Β 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsKenny (netman)
Β 
The basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemThe basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemHungWei Chiu
Β 
Introduction to Unix-like systems (Part I-IV)
Introduction to Unix-like systems (Part I-IV)Introduction to Unix-like systems (Part I-IV)
Introduction to Unix-like systems (Part I-IV)hildenjohannes
Β 
Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)Ralf Dannert
Β 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory StructureKevin OBrien
Β 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadRavikumar Nandigam
Β 
Linuxppt
LinuxpptLinuxppt
LinuxpptTSUBHASHRI
Β 
AOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocksAOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocksZubair Nabi
Β 
Linux Security
Linux SecurityLinux Security
Linux SecurityMahdi Cherif
Β 
Linux: Basics OF Linux
Linux: Basics OF LinuxLinux: Basics OF Linux
Linux: Basics OF LinuxOmkar Walavalkar
Β 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questionsKavya Sri
Β 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file systemTaaanu01
Β 

What's hot (20)

Linux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScITLinux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScIT
Β 
Basic Unix
Basic UnixBasic Unix
Basic Unix
Β 
HIGH AVAILABLE CLUSTER IN WEB SERVER WITH HEARTBEAT + DRBD + OCFS2
HIGH AVAILABLE CLUSTER IN WEB SERVER WITH  HEARTBEAT + DRBD + OCFS2HIGH AVAILABLE CLUSTER IN WEB SERVER WITH  HEARTBEAT + DRBD + OCFS2
HIGH AVAILABLE CLUSTER IN WEB SERVER WITH HEARTBEAT + DRBD + OCFS2
Β 
Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems
Β 
Device drivers tsp
Device drivers tspDevice drivers tsp
Device drivers tsp
Β 
Lecture2 process structure and programming
Lecture2   process structure and programmingLecture2   process structure and programming
Lecture2 process structure and programming
Β 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fs
Β 
The basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemThe basic concept of Linux FIleSystem
The basic concept of Linux FIleSystem
Β 
Introduction to Unix-like systems (Part I-IV)
Introduction to Unix-like systems (Part I-IV)Introduction to Unix-like systems (Part I-IV)
Introduction to Unix-like systems (Part I-IV)
Β 
Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)
Β 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
Β 
Linux ppt
Linux pptLinux ppt
Linux ppt
Β 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in Hyderabad
Β 
Linuxppt
LinuxpptLinuxppt
Linuxppt
Β 
AOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocksAOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocks
Β 
Linux Security
Linux SecurityLinux Security
Linux Security
Β 
Linux: Basics OF Linux
Linux: Basics OF LinuxLinux: Basics OF Linux
Linux: Basics OF Linux
Β 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
Β 
Redis
RedisRedis
Redis
Β 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
Β 

Viewers also liked

Auditing unix linux system use with tivoli access manager for operating syste...
Auditing unix linux system use with tivoli access manager for operating syste...Auditing unix linux system use with tivoli access manager for operating syste...
Auditing unix linux system use with tivoli access manager for operating syste...Banking at Ho Chi Minh city
Β 
sVirt: Hardening Linux Virtualization with Mandatory Access Control
sVirt: Hardening Linux Virtualization with Mandatory Access ControlsVirt: Hardening Linux Virtualization with Mandatory Access Control
sVirt: Hardening Linux Virtualization with Mandatory Access ControlJames Morris
Β 
CITI, NFSv4, and ASCI
CITI, NFSv4, and ASCICITI, NFSv4, and ASCI
CITI, NFSv4, and ASCIpeterhoneyman
Β 
Fear (Halloween Event in Winnipeg) Sponsorship Deck
Fear (Halloween Event in Winnipeg) Sponsorship DeckFear (Halloween Event in Winnipeg) Sponsorship Deck
Fear (Halloween Event in Winnipeg) Sponsorship DeckJay Hall
Β 
Server hardening
Server hardeningServer hardening
Server hardeningTeja Babu
Β 
How Many Linux Security Layers Are Enough?
How Many Linux Security Layers Are Enough?How Many Linux Security Layers Are Enough?
How Many Linux Security Layers Are Enough?Michael Boelen
Β 
NFS(Network File System)
NFS(Network File System)NFS(Network File System)
NFS(Network File System)udamale
Β 

Viewers also liked (8)

Auditing unix linux system use with tivoli access manager for operating syste...
Auditing unix linux system use with tivoli access manager for operating syste...Auditing unix linux system use with tivoli access manager for operating syste...
Auditing unix linux system use with tivoli access manager for operating syste...
Β 
sVirt: Hardening Linux Virtualization with Mandatory Access Control
sVirt: Hardening Linux Virtualization with Mandatory Access ControlsVirt: Hardening Linux Virtualization with Mandatory Access Control
sVirt: Hardening Linux Virtualization with Mandatory Access Control
Β 
CITI, NFSv4, and ASCI
CITI, NFSv4, and ASCICITI, NFSv4, and ASCI
CITI, NFSv4, and ASCI
Β 
Fear (Halloween Event in Winnipeg) Sponsorship Deck
Fear (Halloween Event in Winnipeg) Sponsorship DeckFear (Halloween Event in Winnipeg) Sponsorship Deck
Fear (Halloween Event in Winnipeg) Sponsorship Deck
Β 
Server hardening
Server hardeningServer hardening
Server hardening
Β 
slides
slidesslides
slides
Β 
How Many Linux Security Layers Are Enough?
How Many Linux Security Layers Are Enough?How Many Linux Security Layers Are Enough?
How Many Linux Security Layers Are Enough?
Β 
NFS(Network File System)
NFS(Network File System)NFS(Network File System)
NFS(Network File System)
Β 

Similar to When ACLs Attack

Linux administration training
Linux administration trainingLinux administration training
Linux administration trainingiman darabi
Β 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016Muhammad Moinur Rahman
Β 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systemsalok pal
Β 
Linux redhat final
Linux redhat finalLinux redhat final
Linux redhat finalchbashir22268
Β 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboardsDenis Ristic
Β 
Solaris basics
Solaris basicsSolaris basics
Solaris basicsAshwin Pawar
Β 
Lamp ppt
Lamp pptLamp ppt
Lamp pptReka
Β 
TLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsTLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsShu-Yu Fu
Β 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Gerard Braad
Β 
Unix Security
Unix SecurityUnix Security
Unix Securityreplay21
Β 
Linux Presentation
Linux PresentationLinux Presentation
Linux PresentationMuhammad Qazi
Β 
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2AcΓ‘cio Oliveira
Β 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in LinuxHenry Osborne
Β 
Writing Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxWriting Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxRajKumar Rampelli
Β 

Similar to When ACLs Attack (20)

Linux administration training
Linux administration trainingLinux administration training
Linux administration training
Β 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
Β 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
Β 
Linux introduction (eng)
Linux introduction (eng)Linux introduction (eng)
Linux introduction (eng)
Β 
Linux redhat final
Linux redhat finalLinux redhat final
Linux redhat final
Β 
Linux
Linux Linux
Linux
Β 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
Β 
Lamp ppt
Lamp pptLamp ppt
Lamp ppt
Β 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
Β 
Lamp ppt
Lamp pptLamp ppt
Lamp ppt
Β 
TLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsTLPI Chapter 14 File Systems
TLPI Chapter 14 File Systems
Β 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)
Β 
Linux
LinuxLinux
Linux
Β 
Edubooktraining
EdubooktrainingEdubooktraining
Edubooktraining
Β 
Unix Security
Unix SecurityUnix Security
Unix Security
Β 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
Β 
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2
Β 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
Β 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
Β 
Writing Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxWriting Character driver (loadable module) in linux
Writing Character driver (loadable module) in linux
Β 

Recently uploaded

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
Β 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
Β 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
Β 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
Β 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
Β 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
Β 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
Β 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
Β 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
Β 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
Β 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
Β 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
Β 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
Β 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
Β 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
Β 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Β 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraΓΊjo
Β 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
Β 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
Β 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
Β 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Β 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Β 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Β 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Β 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
Β 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Β 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Β 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Β 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Β 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Β 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
Β 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
Β 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Β 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
Β 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Β 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Β 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Β 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Β 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Β 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Β 

When ACLs Attack

  • 1. When ACLs Attack: Cross-Platform File Permissions Andrew Leonard ISB IT Exchange July 13, 2012
  • 2. In the beginning: "Traditional" Unix Permissions Write Execute Read Not permitted drwxr-x--- Other User Group
  • 3. Playing Nice With Other (Unix) Users Some tactics: ● drwxrws---: Use setgid bit to force files and directories created within a directory to inherit its group id, rather than be assigned user's primary group id. (c. 1972?) ● umask 002: Don't limit group permissions, or read/execute permissions for others. (c. 1982?) ● drwxrwxrwt: Only the item's owner, directory's owner, or root can rm or mv contained files. (c. 1986) ● User private groups: Group containing single user, allows private files when setting umask 002. (Red Hat c. 2002) Take dates above with a giant grain of salt, they could be way off.
  • 4. POSIX.1e ACLs ● Allow setting permissions for multiple users and groups per file. ● Set explicit defaults (beyond the setgid bit). user::rwx user:aleonard:rwx group::r-x mask::rwx other::r-x default:user::rwx default:user:aleonard:rwx default:group::r-x default:mask::rwx default:other::r-x
  • 5. Meanwhile, in Redmond... NTFS ACLs: Standard Permissions Advanced Permissions ● Modify ● Full Control ● Read & Execute ● Traverse Folder/Execute ● Read File ● Write ● List Folder/Read Data ● List Folder Contents ● Read Attributes ● Read Extended Attributes ● Create Files/Write Data ● Create Folders/Append Data ● Write Attributes ● Write Extended Attributes ● Delete Subfolders & Files ● Delete ● Read Permissions ● Change Permissions ● Take Ownership
  • 6. Enter NFSv4 ACLs A Standard, as of 2000: http://ietfreport.isoc.org/idref/draft-falkner-nfsv4-acls/ https://tools.ietf.org/html/rfc3010 https://tools.ietf.org/html/rfc3530 # file: . # owner: root # group: bifx group:bifx:rwxpDdaARWcCos:fd----:allow owner@:rwxp--aARWcCos:------:allow group@:rwxp--a-R-c--s:------:allow everyone@:r-x---a-R-c--s:------:allow ● Each Access Control Entry (ACE) is made up of four parts: identifier, access rights, flags, type (allow, deny, audit, alarm). ● ACEs are traversed in order. ● Access rights are NTFS compatible.
  • 7. NFSv4 Privileges and Abbreviations Privilege (abbreviation): Access Privileges (Linux, FreeBSD/Solaris) Flags (Linux, FreeBSD/Solaris) ● read_data, list_directory (r, r) ● file_inherit (f, f) ● write_data, add_file (w, w) ● dir_inherit (d, d) ● execute (x, x) ● inherit_only (i, i) ● append_data, add_subdirectory (a, p) ● no_propagate (n, n) ● delete_child (D, D) ● delete (d, d) ● read_attributes (t, a) ● write_attributes (T, A) ● read_xattr (n, R) ● write_xattr (N, W) ● read_acl (c, c) ● write_acl (C, C) ● write_owner (o, o) ● synchronize (y, s)
  • 8. But: ACLs Aren't All Rainbows and Unicorns Assuming the trade-off of flexibility for additional complexity is acceptable: ● Does your file system support them? Do your clients? ● Tools to manipulate ACLs are inconsistent and sometimes inefficient. ● Does your backup software preserve ACLs? ● Do your everyday file system utilities handle them correctly? ● Does your vendor understand them? How buggy is their implementation? ● How do new-style ACLs interact with legacy permission schemes?
  • 9. Specifics: Seattle BioMed NAS Environment ● NetApp β—‹ NFSv3/SMBv2 β—‹ Mix of "office" and "science" data. β—‹ Home directories, group shares. ● FreeBSD/ZFS β—‹ ZFS v28 β—‹ NFSv3, NFSv4/SMBv1 β—‹ Serves NFSv4 via newnfs β—‹ Uses Samba for SMB β—‹ Larger shares, mostly scientific data
  • 10. Specifics: Our Client Environment Pretty standard stuff, in order of prevalence: ● Windows Desktops - SMBv1, SMBv2 β—‹ 7, XP β—‹ 2000, NT4, sigh. ● OS X - SMB, no NFS ● Linux - NFSv3, NFSv4 β—‹ CentOS β—‹ Ubuntu
  • 11. Details: ACLs and NetApp ● NetApp has three different security modes you can choose from at a volume or qtree level. β—‹ "unix" mode: Unix-style permission bits. β—‹ "ntfs" mode: "For CIFS requests, Windows NT permissions determine user access. For NFS requests, the filer generates and stores a set of UNIX-style permission bits that are at least as restrictive as the Windows NT permissions. The filer grants NFS access only if the UNIX-style permission bits allow the user access." β—‹ They also have a third "mixed" mode, but nobody seems to use it: "A file's security style depends on whether the permission was last set from CIFS or NFS." ● (We're not using NFSv4 on NetApp today.) β—‹ http://www.netapp.com/us/communities/tech-ontap/nfsv4-0408.html
  • 12. Details: ACLs and ZFS ZFS has native NFSv4 ACLs. Important issue: ● What happens to an NFSv4 ACL when you chmod(2) is important. If a file has an NFSv4 ACL, do you: β—‹ Edit only the file's mode ("passthrough")? β—‹ Remove any NFSv4 ACL ("discard")? β—‹ Do something in-between ("groupmask")? β—‹ Let the admin decide on a per-file system basis? On ZFS, this is controlled by the "aclmode" property. Sun removed this shortly before the Oracle acquisition, enforcing "discard" on all ZFS file systems; however, FreeBSD and Illumos have added "aclmode" back. http://arc.opensolaris.org/caselog/PSARC/2010/029/20100126_mark.shellenbaum
  • 13. Usage notes: User mapping matters You can't share files across platforms if you can't map identities across platforms. We use Active Directory as our source of truth for users and groups; NetApp and FreeBSD systems access this information using LDAP.
  • 14. Usage notes: General notes ● Simple permissions solve most of our use cases β—‹ User home directories are on NetApp, using unix- mode, 0700 permissions. β—‹ Ntfs-mode qtrees work well for most groups. β—‹ Many of our complex permission structures are SMB-only and therefore use ntfs-mode. β—‹ For those that need them, unix-mode qtrees are often enough. ● For everything else, there's NFSv4 ACLs on ZFS.
  • 15. Usage notes: NetApp + ntfs-mode ● What you see with an ntfs qtree over NFS is often not what you get: $ ls -ld somedir drwxrwxrwx 40 root root 8192 Mar 16 10:45 somedir $ cd somedir -bash: cd: somedir: Permission denied ● Some apps try to be good citizens and check permissions before carrying out an action, and then fail. Others complain when they can't set permissions within an ntfs-mode qtree. β—‹ Setting cifs.ntfs_ignore_unix_security_ops (silently discard NFS permission operations) and nfs. ntacl_display_permissive_perms (displayed permissions are based on the maximum access granted to any user) to 'on'can help here.
  • 16. Usage notes: NetApp + unix-mode For simple configurations, these cifs shares flags may get you what you need: Make created files belong to a group: -forcegroup <groupname> Set initial permissions of newly created files and directories: -umask <mask> -dir_umask <mask> -file_umask <mask>
  • 17. Usage notes: ZFS on which operating system? We're using FreeBSD 8-STABLE, as we often need fixes before they wind up in a -RELEASE. The freebsd-fs@freebsd.org and freebsd- stable@freebsd.org mailing lists have been indispensable. On the Solaris side of ZFS, there's always Oracle Solaris 11. As far as Ilumos, Nexenta is always an option, and I hear there's neat stuff being built on OmniOS. There's also ZFS-on-Linux.
  • 18. Usage Notes: ZFS file system properties We generally set permissions at the top of a share, and have them inherited down into the share, so we: zfs set aclinherit=passthrough-x Inherits all inheritable ACL entries without modification, but inherit execute permission only if the file creation mode specifies it. zfs set aclmode=passthrough When chmod(2) is called, "no changes are made to the ACL other than creating or updating the necessary ACL entries to represent the new mode of the file or directory."
  • 19. Usage notes: Samba configuration - simple permissions We frequently use this idiom when configuring Samba shares, roughly equivalent to umask 007 and a setgid directory under NFS: # Bitwise AND file/directory permissions with these masks: create mask = 0660 directory mask = 2770 # File/directory permission bits that will always be set: force create mode = 0660 force directory mode = 2770 # Assign group: force group = "somelab" # Limit permission bits that can be modified from Windows client - # these are forced on: force security mode = 0660 force directory security mode = 2770
  • 20. Usage notes: Samba configuration - complex ACLs Set ACLs using native tools on ZFS as needed. In smb.conf, remove force group, adjust mask and mode settings as appropriate... and let the NFSv4 ACLs at the file system level do the rest. (Remember: Samba is just another application accessing files - v4 ACLs, including inheritance, are still applied.)
  • 21. Usage notes: Samba on FreeBSD/ZFS config to allow ACL manipulation from Windows We haven't heavily used this, but it seems to work. Build Samba WITH_ACL_SUPPORT=true from FreeBSD ports; add the following to smb.conf: Global config: unix extensions = no Within a share definition: nt acl support = yes inherit acls = no map acl inherit = yes vfs objects = zfsacl nfs4:mode = special nfs4:acedup = merge nfs4:chown = yes
  • 22. Usage notes: Users increasingly want to manipulate their own ACLs In general, our users haven't wanted to understand or manage their own ACLs, so IT has done it for them. However, we now have one group of users - an internal service provider - that wants to actively manage their own ACLs on a wide scale. ● They use either nfs4_setfacl on Linux, or an IT-supplied script to adjust permissions. ● This is a fairly new development, so it's unclear what pitfalls await.
  • 23. Closing: NFSv4 in 2012 Despite being 12 years old, NFSv4 isn't widely- or well-supported. Commercial vendors don't dedicate more resources to it because users aren't using it heavily; users don't use it heavily because vendors aren't dedicating resources to it. As a consequence, the best implementations and support today seem to be Open Source.