Search: Home Bugtraq Vulnerabilities Mailing Lists Jobs Tools Vista
      Digg this story   Add to del.icio.us   (page 4 of 4 ) previous 
Aspect-Oriented Programming and Security
Rohit Sethi 2007-10-16

Article continued from Page 3

What's Next?

The potential uses for Aspect-oriented programming in application security are enormous. Here are a couple of other applications AOP in security:

  • Implement access control independently of application logic. Instead of having explicit checks such as checkAccess(User) in each sensitive function, you can achieve this through aspects and let developers focus on business logic
  • Implement application security policies such as explicitly forbidding programmers from calling dynamic SQL libraries (e.g. executeQuery()). Whenever that library is called, you can use aspects to throw an exception and record exactly where the offending call came from

Developers are already moving towards adopting AOP. JBoss, WebSphere, and WebLogic either have existing functionality to integrate AOP or have made announcements to do so in the future. Now the application security community needs to follow suite by providing guidance on how AOP can be used in a security context.

We can achieve this by ensuring we add AOP to our application security training curriculums (something we’ve included in our new class for SANS and I hope other training companies do the same), do more research on how AOP works at securing applications in production (including benchmarks for performance impact), and providing more example code for developers to learn from.

Footnotes

  1. Aspect-oriented programming with Spring; Spring Framework: http://www.springframework.org/docs/reference/aop.html
  2. Applying Aspect-Oriented Programming to Security; Viega, Bloch, and Chandra; Cutter IT Journal: http://www.ccs.neu.edu/home/lieber/courses/csg379/f04/resources/aop-cutter.pdf
  3. Towards a security aspect for Java; Farías, Andrés: http://www.emn.fr/x-info/emoose/alumni/thesis/afarias.pdf
  4. AspectJ: http://www.eclipse.org/aspectj/
  5. AsjectJ Development Tools: http://www.eclipse.org/ajdt/
  6. Using AspectJ with Spring Applications; Spring Framework Reference Guide, http://static.springframework.org/spring/docs/2.0.x/reference/aop.html#aop-using-aspectj
  7. Data Validation, OWASP, http://www.owasp.org/index.php/Data_Validation#Accept_known_good
    public class MyFirstClass {
    public void amethod (String bar) {
    		Logger.doLoggingBefore();
    		//business logic goes here
    		Logger.doLoggingAfter();
    	}
    }
    public class MySecondClass {
    	public void function (Object arg) {
    		Logger.doLoggingBefore();
    		//business logic goes here
    		Logger.doLoggingAfter();
    	}
    }
    public aspect LogInterceptor { 
    
    public Object invoke(){
    Logger.doLoggingBefore();
    		method.execute(); 
    		Logger.doLoggingAfter();
    	  }
    }
    public class MySecondClass {
    	public void function (Object arg) {
    		//business logic goes here
    	}
    }
    public class MyFirstClass {
    	public void amethod (String bar) {	      
    		//business logic goes here
    	}
    }


SecurityFocus accepts Infocus article submissions from members of the security community. Articles are published based on outstanding merit and level of technical detail. Full submission guidelines can be found at http://www.securityfocus.com/static/submissions.html.
    Digg this story   Add to del.icio.us   (page 4 of 4 ) previous 
Comments Mode:







 

Privacy Statement
Copyright 2008, SecurityFocus