246c527380a50e1b274f347f5cf3f6f2.ppt
- Количество слайдов: 15
So. Be. Ne. T Project Distri. Net status report June 25, 2004 Bart De Win Wouter Joosen Frank Piessens
Distri. Net research group • Open, distributed object support platforms for advanced applications • Task forces: – Networking – Multi-agent systems – Embedded systems – Language technology and middleware – Security Bart De Win So. Be. Ne. T - Distri. Net status report 2
Project involvement • Tracks – Track 1: programming and composition – Track 2: software engineering • Members – Wouter Joosen, Frank Piessens, Pierre Verbaeten, Bart De Win, Eddy Truyen, Tine Verhanneman, Lieven Desmet, Bart Jacobs, Bert Lagaisse, Liesje Demuynck, Yves Younan Bart De Win So. Be. Ne. T - Distri. Net status report 3
Current activities: track 1 • Security vulnerabilities – Programming language, architecture, classification • Case Studies – CRM, e-banking, e-health • Solution techniques – Inventory: ACM survey paper – Programming language: C(++), Java, Spec# • Complex composition – Doctoral work (Bart, Eddy, Tine) Bart De Win So. Be. Ne. T - Distri. Net status report 4
Current activities: track 2 • Security requirements – Functional vs. technological vs. quality • Technology study – CC, STRIDE, CMM, ISO 17799, … • ECOOP tutorial (TS 1) Bart De Win So. Be. Ne. T - Distri. Net status report 5
Engineering application-level security through AOSD • Highlights of a Ph. D. dissertation
Security is Pervasive • Application-level security is crosscutting in location /** Method to calculate the digest of the current message. *After calculation, the engine is reset. *@returns the message digest in abytearray. */ public byte[] engine. Digest(){ //calculate correct number of bits in total message long orig. Msg. Count = count << 3 ; //append padding bits engine. Update((byte)128) ; // append byte "10000000" while ((( int)(count & 63)) != 56){ engine. Update((byte)0) ; //append byte 0 until 56 mod 64 } /** Current 64 byte block to process */ private byte[] current. Block = new byte[64] ; /** Constructor. */ public MD 5(){ super("MD 5") ; engine. Reset() ; } //append length (big endian) int[] cnt = new int[2] ; cnt[0] = ( int) (orig. Msg. Count & 0 xffff) ; cnt[1] = ( int) (orig. Msg. Count >> 32) ; int. To. Byte(current. Block 56, cnt, 0, 8) ; , //process last block MD 5 Transform() ; // ************ // JCA JAVA ENGINE METHODS // ************ /** Method to reset the MD 5 engine. */ public void engine. Reset(){ count = 0 ; state[0] = 0 x 67452301 ; state[1] = 0 xefcdab 89 ; state[2] = 0 x 98 badcfe ; state[3] = 0 x 10325476 ; } /** Method to add a byte to the current message. *@param input : the byte to append to the current message. */ public void engine. Update(byte input){ //append byte to current. Block[(int)(count & 63)] = input ; //count&63 = count%64 //if current. Block full => process if ((int)(count & 63) == 63){ //whole block => process MD 5 Transform() ; } //and update internal state (count) count++ ; } /** Method to add a byte array to the current message. *@param buf : the bytearray to append to the current message. *@param offset : the offset to start from appending the bytearray to the current message. *@param len : the length of the message to append to the current message. */ public void engine. Update(byte buf, int offset, int len){ [] //FIRST : process first part of buffer until no more or full block //calculate number of bytes that fit in current block int no = java. lang. Math. min(len 64 - (int)(count&63)) ; , System. arraycopy(buf offset, current. Block, (int)(count&63), no) ; , count += no ; len -= no ; offset += no ; } //return digest byte[] result = new byte[16] ; int. To. Byte(result 0, state, 0 , 16) ; , //reset the engine for JCA compatibility engine. Reset() ; return result ; public class MD 5 Test { public static void main(String[]args){ Message. Digest digest = null ; Security. add. Provider(new Distri. Net()) ; try{ digest = Message. Digest. get. Instance("MD 5", "Distrinet") ; } catch(Exception e){ e. print. Stack. Trace () ; System. exit(1) ; } digest. update(args[0]. get. Bytes()) ; System. out. println("Input : " + format. Bin 2 Hex(args[0]. get. Bytes(), 16, 2) +"n" ) ; System. out. println("Digest : " + format. Bin 2 Hex(digest(), 16, 2) +"n" ) ; int m = ( n % s 1 ); for ( int i = m ; i < s 1 ; i++ ) { if ( ( i % s 2 ) == 0 ) result += " "; ascii += " "; } if ( m > 0 ) { result += " [" + ascii + "]rn"; } return result; } } /** Method to calculate the digest of the current message. *After calculation, the engine is reset. *@param buf : the byte array in which the digest is put. *@param offset : the offset from where the digest is put in the bytearray. *@param len : the length of free space in thebytearray. *@returns the length of themessagedigest. */ public int engine. Digest(byte buf, int offset, int len) [] throws Digest. Exception { //if not enough space in buf, return if (len < 16) throw new Digest. Exception("Buffer too small. ") ; //calculate digest, copy into buf and return byte[] result = engine. Digest() ; System. arraycopy(result 0, buf, offset, result. length) ; , return result. length ; } /* Method to get the length of a digest. } } private static String _ hexmap = "0123456789 abcdef"; private static String _int 2 hex ( long i , int n ) { String result = ""; for ( int j = 0 ; j < n ; j++ ) { int m = (int)(i & (long)0 xf); } } Bart De Win So. Be. Ne. T - Distri. Net status report 7
Security is Pervasive (ctd. ) • Application-level security is crosscutting in structure /** Current 64 byte block to process */ private byte[] current. Block = new byte[64] ; Security Attributes /** Constructor. */ public MD 5(){ super("MD 5") ; engine. Reset() ; } // ************ // JCA JAVA ENGINE METHODS // ************ /** Method to reset the MD 5 engine. */ public void engine. Reset(){ count = 0 ; state[0] = 0 x 67452301 ; state[1] = 0 xefcdab 89 ; state[2] = 0 x 98 badcfe ; state[3] = 0 x 10325476 ; } public class MD 5 Test { public static void main(String[]args){ Message. Digest digest = null ; Security. add. Provider(new Distri. Net()) ; try{ digest = Message. Digest. get. Instance("MD 5", "Distrinet") ; } catch(Exception e){ e. print. Stack. Trace () ; System. exit(1) ; } digest. update(args[0]. get. Bytes()) ; System. out. println("Input : " + format. Bin 2 Hex(args[0]. get. Bytes(), 16, 2) +"n" ) ; System. out. println("Digest : " + format. Bin 2 Hex(digest(), 16, 2) +"n" ) ; int m = ( n % s 1 ); for ( int i = m ; i < s 1 ; i++ ) { if ( ( i % s 2 ) == 0 ) result += " "; ascii += " "; } if ( m > 0 ) { result += " [" + ascii + "]rn"; } return result; } ID Role /** Method to add a byte to the current message. *@param input : the byte to append to the current message. */ public void engine. Update(byte input){ //append byte to current. Block[(int)(count & 63)] = input ; //count&63 = count%64 //if current. Block full => process if ((int)(count & 63) == 63){ //whole block => process MD 5 Transform() ; } //and update internal state (count) count++ ; public class MD 5 Test { public static void main(String[]args){ Message. Digest digest = null ; Security. add. Provider(new Distri. Net()) ; try{ digest = Message. Digest. get. Instance("MD 5", "Distrinet") ; } catch(Exception e){ e. print. Stack. Trace () ; System. exit(1) ; } digest. update(args[0]. get. Bytes()) ; System. out. println("Input : " + int m = ( n % s 1 ); for ( int i = m ; i < s 1 ; i++ ) { if ( ( i % s 2 ) == 0 ) result += " "; ascii += " "; } if ( m > 0 ) { result += " [" + ascii + "]rn"; } return result; } Action private static String _ hexmap = "0123456789 abcdef"; Subject private static String _int 2 hex ( long i , int n ) { String result = ""; for ( int j = 0 ; j < n ; j++ ) { int m = (int)(i & (long)0 xf); } } } Security Attributes Domain private static String _ hexmap = "0123456789 abcdef"; } } Object /** Method to add a byte array to the current message. *@param buf : the bytearray to append to the current message. *@param offset : the offset to start from appending the bytearray to the current message. *@param len : the length of the message to append to the current message. */ public void engine. Update(byte buf, int offset, int len){ [] //FIRST : process first part of buffer until no more or full block //calculate number of bytes that fit in current block int no = java. lang. Math. min(len 64 - (int)(count&63)) ; , System. arraycopy(buf offset, current. Block, (int)(count&63), no) ; , count += no ; len -= no ; offset += no ; } Non-Security Attributes /** Method to add a byte array to the current message. *@param buf : the bytearray to append to the current message. *@param offset : the offset to start from appending the bytearray to the current message. *@param len : the length of the message to append to the current message. */ public void engine. Update(byte buf, int offset, int len){ [] //FIRST : process first part of buffer until no more or full block //calculate number of bytes that fit in current block int no = java. lang. Math. min(len 64 - (int)(count&63)) ; , System. arraycopy(buf offset, current. Block, (int)(count&63), no) ; , count += no ; len -= no ; offset += no ; } Age Bart De Win ID private static String _int 2 hex ( long i , int n ) { String result = ""; for ( int j = 0 ; j < n ; j++ ) { int m = (int)(i & (long)0 xf); public class MD 5 Test { public static void main(String[]args){ Message. Digest digest = null ; Security. add. Provider(new Distri. Net()) ; try{ digest = Message. Digest. get. Instance("MD 5", "Distrinet") ; } catch(Exception e){ e. print. Stack. Trace () ; System. exit(1) ; } digest. update(args[0]. get. Bytes()) ; System. out. println("Input : " + format. Bin 2 Hex(args[0]. get. Bytes(), 16, 2) +"n" ) ; System. out. println("Digest : " + format. Bin 2 Hex(digest(), 16, 2) +"n" ) ; int m = ( n % s 1 ); } } Time So. Be. Ne. T - Distri. Net status report public class MD 5 Test { public static void main(String[]args){ Message. Digest digest = null ; Security. add. Provider(new Distri. Net()) ; try{ digest = Message. Digest. get. Instance("MD 5", "Distrinet") ; } catch(Exception e){ e. print. Stack. Trace () ; System. exit(1) ; } digest. update(args[0]. get. Bytes()) ; System. out. println("Input : " + format. Bin 2 Hex(args[0]. get. Bytes(), 16, 2) +"n" ) ; System. out. println("Digest : " + format. Bin 2 Hex(digest(), 16, 2) +"n" ) ; int m = ( n % s 1 ); for ( int i = m ; i < s 1 ; i++ ) { if ( ( i % s 2 ) == 0 ) result += " "; ascii += " "; } if ( m > 0 ) { result += " [" + ascii + "]rn"; } return result; } public class MD 5 Test { public static void main(String[]args){ Message. Digest digest = null ; Security. add. Provider(new Distri. Net()) ; try{ digest = Message. Digest. get. Instance("MD 5 }tch(Exception e){ e. print. Stack. Trace () ; System. exit(1) ; } digest. update(args[0]. get. Bytes()) ; System. out. println("Input : " + format. Bin 2 Hex(args[0]. get. Bytes(), 16 System. out. println("Digest : " format. Bin 2 Hex(digest(), 16 int m = ( n % s 1 ); } } Non-Security Attributes Location private static String _ hexmap = "0123456789 abcdef"; private static String _int 2 hex ( long i , int n ) { String result = ""; for ( int j = 0 ; j < n ; j++ ) { int m = (int)(i & (long)0 xf); } } 8
Security is Evolving • Security of a system is often implemented once and for all • Unanticipated risks and changes – Threat analysis incomplete – Change in environment • System • Security policy (company, law, …) Bart De Win So. Be. Ne. T - Distri. Net status report 9
Our research Optimization of the modularization of application-level security using Aspect-Oriented Software Development /** Current 64 byte block to process */ private byte[] current. Block = new byte[64] ; /** Constructor. */ public MD 5(){ super("MD 5") ; engine. Reset() ; } // ************ // JCA JAVA ENGINE METHODS // ************ /** Method to reset the MD 5 engine. digest = Message. Digest. get. Instance("MD 5", "Distrinet") ; } catch(Exception e){ */ public void engine. Reset(){ count = 0 ; } Security Attributes Role Security Attributes Domain ID Subject Action Non-Security Attributes Age Time Object Non-Security Attributes Location public class MD 5 Test { public static void main(String[]args){ Message. Digest digest = null ; Security. add. Provider(new Distri. Net()) ; try{ digest = Message. Digest. get. Instance("MD 5", "Distrinet") ; } catch(Exception e){ digest = Message. Digest. get. Instance("MD 5", "Distrinet") ; ID /** Method to calculate the digest of the current message. *After calculation, the engine is reset. *@returns the message digest in abytearray. */ public byte[] engine. Digest(){ //calculate correct number of bits in total message digest = Message. Digest. get. Instance("MD 5", "Distrinet") ; } catch(Exception e){ long orig. Msg. Count = count << 3 ; //append padding bits engine. Update((byte)128) ; // append byte "10000000" while ((( int)(count & 63)) != 56){ engine. Update((byte)0) ; //append byte 0 until 56 mod 64 } Security Binding } Rationale Challenges • Address identified problems • Security binding (pervasiveness, evolution) • Applicability claimed [Filman 98, • Complex requirements • Flexibility and reuse Devanbu 00, Suvee 03, …] Bart De Win So. Be. Ne. T - Distri. Net status report 10
Two approaches • Interception-based AOSD – Intercept application execution events and execute extra behavior on these events – Application modules are not modified • Weaving-based AOSD – Language-based approach – Application modules are modified Bart De Win So. Be. Ne. T - Distri. Net status report 11
Basic Access Control in Aspect. J Aspect Authorization { pointcut checked. Methods(): execution(* Account. withdraw(. . )) ; Object around() throws Exception: checked. Methods() { Subject subj = null ; try { Security subj = <get subject> ; binding boolean allowed = <access control decision> ; if (allowed) {return proceed ; } else {throw new Access. Control. Exception(“Access denied”) ; } } catch(Runtime. Exception e){…} Security } } Bart De Win mechanism So. Be. Ne. T - Distri. Net status report 12
Evaluation Interception Weaving Traditional OO paradigm -- 0 0 abstraction 0 ++ ++ initialization ++ -- + input/output 0 + ++ dependencies 0 + ++ interaction 0 ++ ++ state -- 0 ++ superimposition ++ + -- adaptation -- -- - intrusiveness 0 ++ -- merging 0 - - ordering -- 0 - distribution 0 -- 0 Bart De Win So. Be. Ne. T - Distri. Net status report + + good support + 0 basic support - - no support 13
Impact on Security Bart De Win So. Be. Ne. T - Distri. Net status report 14
Secure Software Development Process Bart De Win So. Be. Ne. T - Distri. Net status report 15
246c527380a50e1b274f347f5cf3f6f2.ppt