aspect security - ravishekhar gopalan - prof. lieberherr software security (csg379)

32
Aspect Security Aspect Security - RaviShekhar Gopalan RaviShekhar Gopalan - Prof. Lieberherr Prof. Lieberherr Software Security (CSG379) Software Security (CSG379)

Upload: clarence-hopkins

Post on 18-Jan-2018

217 views

Category:

Documents


0 download

DESCRIPTION

Topics  Short Security Overview  Motivation for this project  What is this project?  Implementation  Future Work  References

TRANSCRIPT

Page 1: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Aspect SecurityAspect Security-RaviShekhar GopalanRaviShekhar Gopalan

-Prof. LieberherrProf. Lieberherr

Software Security (CSG379)Software Security (CSG379)

Page 2: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Topics CoveredTopics Covered

Page 3: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

TopicsTopics

Short Security OverviewShort Security Overview Motivation for this projectMotivation for this project What is this project?What is this project? ImplementationImplementation Future WorkFuture Work ReferencesReferences

Page 4: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Security OverviewSecurity Overview

Page 5: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Security in Software EngineeringSecurity in Software Engineering

A non-functional requirementA non-functional requirementApplied as a patch at the end of SDLCApplied as a patch at the end of SDLCNot a design-considerationNot a design-considerationPreference for non-invasive techniquesPreference for non-invasive techniquesNot a prime focus during developmentNot a prime focus during developmentLeads to a disconnection between Leads to a disconnection between development and “security” cycledevelopment and “security” cycle

Page 6: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Types of SecurityTypes of SecurityDomain Level SecurityDomain Level Security Is dependent on an applicationIs dependent on an application Similar to Business Rules Similar to Business Rules Security policies, ACLs – Non-invasiveSecurity policies, ACLs – Non-invasive Store them as rules in config filesStore them as rules in config files E.g. xml files in J2EEE.g. xml files in J2EEProvided by languageProvided by language Not the focus anywhereNot the focus anywhere

This project is about improvements to the This project is about improvements to the security features provided by the languagesecurity features provided by the language

Page 7: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Security provided by the languageSecurity provided by the language

Language should provide features for securityLanguage should provide features for securitySimilar to “public”, “private” there should be Similar to “public”, “private” there should be some “const” keyword similar to C++some “const” keyword similar to C++Every method should declare its behaviorEvery method should declare its behaviorFor e.g. we might have a new set of keywordsFor e.g. we might have a new set of keywords ImmutableImmutable InspectorInspector MutatorMutator

Page 8: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

MotivationMotivation

Page 9: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Enter AOP!Enter AOP!

Security loopholes may not be intentionalSecurity loopholes may not be intentionalBug fixes may introduce security bugs Bug fixes may introduce security bugs More so with AOP (compartmentalization)More so with AOP (compartmentalization)Right time to correct in AOP whatever was Right time to correct in AOP whatever was not done in OOPnot done in OOPSince AOP still in infancy, security focus Since AOP still in infancy, security focus can be imbibed can be imbibed

Page 10: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Aspect SecurityAspect Security

Aspects are powerful. Aspects are powerful. Need a controlled & safe way of aspect Need a controlled & safe way of aspect

oriented developmentoriented developmentNeed a stronger safety net than normal Need a stronger safety net than normal

languages languages

Page 11: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Simple Demo !!Simple Demo !!

Page 12: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

What is this project?What is this project?

Page 13: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Ideally, ….Ideally, …. Ideally, language should provide features Ideally, language should provide features

for securityfor securityEvery method should declare its behaviorEvery method should declare its behavior If not, metadata will have to be used.If not, metadata will have to be used.

Page 14: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Requirements??Requirements??At the least, compiler shouldAt the least, compiler should

Warn if it can determine whether a possible Warn if it can determine whether a possible security breach existssecurity breach exists

There exists possible loop-holes which can be There exists possible loop-holes which can be exploited in futureexploited in future

Guard against these by putting dynamic Guard against these by putting dynamic checks in placechecks in place

This is a bit ambitious, but not too much.This is a bit ambitious, but not too much.

Page 15: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

What is a Secure Aspect?What is a Secure Aspect? A secure aspect is an aspect which is A secure aspect is an aspect which is

securesecure For object-oriented programs, an aspect For object-oriented programs, an aspect

should notshould not interfere with the OO part of the systeminterfere with the OO part of the systemmodify behavior of the object which it is trying modify behavior of the object which it is trying

to influence.to influence.modify data of the object which it is trying to modify data of the object which it is trying to

influence.influence.

Page 16: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

What should a secure aspect do?What should a secure aspect do?

A secure aspect shouldA secure aspect shouldAdd behavior at a join pointAdd behavior at a join pointAdd checks for certain conditionsAdd checks for certain conditionsBasically be an inspectorBasically be an inspector

Page 17: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

What a secure aspect should not What a secure aspect should not do?do?

A secure aspect should not A secure aspect should not Modify an object’s behavior at any join pointModify an object’s behavior at any join pointModify an object’s data at any join pointModify an object’s data at any join pointShould not change an object’s hierarchy if the Should not change an object’s hierarchy if the

object is not open to change (……)object is not open to change (……)

Page 18: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

ImplementationImplementation

Page 19: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

How to do it?

In order to determine the security aspects statically, step in at compile time influence the compiler with our security rules

Security Rules can be hard-coded or in some XML file

Rules in an XML file require development of a separate language syntax and its validation

Page 20: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Aspect Bench Compiler

abc compiler from Oxford University Chosen because it is open-source Open and easy to extendGives extension-writers the AST in

objects which are easier to manipulate

Page 21: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

abc Architecture

Page 22: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

abc Modification Point

Page 23: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Proposed Change

Compiler Front End

Aspect Checker

Static Weaving

Page 24: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Proof of Concept

Aspect Checker checks aspects before weaving

For this PoC, I am checking whether an aspect calls a setter method of the main class

Page 25: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Aspect Checker

Main BankAccount::initialize()

Set Account Id to 0

Aspect

Page 26: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Design of Aspect Checker

GlobalAspectChecker

BankAccountChecker BankChecker

AspectInfo

abc Compiler

AccountChecker

IndividualCheckers

Page 27: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Demo of Aspect CheckerDemo of Aspect Checker

Page 28: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Future WorkFuture Work

Page 29: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Future Work

Handle inter-type declarations Handle weaving of aspect-checking code Finalize design of AspectChecker

Page 30: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

ReferencesReferences

Page 31: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

ReferencesReferences

Building the abc AspectJ compiler with Polyglot and Soot – abc Technical Report No. abc-2004-2

abc : An extensible AspectJ compiler– abc Technical Report No. abc-2004-1

The abc scanner and parser, including an LALR(1) grammar for AspectJ

Page 32: Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)

Thank You!!Thank You!!