Feeds

Aspect-oriented programming and security

Working together

HP ProLiant Gen8: Integrated lifecycle automation

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 suit 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
  2. Applying Aspect-Oriented Programming to Security; Viega, Bloch, and Chandra; Cutter IT Journal
  3. Towards a security aspect for Java; Farías, Andrés
  4. AspectJ
  5. AsjectJ Development Tools
  6. Using AspectJ with Spring Applications; Spring Framework Reference Guide
  7. Data Validation, OWASP,
          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
            }
    

This article originally appeared in Security Focus.

Copyright © 2007, SecurityFocus

The Power of One eBook: Top reasons to choose HP BladeSystem

More from The Register

next story
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
Apple fanbois SCREAM as update BRICKS their Macbook Airs
Ragegasm spills over as firmware upgrade kills machines
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Captain Kirk sets phaser to SLAUGHTER after trying new Facebook app
William Shatner less-than-impressed by Zuck's celebrity-only app
Do YOU work at Microsoft? Um. Are you SURE about that?
Nokia and marketing types first to get the bullet, says report
Microsoft takes on Chromebook with low-cost Windows laptops
Redmond's chief salesman: We're taking 'hard' decisions
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
prev story

Whitepapers

Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Reducing security risks from open source software
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Consolidation: the foundation for IT and business transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.