Feeds

Aspect-oriented programming and security

Working together

5 things you didn’t know about cloud backup

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

Build a business case: developing custom apps

More from The Register

next story
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
China hopes home-grown OS will oust Microsoft
Doesn't much like Apple or Google, either
Sin COS to tan Windows? Chinese operating system to debut in autumn – report
Development alliance working on desktop, mobe software
Eat up Martha! Microsoft slings handwriting recog into OneNote on Android
Freehand input on non-Windows kit for the first time
Linux kernel devs made to finger their dongles before contributing code
Two-factor auth enabled for Kernel.org repositories
This is how I set about making a fortune with my own startup
Would you leave your well-paid job to chase your dream?
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Endpoint data privacy in the cloud is easier than you think
Innovations in encryption and storage resolve issues of data privacy and key requirements for companies to look for in a solution.
Scale data protection with your virtual environment
To scale at the rate of virtualization growth, data protection solutions need to adopt new capabilities and simplify current features.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?