Understanding the Java Virtual Machine: Security

This course covers the details of code security explaining how the SecurityManager and the AccessController work together to grant permissions to code in the current call stack. We cover how to grant permissions based on policy and how to create your own permissions and also cover how to limit the stack walk so that privileged code can run.
Course info
Rating
(80)
Level
Intermediate
Updated
Jul 18, 2015
Duration
1h 21m
Table of contents
Description
Course info
Rating
(80)
Level
Intermediate
Updated
Jul 18, 2015
Duration
1h 21m
Description

Java security is built around the idea of permissions and policy. Code is granted permissions based on the currently in-force policy. In this course, we look at how the security manager and access controller work hand-in-hand to provide this security. The course covers how to set a security manager and how to set up and edit a policy file to grant the levels of permissions that code needs. Permissions are typically based on where code is loaded from but we also look at how to sign code, so that permissions can be based on who created a library. The course also looks at how the AccessController walk the call stack to check that a permission can be granted. While the JRE comes with a set of permissions, these are not always enough so the class covers creating and using your own permissions. Finally we cover the idea of 'privileged scope' which allows code to be granted some permission even when code around them should cause the grant to fail.

About the author
About the author

Kevin has spent way too many years in the software industry. Starting on PL/1 on IBM mainframes then graduating through dBase IV to Windows and eventually onto Java, .Net and now JavaScript where he finally thinks he has found a home until the next new shiny comes along.

More from the author
Kotlin: Using Coroutines
Advanced
3h 50m
Aug 10, 2018
Kotlin Fundamentals
Beginner
4h 47m
Apr 15, 2017
More courses by Kevin Jones
Section Introduction Transcripts
Section Introduction Transcripts

Introduction
Hi, my name is Kevin Jones and this is the introductory chapter to the Understanding the Java Virtual Machine Security class. In this class we'll aim to understand how Java ensures code is safe to run. That is, when I execute a piece of code, is that code allowed to carry out a specific function? And just to emphasize this, we are looking at code not users. So we're not looking at how we can secure a user, how we can do authentication, how we can do authorization, this is specifically looking at Java code. To that end, we'll take a look at four things. We'll take a look at something called the Java Security Manager, this is a class built-in to the runtime that helps us manage code level security. The SecurityManager itself uses something called the Access Controller. Initially when Java was first released, we only had the SecurityManager. The Access Controller came along in Java 1. 2, or JDK2 if you like, to try and make it much easier to manage code level security. Between them, these use something called a Secure Classloader, so a Secure Classloader understands where code is loaded from and SecurityManager can use that location information to determine code should be allowed to execute or not. And finally, towards the end of the class, we'll take a look at something called Privilege Scopes. Occasionally you want a piece of code to execute even when the surrounding code shouldn't be allowed to do something. In the next module of this class we'll take a look at a little history and we'll take a look at some of the players in Java code security.