
COMPUTER ENGINEERING
1999 25 8 Vol.25 No.8 1999



ϵͳȫоӦ
Ϊũ
ժҪһϵͳȫģͣӦóʽϵ㣬ʵUnixµһڹİȫ⹤ͨģͣϵͳӦó򣩵ĽϵͳķһʹãģϵͳȨϢ໥á
ؼʣϵͳȫգģͣ⣻ڹ
Research of System Security Check and Application
Liu Chun,Wang Weinong
(Department of Computer,Shanghai Jiaotong University,Shanghai 200030)
AbstractHere we present a formal model of system security.The key improvement is the description of interaction beween subjects and object.In addition,we present formal description of system applications (especially privileged programs).Based on the model and program description,we design and implement a rule-based security checd tool on Unix.By modeling of the system,analyzing the target host and using of rules,the security of the target host can be considered in a whole.
Key wordsSystem security;Risk;Model;Check;Rule-based
1 ϵͳȫģ
Unix Ǹϰȫϵͳһİȫƣ֤ ( û ) Ȩ޿Ƶȣͬʱ Unix Ǹ൱ӵϵͳЭͬовȨͼ 1  Unix ϵͳȨһģͣĲϵͳҲõġ

ͼ 1 Unix ϵͳȨļģ 
ײǲϵͳģеԴ ( ڴ棬̣ļ CPU) ԴֻͨϵͳʡͨṩԴıƣԶûΪԼֹΥȫĲȻһϵͳͨȨ ( в ) Ϊ书ܿƹĵİȫơЩȨ̣ԼİȫƣֹáļȨ̣ϵͳİȫϵͳðȫϵͳģ֮໥ϵϵ˸ӣû˵˽ⰲȫϵͳ֮ϵʹȫϵͳһ׵顣   Unix һ  ˣҪһԶ Unix ϵͳİȫ״ 
 BLP ģ [6] У (Subject ) Ǿģ (Object) ǾԱġ BLP ģ Unix Ĵ۸ӵİȫϵͳʱͻѡҪΪ Unix ӦóԼΪʽԸӦó˵ Ĭϵļǿ / ӦóġҲ˵Ͷ֮ĹϵǵԶ Read  Write  Execute  Chmod ȣж Control  
1.1 ȫģ͵ѧ 
ǵʵʲϵͳ֮໥ԼĹϵԡ壬󣬹ϵΪҪԪصİȫģͣϵͳΪ {B  M  H} У 
B  {S  T  R  O} Ӽ 
M ϵͳĴȡƾ֮ʱԣ 
H Ƕνṹ
S 壬ż User  Program ɣռ䡢ʱ T,R  
T һ˳ϵʾ֮ϵʱԣɿһʱ㣻 
R ϵϵǵ Subject  Object Ĳ Read(Bind)  Write  Create  Remove ȣ Object  Subject Ĺϵ Control Լϸϵıհ Read*  Write*  Control*  
O 󣬿ļ豸 ( ̣ڴӳ˿ںţ TTY նˣ X- ڵ )  
1.2 ֱӴȡϵ 
Read  Write  Scan  Create  Chmod ϵĶ忼ǵϢĲ Control ϵĶ忼ǵȨ (  ) Ĳ Read, Write, Create, Control Ķ弰ͼ£ 
 1  S i Can Read  Om Ϊ CanRead(S i , O m )  
 2  S i Can Write  Om Ϊ CanWrite(S i , O m )  
 3  O m Control  Si Ϊ ControlBy(S i , O m )  
 3 ϵͳУͶԣ Read, Write 󣬻Ϊ塣 
 4  S i Can Scan  Om Ϊ CanScan(S i , O m )  Unix ԣĿ¼ṹĲϵͳУ Novell  Windows NT Ҳõġ 
ϼ㣬˵ Si Զ O m ӵеȨޣ Si Զ O m ʵʷڶνṹ 
1.3 Ŀ¼ṹ 
ʵʵĲϵͳУ豸ļϵͳνṹ洢ġ Unix ļϵͳǵ͵ӣ 
壺 O p  O t ĸףΪ Parent(O p ,O t )  
УĿ¼ṹصİȫ (  ) ǣ 
Rule D1  Scan(Si,Op)  CanScan(Si ,Ot)Parent(Op ,Ot)=>Scan(Si,Ot)
Rule D2  Scan(Si,Op)  CanRead(Si ,Ot)Parent(Op ,Ot)=>Read(Si,Ot) 
Rule D3  Scan(Si,Op) CanWrite(Si ,Ot)Parent(Op ,Ot)=>Write(Si,Ot) 
 Si ֻڷ Ot ĸĿ¼ʱܹ Ot
Rule D4  Scan(Si ,Op )  CanWrite(Si ,Op )  Parent(Op ,Ot )=>Write(Si ,Ot )  Si ܹд Ot ĸĿ¼ S i ܹ滻 Ot Ϊ Si ܹд Ot û bin д /etc Ϳ滻 /etc/passwd  
1.4 Ӵȡϵ 
еļӴȡϵǴֱӴȡϵ֮໥Լϵݻ 
(1)  Read(Indirect Read) Ϊ read*(S i , V m )  
 1-1 Write*(S m ,O i )  Read(S n ,O i )=>Read*(S n ,S m ) 
 1-2 Write*(S m ,O i )  Read(S n ,O i )=>Read*(S n ,S m ) 
(2)  Write(Indirect Write) Ϊ write*(S i , V m )  
 2-1 Read/Read*/ControlBy/ControlBy*(S i ,O m )  Write(S i ,O n )=>Write*(O m ,O n ) 
 2-2 Read*/ControlBy*(S i ,S m )  Write(S i ,O n )=>Write*(S m ,O n ) 
(3)  Control By(Indirect Control By) Ϊ ControlBy*(S i , V m )  
 3-1 Write/Write*(S m ,O i )  ControlBy(S n ,O i )=>ControlBy*(S n ,S m ) 
 3-2 Write*(O i ,O m )  ControlBy(S i ,O m )=>ControlBy*(S i ,O i ) 
1.5 Ȩģͻ 
ϵģͣԶȨģΪڼͼⶼаʹȨģ壬ڼ˵ԽϾȷعƸóΪ໥ĹϵƳϵͳϢ򣬶ϵͳİȫжϣڼ˵ԼʱȨ  ԽȨ  ΪԱӦֹʩ 
һȨԱΪһϵĹϵ 
 [ ʱ ] ϵ󡵡ڵǰģУǵӽ̹ܵԣͲǷӽ̡ 
Sendmail ԱΪ 
Program Sendmail 
bind(port 25); /* read( port 25); */ 
controledby(sendmail aliases file) 
controledby($HOME/.mailrc) 
read(Everything can be read) 
write( mail queue ) 
write( each user's mail spool ie: /var/spool/$LOGINNAME) 
END 
1.6 
ϵģͺ͹򣬿Թɳһֹģͣͼ 2 ʾ 

ͼ 2 ģ 
2 ȫ⹤ߵʵ 
ģͣ Unix ϵͳİȫ⹤ߣҪ¼ֹɣ 
(1) ļϵͳ (Baseline Filesystem) Ȩ޵ļ顣 
(2) ϵͳϢѼ 
(3) ؼӦó֪ Bug ļ⡣ 
(4) ⡢Ӧóģ塣 
(5) ƥ䣬 ( ģ⹥ )  
(6) ԵõĽйˣ 

ͼ 3 ȫ⹤ߵʵ 
һΣյû Bug һĹϵƽʵϵͳı֡磺 
 NFS  /home ϵ 
anyhost anybody write /home 
anyhost anybody read /home 
 hosts.euqiv  ''ϵ 
anyhost anybody control localhost ftp /bin/sh 
2.1 ļϵͳȨ޵ļ 
ļϢؼļ͡顢ȨģʽȡУ͵ȣ  ƥ / ģ⹥  ģɺ̵Ĺ
2.2 ϵͳϢļ 
Ҫ·棺
.ȫķ򣺼 inetd ǷûЩϵĲȫ rexd  rshd  TFTP ȡ 
. NFS ļϵͳãûƵؼļϵͳ 
. Sendmail ֪ Bugs ľȰȫ©Ƿ uudecode, decode ꣻ VRFY  EXPN Ƿ 'WIZ'  'DEBUG' Ƿ񼤻 
ϵļһĹϵ 
2.3 Ӧó֪ BUG ļ 
ҪӦó Bug ǳʱʹ Bug Ȩ ( Ӧ )  Bug  1988  12 ǰ Sendmail  'WIZ' ʹߵõ root shell  
2.4 Ӧóģ 
ڶһ鹥  ƥ / ģ⹥  ģӳ䵽ÿܵĹϵϣΪԹϵһЩڶİȫ , 磺
if ( localhost $USER write /dev/kmem ) localhost $USER $SHELL control localhost root /bin/csh 
if ( anyhost anybody read /etc/passwd ) anyhost anybody control localhost root /bin/csh 
߱ʾǵߵõ /etc/passwd £ƽ root ĿӶõ root  shell  
Ӧóģ壬ӦóĽϵڱߵʵУʹõģ͵ļ򻯰汾ʽǣ 
 ( ȫ·ļ ) 
[Controled By] Ƹóļ 
[Readable Area] Զȡļ 
[Writable Area] Ӧдļ 
[Executable Subject] Լ (Active) ĳ 
2.5 ƥģ⹥ 
ȡϵڹϵ⣬ȻϵͳĹϵģ⹥㡣 
ģ⹥ʹõĹǣ 
Write*(S m ,O i )  Read(S n ,O i )=>Read*(S n ,S m ) 
Write*(O m ,O i )  Read(S n ,O i )=>Read*(S n ,O m ) 
Read/Read*/ControlBy/ControlBy*(S i ,O m )  Write(S i ,O n )=>Write*(O m ,O n ) 
Read*/ControlBy*(S i ,O m )  Write(S i ,O n )=>Write*(S m ,O n ) 
Write/Write*(S m ,O i )  ControlBy(S n ,O i )=>ControlBy*(S n ,S m ) 
Write*(O i ,O m )  ControlBy(S i ,O m )=>ControlBy*(S i ,O i ) 
2.6 Ĺ˺ 
ĽһӴľ󣬱ʾϵͳпܵ©ȫ뽫кϵͳȫϢ˳Աϵͳ߷ҲҪһЩĿǰĹǣһûܹдԼļһûĳ (  ) ܹƲԼĳӦ 
ߵλϺͨѧϵϺ 200030
ο 
1 Shieh S W,Gligor V D.A Pattern-oriented Intrusion-detction Model and Its Applications.In IEEE Symposium on Research Security and Privacy,Oakland,1991 
2 Ko C,Fink G,Levitt K.Automated Detection of Vulnerabilities in Privileged Programs by Execution Monitoring.In Computer Security Applications Conference , Orlando, Florida,1994,12:5-9
3 Cuppens F.A Logical Analysis of Authorized and Prohibited Information Flows.In IEEE Symposium on Research in Security and Privacy, Oakland, 1993 
4 Snyder L.Formal Models of Capability-based Protection Systems, In IEEE Transactions on Computers,1981,30(3) 
5 Curry D A.Improving the Security of Your Unix System.SR International ITSTD-721-FR-90-21, 1990 [6] Padula B L et al, Secure Computer System: A Mathematical Model, MTR-2547, 1973,2(5) 
6 Padula B L.Secure Computer System:A Marhematical Model,1973 
