Using reflection as a mechanism for enforcing security policies on compiled code

  • Authors:
  • Ian Welch;Robert J. Stroud

  • Affiliations:
  • Department of Computing, University of Newcastle-upon-Tyne, NE1 7RU, UK;Department of Computing, University of Newcastle-upon-Tyne, NE1 7RU, UK

  • Venue:
  • Journal of Computer Security - Special issue on ESORICS 2000
  • Year:
  • 2002

Quantified Score

Hi-index 0.01

Visualization

Abstract

Securing application resources or defining finer-gained access control for system resources using the Java security architecture requires manual changes to source code. This is error-prone and cannot be done if only compiled code is present. We show how behavioural reflection can be used to enforce security policies on compiled code. Other authors have implemented code rewriting toolkits that achieve the same effect but they either require policies to be expressed in terms of low level abstractions or require the use of new high level policy languages. Our approach allows reuseable policies to be implemented as metaobjects in a high level objecl oriented language (Java), and then bound to application objects at loadtime. The binding between metaobjects and objects is implemented through bytecode rewriting under the control of a declarative binding specification. We have implemented this approach using Kava which is a portable reflective Java implementation. Kava allows customisation of a rich range of runtime behaviour. and provides a non-bypassable meta level suitable for implementing security enforcement. We discuss how we have used Kava to show how to secure a third-party application, how we prevent Kava being bypassed, and compare its performance with non-reflective security enforcement.