selinux policy editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · title:...

34
Copyright © 2005 Hitachi Software Engineering Co., Ltd. 1 2005 SELinux Symposium 2005 SELinux Symposium Simplifying Policy Management with Simplifying Policy Management with SELinux Policy Editor SELinux Policy Editor Hitachi Software Engineering The George Washington University Yuichi Nakamura [email protected]

Upload: tranhanh

Post on 02-Jan-2019

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd. 1

2005 SELinux Symposium 2005 SELinux Symposium

Simplifying Policy Management with Simplifying Policy Management with SELinux Policy EditorSELinux Policy Editor

Hitachi Software EngineeringThe George Washington UniversityYuichi Nakamura [email protected]

Page 2: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.2

ContentsContents

Problems of policySELinux Policy EditorProblemSummary

Page 3: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.3

Problems of policy

Page 4: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.4

Problems in configuring policyProblems in configuring policy

Type labelToo many configuration elementsText-based

Page 5: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.5

Problem: Type labelProblem: Type label

Example of conflict /varvar_t

/var/wwwvar_t

/var/runvar_t

/var/runrun_t

New type

Not human friendlyCan not remember type-file relationshipConflict situation

・some_t can read under /var :allow some_t var_t file:{read}

some_t can not newly labeled fileTo add policy is necessary

Page 6: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.6

Problems (cont)Problems (cont)

Too many configuration elementsObject class, access vector, macros

Object class about file:7Access vector about file: more than 17More than 100 macros..

“Attribute” makes things more complicatedRBAC is hard to understand

user A roles B;role B types C;

Hard to understand why role B types C is necessary?

Text based

SELinux is difficult for beginner

Page 7: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.7

Existing toolsExisting tools

setools by Tresys TechnologyFeatures to analyze policyEditing policy is text editor based

polygen by MITREGenerate policy from strace

Difficult for beginner

Page 8: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.8

SELinux Policy Editor

Page 9: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.9

Our approachOur approach

Our approachProblems

Simplified policy languageHide typeReduced elements

GUI

Type label

Many config elements

Text-based

Tool for SELinux beginner

Page 10: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.10

ArchitectureArchitecture

User

GUI

compiler

(1) Access

(2) Edit

(3) run (4) convert

SimplifiedLanguage

policy.conf

SELinuxSELinux Policy Editor

Page 11: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.11

Simplified Language(1): OverviewSimplified Language(1): Overview

Main featureHide typeIntegrated object class, access vector“global” domainSimplified RBAC

OthersDomain transition supportFile type trans support

Page 12: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.12

Simplified Language (2)Simplified Language (2) Hide typeHide type

Example:Allowing httpd_t to access under /etc/httpd and TCP 80

domain httpd_t;

allow /etc/httpd r;

allownet -tcp -port 80;

In normal SELinux policy language we must label /etc/httpd and tcp 80

Page 13: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.13

Simplified Language (3) Simplified Language (3) Integrating object class, access vectorIntegrating object class, access vector

Example

Original Our language7 file related object classesfile dir lnk_file chr_file blk_file sock_filefifo_file

only “file”

4 access vectorsread getattr ioctl lock

only “r(read)”

Object classes are integrated into following-file, network, IPC, terminal, special files(proc,tmpfs), admin

Page 14: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.14

Simplified Language(4) Simplified Language(4) ““globalglobal”” domaindomain

Domain: “global”Inherited by all domains

{ domain global;deny /etc/shadow; } { domain foo_t;allow /etc r; }

Example:

-> foo_t can not read /etc/shadow, but can read others in /etc.

-> To access /etc/shadow describe “allow /etc/shadow r”

Convenient to protect important resources

Page 15: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.15

Simplified Language(5) Simplified RBACSimplified Language(5) Simplified RBAC

Original RBACuser A types Brole B types C

Simplified RBAC no “role B types C”only “user A roles B”Example: webmaster_r role

;

role webmaster_r;user webmaster;domain_trans login_t /bin/bashallow /var/www r,w;

….define webmaster_r role….webmaster can use this role….login_t uses RBAC….webmaster_r can r/w /var/www

Page 16: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.16

Simplified Language(6) OthersSimplified Language(6) Others

Domain transitionExample: from initrc_t to httpd_tdomain httpd_t;domain_trans initrc_t /usr/sbin/httpd;

File type transWe could not hide type here..domain httpd_tallow /etc exclusive etc_runtime_t;Equivalent to “file_type_auto_trans(httpd_t, etc_t, etc_runtime_t)”

Page 17: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.17

CompilerCompiler

Main procedure

1. generate type label using resource name

2. Output SELinux config language

“allow” statement

relationship between resource and type

Page 18: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.18

Compiler: ExampleCompiler: Example

Simplified Languagedomain one_t;

allow /var r;

domain two_t;

allow /var/www r;

Generate type /var : var_t/var/www:var_www_tSELinux Policy

allow one_t var_t file:r_file_perms;

allow one_t var_www_t file:r_file_perms;

allow two_t var_www_t file:r_dir_perms;

…same “allow” for other 6 object classes

/var/(/.*) system_u:object_r:var_t

/var/www(/.*) system_u:object_r:var_www_t

“allow” statement for child directory

Page 19: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.19

GUI GUI

Edit simplified languageImplemented as Webmin module

http://www.webmin.com/User can administrate system from web browser

FeaturesEdit access control of file, network etc.Domain transRBACTemplate

Page 20: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.20

Main menuMain menu

Page 21: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.21

ACL menuACL menu

Page 22: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.22

File ACL File ACL

Page 23: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.23

File ACL propertyFile ACL property

Page 24: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.24

NetworkNetwork

Page 25: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.25

Domain transDomain trans

Page 26: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.26

RBACRBAC

Page 27: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.27

TemplateTemplate

Page 28: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.28

History of SELinux Policy EditorHistory of SELinux Policy Editor

Developed by Hitachi Software.First public release on 2003/1/31 by Hitachi Software

GPLAt http://www.selinux.hitachi-sk.co.jp/enEnglish and Japanese supportOnly for 2.4 based SELinux

Patch by Japan SELinux Users GroupWork on Fedora Core2

Mostly Mr. Takefumi Onabuta’s contributionpatch to original version

Future maintenance will be by SELinux Users groupIn summer, we will have time

But stop development from now to May.

Page 29: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.29

Problem of SELinux Policy EditorProblem of SELinux Policy Editor

Reduced SecurityEffect of integrating object classes, access vector

Example:File access vectoronly s(getattr), r(read), w(write), c(create)Does not support “append”

Syntax that supports detailed configuration is needed

Can not use default policySELinux policy->Simplified policy is not supportedPolicy packed with SELinux Policy Editor supports limited daemon

httpd, sshdWe have to prepare policy for other daemons

MaintenanceCompiler must be modified to support new version of SELinux

Access vector, object class are changed

Page 30: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.30

TO DOTO DO

“audit2allow” featureDetailed config modeConverter SELinux policy -> Simplified language

will be difficult..

Conditional Policy Extension supportImprovement of usability

Page 31: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.31

Downloading and installingDownloading and installing

You can download latest versionhttp://prdownloads.sourceforge.jp/selpe/13437/SELPE_jselugpatch.tgzExtract and read “README”

Page 32: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.32

SummarySummary

Complexity of SELinux policyType-labelToo many elementsText-based

SELinux Policy EditorResolve the complexity of SELinux by

Simplified languageGUI

Page 33: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.33

AcknowledgementsAcknowledgements

Mr. Takefumi OnabutaDevelopment of patch for FedoraCore2

Dr. Jonathan Stanton, GWUAdvice for abstract

Page 34: SELinux Policy Editorseedit.sourceforge.net/presentations/2005selinuxsymposium.pdf · Title: SELinux Policy Editor Author: Yuichi Nakamura Created Date: 2/28/2005 8:50:53 AM

Copyright © 2005 Hitachi Software Engineering Co., Ltd.34