JAVA SECURITY BASIC NETWORKING MULTITHREATING Deniz HASTORUN

Slides:



Advertisements
Similar presentations
Using Macros and Visual Basic for Applications (VBA) with Excel
Advertisements

Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Java security (in a nutshell)
Java Security cont’d. Laboratuar Study  Study the Java code of the 15th slide which was given in previous lesson, - 3_May lecture notes-.  After running.
Csci5233 Computer Security1 GS: Chapter 6 Using Java Cryptography for Authentication (Part B)
Security CS-328. The need for security In most of the programming classes that we’ve taken the emphasis has always been on getting the “job” done and.
16.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft® Windows® Server 2003 Active Directory Infrastructure.
LAB#2 JAVA SECURITY OVERVIEW Prepared by: I.Raniah Alghamdi.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 5: Managing File Access.
6.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
1 Lecture 4 George Koutsogiannakis/Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 5: Managing File Access.
Certificates By Purvi Shah. What is a Certificate A certificate is basically a digitally signed statement from one entity (person, company, etc.), saying.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
CASE STUDY: Applet Development with GUI and Client-side File Input Arkadiusz Edward Komenda.
Applets. What is an Applet?  According to Sun “An applet is a small program that is intended not to be run on its own, but rather to be embedded inside.
70-270, MCSE/MCSA Guide to Installing and Managing Microsoft Windows XP Professional and Windows Server 2003 Chapter Nine Managing File System Access.
Computers as an Expressive Medium Lab 8: jar signing, debugging Mayhew Seavey.
11 WORKING WITH COMPUTER ACCOUNTS Chapter 8. Chapter 8: WORKING WITH COMPUTER ACCOUNTS2 CHAPTER OVERVIEW  Describe the process of adding a computer to.
Page 1 Sandboxing & Signed Software Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Cheng-Chia Chen September 1999
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Word Lesson 16 Working with Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
1 Lecture 5 George Koutsogiannakis/ Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. M I C R O S O F T ® Preparing for Electronic Distribution Lesson 14.
9.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Enabling Java 2 Runtime Security with Eclipse Plug-ins ___ Analyzing Security Requirements for OSGi-Enabled Platforms Marco Pistoia, Ted Habeck, Larry.
Security in Java Sunesh Kumra S
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 5: Managing File Access.
Java Security Pingping Ma Nov 2 nd, Overview Platform Security Cryptography Authentication and Access Control Public Key Infrastructure (PKI)
1 Introduction to Applets. 2 Applications Programs that execute using the java interpreter Executes in command windows.
UCSC All rights reserved. No part of this material may be reproduced and sold. 1 IT1202-Fundamentals Of Programming (Using JAVA) Interacting with.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
1. Chapter 25 Protecting and Preparing Documents.
POS 406 Java Technology And Beginning Java Code
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
OCC Network Drives  H:\  P:\ 
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Troubleshooting Security Issues Lesson 6. Skills Matrix Technology SkillObjective Domain SkillDomain # Monitoring and Troubleshooting with Event Viewer.
Csci5931 Web Security1 Java Security Model (GS: Ch. 7)
1 Session 3 Module 4: Java Security Module 5: Cryptography.
CS 4244: Internet Programming Network Programming in Java 1.0.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Java Security Session 19. Java Security / 2 of 23 Objectives Discuss Java cryptography Explain the Java Security Model Discuss each of the components.
Creating and Managing Digital Certificates Chapter Eleven.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Understand Permissions LESSON Security Fundamentals.
Java Security cont’d. Using SecurityManager  The basic SecurityManager architecture is simple. Throughout the JDK, the Java security team had to:  Identify.
1 Session 4 Module 6: Digital signatures. Digital Signatures / Session4 / 2 of 18 Module 4, 5 - Review (1)  Java 2 security model provides a consistent.
LAB#8 PKI & DIGITAL CERTIFICATE CPIT 425. Public Key Infrastructure PKI 2  Public key infrastructure is the term used to describe the laws, policies,
Business Objects XIr2 Windows NT Authentication Single Sign-on 18 August 2006.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 8 BACKNEXTEND 8-1 LINKS TO OBJECTIVES Import data from Access, a Web site, or a CSV text file.
Excel Tutorial 8 Developing an Excel Application
Diagrams and Sample Code from the Java Tutorial,
Java security (in a nutshell)
Topic: Java Security Models
Microsoft Excel 2007 – Level 2
APPLET PROGRAMMING.
Presentation transcript:

JAVA SECURITY BASIC NETWORKING MULTITHREATING Deniz HASTORUN Barış İbrahim SÖNMEZER

Security Architecture (JDK1.0) The original security model provided by the Java platform, known as the "sandbox" model

Security Architecture (JDK1.1) JDK 1.1 introduced the concept of : "signed applet"

Security Architecture (JDK1.2) All code, regardless of whether it is local or remote, can now be subject to a security policy. The security policy defines the set of permissions.

Controlling Applets Observe Applet Restrictions Set Up a Policy File to Grant the RequiredPermission See the Policy File Effects

Observe Applet Restrictions Currently JDK system code invokes security manager methods to perform resource access control checks. Applets are not allowed to access resources unless it is explicitly granted permission to do so by the security policy in effect. In Java platforms that are compatible with JDK 1.2, the permission must be granted by an entry in a policy file.

import java.awt.*; import java.io.*; import java.lang.*; import java.applet.*; public class WriteFile extends Applet { String myFile = "writetest"; File f = new File(myFile); DataOutputStream dos; public void init() { String osname = System.getProperty("os.name"); } public void paint(Graphics g) { try { dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(myFile),128)); dos.writeChars("Try to write to a file\n"); dos.flush(); g.drawString("Successfully wrote to the file named " + myFile + " look at it!", 10, 10); } catch (SecurityException e) { g.drawString("writeFile: caught security exception: " + e, 10, 10); catch (IOException ioe) { g.drawString("writeFile: caught i/o exception", 10, 10); } } } the source code for an applet named WriteFile that tries to create and to write to a file named writetest in the current directory

Compile : “ javac WriteFile.java “ -> Result : “ WriteFile.class “ WriteFile.html : <html><p><applet code=WriteFile.class width=750 height=150></applet> <p></html> The system caught the applet trying to access a resource it doesn't have permission to access.

Set up a Policy File to Grant the Required Permission A policy file is an ASCII text file and can be composed via a text editor or the graphical Policy Tool utility. The Policy Tool saves you typing and eliminates the need for you to know the required syntax of policy files, thus reducing errors. You will use the Policy Tool to create a policy file, in which you will add a policy entry that grants code from the directory where WriteFile.class is stored permission to write the writetest file. Steps : Start Policy Tool Grant Required Permissions Save the Policy File

Start Policy Tool To start Policy Tool, simply type the following at the command line: “ policytool “ Whenever Policy Tool is started, it tries to fill in this window with policy information from what is sometimes referred to as the "user policy file". Default policy file : “ ${user.home}/.java.policy “ If Policy Tool cannot find the user policy file, it reports the situation and displays a blank Policy Tool window (that is, a window with headings and buttons but no data in it)

Grant the Required Permission Choose the Add Policy Entry button in the main Policy Tool window The CodeBase and the SignedBy text boxes are used to specify which code you want to grant the permission(s) you will be adding. A CodeBase value indicates the code source location. A SignedBy value indicates the alias for a certificate stored in a keystore. Choose the Add Permission button to bring up the Permissions dialog box.

Security Properties File Whenever you run an applet, or an application with a security manager, the policy files that are loaded and used by default are the ones specified in the "security properties file", which is located at one of the following: Windows: java.home\lib\security\java.security UNIX: java.home/lib/security/java.security

Security Properties File The default policy files, sometimes referred to as the system and user policy files, respectively, are defined in the security properties file as : policy.url.1= file:${java.home}/lib/security/java.policy policy.url.2 = file:${user.home}/.java.policy You can edit this file if you want to add another policy file.

How to Restrict Applications A security manager is not automatically installed when an application is running. To apply the same security policy to an application found on the local file system as to downloaded applets, you can invoke the interpreter with the new “-Djava.security.manager” command line argument. Usage : java -Djava.security.manager <Prog_name>

Summary of Security Tools Policytool Keytool Jar Jarsigner are available to facilitate various security-related operations

Keystore a protected database that holds keys and certificates for an enterprise Access to a keystore is guarded by a password (defined at the time the keystore is created, by the person who creates the keystore, and changeable only when providing the current password). Default keystore : ${user.home}/.keystore

Keytool Use keytool to manage your keystore, for example to create public/private key pairs issue certificate requests (which you send to the appropriate Certification Authority) import certificate replies (obtained from the Certification Authority you contacted) designate public keys belonging to other parties as trusted

Jar Use the jar tool to create JAR files The Java ARchive (JAR) file format enables you to bundle multiple files into a single archive file When you want to "digitally sign" code, you use the jar tool to place it in a JAR file and the jarsigner tool to sign the JAR file

Jarsigner Use the jarsigner tool to sign JAR files, or to verify signatures on signed JAR files. The jarsigner tool accesses a keystore that is created and managed by keytool, when it needs to find the private key and its associated certificate chain to use when signing a JAR file.