Stateful access control using LSM CS547 Thomas Uphill Stateful - - PowerPoint PPT Presentation

stateful access control using lsm
SMART_READER_LITE
LIVE PREVIEW

Stateful access control using LSM CS547 Thomas Uphill Stateful - - PowerPoint PPT Presentation

Stateful access control using LSM CS547 Thomas Uphill Stateful access cont rol using LSM 11 December 2007 1 Why? Maintaining state allows for decisions to be made based on runtime conditions. State based policy can be more concise


slide-1
SLIDE 1

11 December 2007

Stateful access cont rol using LSM

1

Stateful access control using LSM

CS547 Thomas Uphill

slide-2
SLIDE 2

11 December 2007

Stateful access cont rol using LSM

2

Why?

  • Maintaining state allows for decisions to be

made based on runtime conditions.

  • State based policy can be more concise
  • State based policy can achieve different

results than stateless.

slide-3
SLIDE 3

11 December 2007

Stateful access cont rol using LSM

3

Background

UNIX Files Permissions LSM

slide-4
SLIDE 4

11 December 2007

Stateful access cont rol using LSM

4

UNIX

  • everything is a file

(keyboards, screens, printers, hardware, kernel internal structures)

  • kernel is the master process

process id (pid) = 0*

  • pid is unique

processes have children and parents

  • init is pid 1
  • /proc filesystem

contains process information

*(some kernel processes appear in as low process numbers,

e.g. [migration/0])

slide-5
SLIDE 5

11 December 2007

Stateful access cont rol using LSM

5

UNIX

  • kernel space vs user space

hardware applications kernel memory CPU

slide-6
SLIDE 6

11 December 2007

Stateful access cont rol using LSM

6

Files

  • Files are inodes + blocks
  • inodes are information nodes
  • blocks contain data on disk
  • wner

group permissions extended attributes block block block block block

slide-7
SLIDE 7

11 December 2007

Stateful access cont rol using LSM

7

Permissions

  • Classis UNIX permissions:

user group other read write execute

  • POSIX Access Control Lists (ACLs):

list of access control entries (ACEs) requires special storage in inodes

  • extended attributes on filesystem
  • access control structure in kernel
slide-8
SLIDE 8

11 December 2007

Stateful access cont rol using LSM

8

LSM

  • Linux security module framework

GNU General Public License

  • Crispin Cowan 2001
  • hooks

return 0 to allow return non-zero to deny

  • security fields

structs modified

slide-9
SLIDE 9

11 December 2007

Stateful access cont rol using LSM

9

kernel inode application

  • pen

DAC lookup inode LSM hook LSM module

slide-10
SLIDE 10

11 December 2007

Stateful access cont rol using LSM

10

struct inode { uid_t i_uid; gid_t i_gid; ... void *i_security; ... } struct task_struct { pid_t pid; struct task_struct *parent; ... void *security; ... } struct inode_security_struct { struct inode *inode; struct list_head list; u32 sid; u32 tsid; u32 fsid;

}

struct task_security_struct { struct task_struct *task; u32 sid; u32 tsid; u32 fsid; int exec; int read; int write; int del;

}

slide-11
SLIDE 11

11 December 2007

Stateful access cont rol using LSM

11

Implementation

  • subset of lsm hooks used

inode, bprm and task

  • inode security cache

kmem_cache_alloc/kmem_cache_create/kmem_cache_free

  • sid

/* unique identifier for runtime */

  • tsid /* unique identifier for task */
  • fsid /* unique identifier for file */
  • counters

read/write/del/exec

slide-12
SLIDE 12

11 December 2007

Stateful access cont rol using LSM

12

Law Language

user username operation { action/sid comp action/sid} group groupname operation { action/sid comp action/sid} Examples: user thomas exec { exec > 20 } user apache exec { tsid != tsid }

slide-13
SLIDE 13

11 December 2007

Stateful access cont rol using LSM

13

inode task init_module cache_alloc create procfile /proc/lsmlgi LAW lawloader check_law user process register_security inode_alloc_security task_alloc_security

slide-14
SLIDE 14

11 December 2007

Stateful access cont rol using LSM

14

Demonstration

visitor.law

slide-15
SLIDE 15

11 December 2007

Stateful access cont rol using LSM

15

Demonstration

apache.law

slide-16
SLIDE 16

11 December 2007

Stateful access cont rol using LSM

16

Demonstration

budget.law

slide-17
SLIDE 17

11 December 2007

Stateful access cont rol using LSM

17

Sources/References

Wikipedia on LSM http://en.wikipedia.org/wiki/Linux_Security_Modules LSM Source Code: http://lsm.bkbits.net UseNIX Security’02 Abstract: http://www.usenix.org/event/sec02/wright.html NSA’s SELinux http://www.nsa.gov/selinux/

slide-18
SLIDE 18

11 December 2007

Stateful access cont rol using LSM

18

Questions/Comments?

http://ramblings.narrabilis.com/wp/linux/stateful-access-control-using-lsm/