Module 7 Security and Transactions. Security and Transactions Topics to be Covered: Security and the Enterprise Transactions.

Slides:



Advertisements
Similar presentations
21 Copyright © 2005, Oracle. All rights reserved. Oracle Application Server 10g Transaction Support.
Advertisements

11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Java Security. Overview Hermetically Sealed vs. Networked Executable Content (Web Pages & ) Java Security on the Browser Java Security in the Enterprise.
SECURITY IN E-COMMERCE VARNA FREE UNIVERSITY Prof. Teodora Bakardjieva.
Transactions Celsina Bignoli Motivations Atomic operations –Group of operation that must all succeed or all fail Network or machine.
Environmental Council of States Network Authentication and Authorization Services The Shared Security Component February 28, 2005.
DESIGNING A PUBLIC KEY INFRASTRUCTURE
LAB#2 JAVA SECURITY OVERVIEW Prepared by: I.Raniah Alghamdi.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 5 Database Application Security Models.
The Architecture of Transaction Processing Systems
Chapter 5 Database Application Security Models
Version # Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department of Defense © 1999 by Carnegie.
Enterprise Java Beans (EJB)
Version # Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department of Defense © 1999 by Carnegie.
Faculty of Information Technology © Copyright UTS Faculty of Information Technology – TransactionsTransactions-1 Advanced Java Programming Transactions.
Christopher Chapman | MCT Content PM, Microsoft Learning, PDG Planning, Microsoft.
Computer Security Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
1 The JNDI ENC and Injection Every EJB container that is deployed in an application server has its own personal internal registry called the Enterprise.
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
1 ACID Transactions To understand how transactions work, we will revisit the TravelAgent EJB, the stateful session bean developed in Lecture 11 that encapsulates.
1 Session Bean Chuyên đề Lập trình Java & J2EE Chương 14 Biên soạn: Th.S Nguyễn văn Lành.
Enterprise Java Beans - (EJB)
1 Security Most Java EE applications need to provide identity to users who access them and security for that access. Applications may want to prevent hostile.
What is Architecture  Architecture is a subjective thing, a shared understanding of a system’s design by the expert developers on a project  In the.
© jGuru.com EJB Transactions. Transactions Simple Transaction –Transaction = more than one statement which must all succeed (or all fail) together.
Module 6 Message-Driven Beans. History Introduced in EJB 2.0 –Supports processing of asynchronous messages from a JMS provider Definition expanded in.
Enterprise JavaBeans EJB Container Services. EJB container Enterprise JavaBeans are deployed in an EJB container within the application server EJB container.
CS 493/693: Distributed Systems Programming V. “Juggy” Jagannathan CSEE, West Virginia University March 21, 2005.
EJB Container services Presentation by Arun Kalluri (04/02/2001)
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
Message-Driven Beans and EJB Security Lesson 4B / Slide 1 of 37 J2EE Server Components Objectives In this lesson, you will learn about: Identify features.
Java Transaction API Sean C. Sullivan
第十四章 J2EE 入门 Introduction What is J2EE ?
Java Security Pingping Ma Nov 2 nd, Overview Platform Security Cryptography Authentication and Access Control Public Key Infrastructure (PKI)
Java Security Nathan Moore CS 665. Overview Survey of Java Inherent Security Properties Java Runtime Environment Java Virtual Machine Java Security Model.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Enterprise JavaBeans Understanding EJB Components Version 0.1 Kamal Wickramanayake
A Secure JBoss Platform Nicola Mezzetti Acknowledgments: F. Panzieri.
Collaborate Lesson 4C / Slide 1 of 22 Collaborate Knowledge Byte In this section, you will learn about: The EJB timer service Message linking in EJB 2.1.
Secure Systems Research Group - FAU SW Development methodology using patterns and model checking 8/13/2009 Maha B Abbey PhD Candidate.
1 Transactions Michael Brockway Sajjad Shami CG0165: Advanced Applications Development in Java Northumbria University School of Computing, Engineering.
Enterprise Java Transactions Source: “Enterprise JavaBeans, 3rd Edition”, Richard Monson-Haefel.
Introduction to Enterprise JavaBeans Topics In Systems Architecture Barry Herbold
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Session Beans Based on: Patel, Brose, Silverman, Mastering Enterprise JavaBeans 3.0.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
JPA Transactions
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
DEVELOPING ENTERPRISE APPLICATIONS USING EJB
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Copyright © 2002 ProsoftTraining. All rights reserved. Enterprise JavaBeans.
15 Copyright © 2004, Oracle. All rights reserved. Adding JAAS Security to the Client.
红杉树(中国)信息技术有限公司公司 地址:杭州市天目山路 176 号西湖数源软件园 11 号楼 3 层 电话: (86) Transaction & JAVA Fondy Wang 12/7/07.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Enterprise Java v121030Java EE Transactions1. Enterprise Java v121030Java EE Transactions2 Goals Understand the basic concepts behind a transaction Be.
Securing Web Applications Lesson 4B / Slide 1 of 34 J2EE Web Components Pre-assessment Questions 1. Identify the correct return type returned by the doStartTag()
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
Transactions and Security. Contents  Transactions  Transaction Support in EJB  Security  Security Support in EJB.
Server Concepts Dr. Charles W. Kann.
Knowledge Byte In this section, you will learn about:
Objectives In this lesson, you will learn about:
Presentation transcript:

Module 7 Security and Transactions

Security and Transactions Topics to be Covered: Security and the Enterprise Transactions

Security and Transactions Security and the Enterprise

Security Issues Hermetically sealed vs. networked environment Executable content on the Web Security on the browser Security in the enterprise Security on the network –author authentication –data authentication

Security Requirements Authenticity –identification mechanism Integrity –unaltered messages Non-repudiation –certainty in authorization Confidentiality –secure communications

Java Virtual Machine Security Indirect execution Language features Protection domains class Bytecode Verifier Class Loader Security Manager/ Access Controller O.S.

JVM Access Control Evolution Java sandbox Applet security –SecurityManager enforces Digital signatures Policy –Permissions –CodeSource –AccessController enforces Class from xyz.com signed by JJInc. Permissions

Enterprise JavaBean Security Authentication –Validates the identity of the user –Login screen –Basic, Digest, Form-Based Authorization –Access Control Confidentiality and Integrity Protection –Secure Communication SSL (key exchange) Encryption

Authentication through JNDI Every client application must be associated with a security identity –users –roles properties.put(Context.SECURITY_PRINCIPAL, user ); properties.put(Context.SECURITY_CREDENTIALS, password ); javax.naming.Context jndiContext = new javax.naming.InitialContext(properties); Object ref = jndiContext.lookup("java:comp/env/ejb/RoomEJB"); RoomHomeRemote home = (RoomHomeRemote) javax.rmi.PortableRemoteObject.narrow(ref, RoomHomeRemote.class);

Role-Driven Access Control Deployment descriptors describe authorization information based on logical roles Logical roles mapped to real security roles during actual deployment This role represents a merchant authorized to make payments on the system AUTHORIZED_MERCHANT

Method Permissions Bean method access are associated with logical roles AUTHORIZED_MERCHANT ProcessPaymentBean byCredit

Unchecked methods Security Permissions not checked Used instead of ProcessPaymentBean byCash

Method Permissions public class ProcessPaymentBean implements ProcessPaymentRemote, ProcessPaymentLocal { ……… public boolean byCredit(Customer cust, CreditCardDO card, double amount) throws PaymentException {………} private boolean process( ……… ) {………}

Method Permissions with Annotations public boolean byCash(Customer cust, double amount) throws PaymentException public boolean byCheck(Customer cust, CheckDO check, double amount) {………} }

The runAs security identity Specifies under which identity the EJB will run when it calls other methods... TravelAgentBean... AUTHORIZED_MERCHANT

The runAs public class TravelAgentBean implements TravelAgentRemote { ……… }

Running as the Caller Specifies the EJB will run under the caller’s identity... EmployeeService...

Security Identity and MDBs Message-driven beans have only a runAs identity –For MDBs, there is no “caller” Clients that send messages to MDBs are not associated with the messages Called identity does not propagate Message-driven beans must always specify a runAs security identity if they interact with other secured session beans

Security and Transactions Transactions

Software Transactions Embody the concept of a commercial exchange Execution of a unit of work –Must perform reliably 100% of the time Atomic –Execute completely or not at all Consistent –Integrity of underlying data store Isolated –Data cannot be interfered with externally Durable –Retain information if system crashes

Declarative Transaction Management Transactions not hard-coded into business logic Reduces complexity of transactions for developers Controlled annotation or the deployment descriptor Transactions can be set for specific methods

Transaction Scope Session EJBs and Entities participating in a transaction TravelAgentEJB –bookReservation() method Creates Reservation Entity Uses ProcessPayment EJB EJB Unit of Work –Every EJB method invoked in a transaction Transaction propagated to every EJB & the entity manager within the transaction scope Dependent on EJB transaction attributes

Transaction Attributes Not Supported –Transaction scope (TS) is not propagated Supports –TS propagated if invoked by a transactional client –No TS if invoked by a nontransactional client Required –TS propagated if invoked by a transactional client –New TS started if invoked by a nontransactional client

Transaction Attributes RequiresNew –New TS always started Mandatory –TS propagated if invoked by a transactional client –Invocation fails if invoked by a nontransactional client Never –No TS allowed –Invocation fails if invoked by a transactional client –Invocation OK if invoked by a nontransactional client

element … TravelAgentEJB * NotSupported TravelAgentEJB bookPassage Required …

public class TravelAgentBean implements TravelAgentRemote { public void setCustomer(Customer cust) public TicketDO bookReservation(CreditCardDO, double price) {……} ……… }

Transaction Propagation Client Application ProcessPayment EJB Required TravelAgent EJB RequiresNew Reservation EJB Required bookReservation()

Transaction Isolation The “I” in ACID –Data within a transactions unaffected by other parts of the system Dirty Read –Reading uncommitted changes Repeatable Reads –Identical data reads during same transaction despite changes in existing records from a different transaction Phantom Reads –Different data reads during same transaction because of new records added by a different transaction

Transaction Isolation Levels TRANSACTION_NONE –Transactions disable or unsupported TRANSACTION_READ_UNCOMMITTED –Dirty, nonrepeatable, phantom reads occur TRANSACTION_READ_COMMITTED –Nonrepeatable, phantom reads occur TRANSACTION_REPEATABLE_READ –Phantom reads occur TRANSACTION_SERIALIZABLE –Dirty, nonrepeatable, phantom reads prevented

Explicit Transaction Management Not generally recommended Java Transaction API (JTA) –Provides transactional interface javax.transaction.UserTransaction // Get the user transaction javax.transaction.UserTransaction tran = …; tran.begin(); travelagent1.bookReservation(); travelagent2.bookReservation(); tran.commit();

Obtaining a UserTransaction Object Java EE Client Context ic = new InitialContext(); UserTransaction ut = (UserTransaction) ic.lookup("java:comp/env/UserTransaction");

Obtaining a UserTransaction Object Session Beans –Declaring Bean BEAN) public class XBean implements XBeanLocal { … }

Obtaining a UserTransaction Object Session Beans SessionContext sessionContext; UserTransaction ut = sessionContext.getUserTransaction(); ut.begin(); UserTransaction public class XBean implements XBeanLocal { … }

Stateful Session Synchronization Does Not Exist Method-ReadyPassive Transactional Method-Ready

SessionSynchronization public interface javax.ejb.SessionSynchronization { public abstract void afterBegin(); public abstract void beforeCompletion(); public abstract void afterCompletion (boolean committed); }

Transactional Method-Ready State Method-Ready Transactional Method-Ready afterBegin() Transactional Business Methods beforeCompletion() afterCompletion(true) OR afterCompletion(false)

Security and Transactions Topics to be Covered: Security and the Enterprise Transactions