se linux(app armor)

17
S SELinux A presentation for C4A Kenya

Upload: frankie-onuonga

Post on 14-May-2015

775 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: SE Linux(app armor)

S

SELinuxA presentation for C4A Kenya

Page 2: SE Linux(app armor)

Table of contents

Introduction

Rationale and design

How to use it SELinux states Managing SELinux Policies

Page 3: SE Linux(app armor)

Background

Community Project Originated in 1980s security research Academic research prototype (Flask) 1990s Ported to Linux, released under GPL in 2000 Distro adoption, upstream merge, certification Adoption and innovation by users

Page 4: SE Linux(app armor)

Background

SELinux= Security Enhanced Linux Formally knows as SE tools It is a mechanism for supporting mandatory access

control security policies Linux Security Modules(LSM) run in the Linux kernel

Page 5: SE Linux(app armor)

SELinux Features

Separation of policy from enforcement Predefined policy interfaces

Support for applications querying the policy and enforcing access control

Independent of specific policies, policy languages, security label formats and contents

Caching of access decisions for efficiency Policy changes are possible (!!!)

Separate measures for protecting system integrity and data confidentiality

Controls over process initialization and inheritance and program execution

Controls file systems, directories, files, and open file descriptors

Controls over sockets, messages, and network interfaces

Coherent stacking

Page 6: SE Linux(app armor)

Where is SELinux

Redhat Enterprise Linux v4 / v5

CentOS v4 / v5

Novel SLES, OpenSuSE

Gentoo

Debian

Page 7: SE Linux(app armor)

Misconceptions about SELinux

“Life is too short for SELinux” – Theodore Ts’o

Upstream vendors requires me to disable SELinux

Page 8: SE Linux(app armor)

Why use SELinux

It confines services in compartments

No, it isn’t difficult

Flexible

Increases security

Existing SELinux solution Inflexible Don’t meet general requirements Hindered adoption Niche products: expensive and weird

Page 9: SE Linux(app armor)

HOW TO USE IT

Page 10: SE Linux(app armor)

Changing SELinux States

Enforcing Enable and enforce the SELinux security policy on

the system, denying access and logging actions

PermissiveEnables, but will not enforce the security policy, only warn and log actions

DisabledSELinux is turned off

Page 11: SE Linux(app armor)

Checking the state of SELinux

Sestatus Enforcing permissive

Page 12: SE Linux(app armor)

Access Conrtol

Type Enforcement (TE)The primary mechanism of access control used in the targeted policy

Role-Based Access Control (RBAC)Based around SELinux users (not necessarily the same as the Linux user)

Multi-Level Security (MLS)Not used and often hidden in the default targeted policy.

Page 13: SE Linux(app armor)

Relabeling files

chcon -R -t httpd sys content t /usr/srv/www

semanage fcontext -a -t httpd sys content t ”/usr/srv/www(/.*)?”

restorecon -Rv -n /var/www/html Relabelling whole the filesystem genhomedircon touch /.autorelabel reboot

Page 14: SE Linux(app armor)

Enabling bools and ports

Managing ports semanage port -l

semanage port -a -t http port t -p tcp 8181 Managing predefined policies

getsebool -a — grep sambasetsebool -P samba enable home dirs on

Page 15: SE Linux(app armor)

Generating policies

less /var/log/audit/audit.log

grep zarafa /var/log/audit/audit.log — audit2allow -m zarafa > zarafa.te

Page 16: SE Linux(app armor)

Some policy

Dovecot Policy

Zarafa Policy

Spamassassin Policy

Page 17: SE Linux(app armor)

Finally over

Contact me on twitter: @Fonuonga EMAIL:[email protected]

DONE BY :FRANK ONUONGA