SlideShare a Scribd company logo
1 of 20
Java Security
                   Ferenc Tollas
       Sun Certified Developer for Java 2 Platform
            Sun Certified Programmer for JSE 5.0
“Java is secure”
Agenda
●   Java goals
●   Java Sandbox
●   Java Language Security
●   Bytecode verifier
●   Class loaders
●   Java Security Manager
●   Access Controller
●   JAAS
●   Java Cryptographic Extension (JCE)
Java goals
●   Originally developed by James Gosling
●   Goals:
    –   It should be "simple, object-oriented and familiar"
    –   It should be "robust and secure"
    –   It should be "architecture-neutral and portable"
    –   It should execute with "high performance"
    –   It should be "interpreted, threaded, and dynamic"
●   JDK 1.0 : January, 1996
Security requirements
Safe from malevolent programs
Programs should not be allowed to harm a user's computing environment, such as
Trojan horses and harmful programs that replicate, like computer viruses.
Non−intrusive
Programs should be prevented from discovering private information on the host
computer or the host computer's network
Authenticated, Encrypted, Audited, Well-defined security specification.....
●   Only the first two were within the province of Java's 1.0 default security model!
●   The other requirements were added in later versions of Java
How to provide the security related requirements:
●   Java Language security
●   Java sandbox implementation
●   Pluggable Security Extensions
Java Sandbox
●   provide an environment where the program can play
●   must be configurable by an end user or system administrator
●   Protect:
    – Memory
    – Files
    – Network
●   Minimal Sandbox: program has access to the CPU, the screen, keyboard, mouse and
    memory
●   Default Sandbox: CPU and its own memory as well as access to the web server from
    which it was loaded
●   Open sandbox : the program has access to whatever resources the host machine
    normally has access to
●   In early versions of Java, only applets were run within a sandbox.
●   In the Java 2 platform, all programs have the potential to run in a sandbox
Which is faster?
            Java's new or C's malloc?



Response:
www.ibm.com/developerworks/java/library/j-
jtp09275/index.html
Anatomy of a Java application
                                                    Bytecode Verifier:Java class files follow the
                                                     rules of the Java language

                                                        Class Loader: loads all Java classes and
                                                        can set permissions for each class it loads.
                                                    Security package:
                                                    ●    SPI
                                                    ●    Message digest
                                                    ●    Key and certificate handling
                                                    ●    Digital signatures
                                                    ●    Encryption : JCE, JSSE
                                                    ●    Authentication : JAAS

                                            Security Manager:the primary interface
                                            between the core API and the operating system
                                           Access Controller: allows or prevents most access
                                           from the core API to the operating system, uses the policy files..


Debug what happens in the background: −Djava.security.debug=all/access/failure
What is this:
           jre/lib/[arch]/client/clases.jsa
Elements of a sandbox
●   A sandbox is composed of five elements:
    –   Permissions : a specific action that code can perform
        ●   type, name and action: permission java.io.FilePermission "/tmp/foo", "read";
        ●   every Java class carries a set of permissions that defines the activities that the
            class is allowed to perform
        ●   core Java API are always given permission to perform any action
        ●   application can define its own permissions
    –   Code sources:location from which a class has been loaded.
        Combination of codebases and signers(alias listed in keystore).
    –   Protection domains: basic concept of sandbox, it is an association
        of permissions with a particular code source
                                                          DEMO
Elements of a sandbox
–   Policy files : contains one or more entries that define
    a protection domain.
     ● Global policy file:$JREHOME/lib/security/java.policy


     ● User specific: $HOME/.java.policy

    ●   Result: union of permissions contained in the global and user policy files
    ●   IMPORTANT: deny setting new policy file: java.security :
                         policy.allowSystemProperty=true
–   Keystores: The certificates themselves are held in a
    location (usually a file) called the keystore.
                      java −Djava.security.manager −Djava.security.policy=<URL>
Java language security
●   Question: how Java operates on things that are in memory?
●   Objects, primitive types has access level: public, protected,
    default/package or private
●   Programs cannot access arbitrary memory locations, no pointer and
    casting between int and Object is illegal.
●   Entities that are declared as final must not be changed.
●   Variables may not be used before they are initialized->instance variables
    are initialized automatically
●   Array bounds must be checked on all array accesses.
●   Object serialization....Mark with java.io.Serializable, and use keyword
    “transient”
●   These rules must be enforced! Compiler enforcement. Is it enough???
Bytecode verifier
●   No interface, users/coders cannot interact with it
●   Checks:
    –   The class file has the correct format
    –   Final classes are not subclassed, and final methods are not overridden.
    –   Every class (except for java.lang.Object) has a single superclass.
    –   There is no illegal data conversion of primitive data types (e.g., int to Object)
    –   There are no operand stack overflows or underflows
●   Delayed bytecode verification
●   Runtime verification:array bounds checking, object casting
Class loaders
●   mechanism by which files are read into the JVM and
    converted into class definitions
●   Responsibility:
    –   The security manager is consulted to see if this
         program is allowed to access the class in question
    –   Loads the class
    –   The security manager is consulted to see if this program
        is allowed to create the class in question
    –   The appropriate protection domain is created for the class
Java Security Manager
●   determines whether many particular operations
    should be permitted or rejected
●   −Djava.security.manager option installs a security
    manager
●   Partnership between the Ja5va API and the
    application
●   The SecurityException class is a subclass of the
    RuntimeException
       public FileInputStream(String name) throws FileNotFoundException {
           SecurityManager security = System.getSecurityManager( );
           if (security != null) {
               security.checkRead(name);
           }
           try {
               open(name);         // open( ) is a private method of this class
           } catch (IOException e) {
               throw new FileNotFoundException(name);
       } }
Access Controller
●   Security Manager is based entirely on access controller
●   Uses the policy file; is built on permissions, protection
    domains, code sources and policies
●   the access controller can do everything the security
    manager can do; historic reasons
●   the access controller is only available in Java 1.2
●   Applications always interact with the SecurityManager
JAAS
●   Java Authentication and Authorization Service
●   enforce access controls based on who runs
    the code(policy files: where code came from)
●   Features:
    –   Single sign-on support
    –   Pure Java
    –   Pluggable Authentication Module framework fir
        authentication
JCE
●   Java Cryptographic Extension
●   Features:
    –   Support for a wide range of standard algorithms
        including RSA, DSA, AES, Triple DES, SHA,
        PKCS#5, RC2, and RC4.
    –   Comprehensive API with support for a wide range of
        cryptographic services including digital signatures,
        message digests, ciphers (symmetric, asymmetric,
        stream & block), message authentication codes, key
        generators and key factories
JSSE
●   Java Secure Socket Extension
●   APIs and implementations for :
    –   Transport Layer Security (TLS),
    –   Secure Sockets Layer (SSL),
    –   Kerberos (accessible through GSS-API) and
    –   full support for HTTPS over SSL/TLS.
Questions?

More Related Content

What's hot

Introduction to iOS Penetration Testing
Introduction to iOS Penetration TestingIntroduction to iOS Penetration Testing
Introduction to iOS Penetration TestingOWASP
 
Malware analysis
Malware analysisMalware analysis
Malware analysisxabean
 
Protecting confidential files using SE-Linux
Protecting confidential files using SE-LinuxProtecting confidential files using SE-Linux
Protecting confidential files using SE-LinuxGiuseppe Paterno'
 
NCC Group 44Con Workshop: How to assess and secure ios apps
NCC Group 44Con Workshop: How to assess and secure ios appsNCC Group 44Con Workshop: How to assess and secure ios apps
NCC Group 44Con Workshop: How to assess and secure ios appsNCC Group
 
[CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs
[CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs [CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs
[CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs PROIDEA
 

What's hot (6)

Introduction to iOS Penetration Testing
Introduction to iOS Penetration TestingIntroduction to iOS Penetration Testing
Introduction to iOS Penetration Testing
 
Security in Java
Security in JavaSecurity in Java
Security in Java
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
Protecting confidential files using SE-Linux
Protecting confidential files using SE-LinuxProtecting confidential files using SE-Linux
Protecting confidential files using SE-Linux
 
NCC Group 44Con Workshop: How to assess and secure ios apps
NCC Group 44Con Workshop: How to assess and secure ios appsNCC Group 44Con Workshop: How to assess and secure ios apps
NCC Group 44Con Workshop: How to assess and secure ios apps
 
[CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs
[CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs [CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs
[CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs
 

Viewers also liked

Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in javaagorolabs
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisMahesh Bhalerao
 
UML for OOAD
UML for OOADUML for OOAD
UML for OOADDang Tuan
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignMotaz Saad
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and DesignHaitham El-Ghareeb
 

Viewers also liked (6)

Java notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esectionJava notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esection
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
UML for OOAD
UML for OOADUML for OOAD
UML for OOAD
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and Design
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 

Similar to Tollas Ferenc - Java security

Java Platform Security Architecture
Java Platform Security ArchitectureJava Platform Security Architecture
Java Platform Security ArchitectureRamesh Nagappan
 
Chapter three Java_security.ppt
Chapter three Java_security.pptChapter three Java_security.ppt
Chapter three Java_security.pptHaymanotTadese
 
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)Martin Toshev
 
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....Martin Toshev
 
Security Аrchitecture of Тhe Java Platform
Security Аrchitecture of Тhe Java PlatformSecurity Аrchitecture of Тhe Java Platform
Security Аrchitecture of Тhe Java PlatformMartin Toshev
 
Martin Toshev - Java Security Architecture - Codemotion Rome 2019
Martin Toshev - Java Security Architecture - Codemotion Rome 2019Martin Toshev - Java Security Architecture - Codemotion Rome 2019
Martin Toshev - Java Security Architecture - Codemotion Rome 2019Codemotion
 
1 Introduction To Java Technology
1 Introduction To Java Technology 1 Introduction To Java Technology
1 Introduction To Java Technology dM Technologies
 
1 Introduction To Java Technology
1 Introduction To Java Technology 1 Introduction To Java Technology
1 Introduction To Java Technology dM Technologies
 
From java to android a security analysis
From java to android  a security analysisFrom java to android  a security analysis
From java to android a security analysisPragati Rai
 
Secure JEE Architecture and Programming 101
Secure JEE Architecture and Programming 101Secure JEE Architecture and Programming 101
Secure JEE Architecture and Programming 101Mario-Leander Reimer
 
Sandboxing (Distributed computing)
Sandboxing (Distributed computing)Sandboxing (Distributed computing)
Sandboxing (Distributed computing)Sri Prasanna
 
Auscert 2022 - log4shell and history of Java deserialisation RCE
Auscert 2022 - log4shell and history of Java deserialisation RCEAuscert 2022 - log4shell and history of Java deserialisation RCE
Auscert 2022 - log4shell and history of Java deserialisation RCEDavid Jorm
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldDevOps.com
 

Similar to Tollas Ferenc - Java security (20)

Java Platform Security Architecture
Java Platform Security ArchitectureJava Platform Security Architecture
Java Platform Security Architecture
 
Chapter three Java_security.ppt
Chapter three Java_security.pptChapter three Java_security.ppt
Chapter three Java_security.ppt
 
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)
Security Architecture of the Java Platform (BG OUG, Plovdiv, 13.06.2015)
 
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
 
Security Аrchitecture of Тhe Java Platform
Security Аrchitecture of Тhe Java PlatformSecurity Аrchitecture of Тhe Java Platform
Security Аrchitecture of Тhe Java Platform
 
Martin Toshev - Java Security Architecture - Codemotion Rome 2019
Martin Toshev - Java Security Architecture - Codemotion Rome 2019Martin Toshev - Java Security Architecture - Codemotion Rome 2019
Martin Toshev - Java Security Architecture - Codemotion Rome 2019
 
Javantura v4 - Security architecture of the Java platform - Martin Toshev
Javantura v4 - Security architecture of the Java platform - Martin ToshevJavantura v4 - Security architecture of the Java platform - Martin Toshev
Javantura v4 - Security architecture of the Java platform - Martin Toshev
 
1 Introduction To Java Technology
1 Introduction To Java Technology 1 Introduction To Java Technology
1 Introduction To Java Technology
 
1 Introduction To Java Technology
1 Introduction To Java Technology 1 Introduction To Java Technology
1 Introduction To Java Technology
 
FEATURES OF JAVA
FEATURES OF JAVAFEATURES OF JAVA
FEATURES OF JAVA
 
From java to android a security analysis
From java to android  a security analysisFrom java to android  a security analysis
From java to android a security analysis
 
Features of java 02
Features of java 02Features of java 02
Features of java 02
 
Java Security
Java SecurityJava Security
Java Security
 
Secure JEE Architecture and Programming 101
Secure JEE Architecture and Programming 101Secure JEE Architecture and Programming 101
Secure JEE Architecture and Programming 101
 
Sandboxing (Distributed computing)
Sandboxing (Distributed computing)Sandboxing (Distributed computing)
Sandboxing (Distributed computing)
 
Auscert 2022 - log4shell and history of Java deserialisation RCE
Auscert 2022 - log4shell and history of Java deserialisation RCEAuscert 2022 - log4shell and history of Java deserialisation RCE
Auscert 2022 - log4shell and history of Java deserialisation RCE
 
Advanced Java
Advanced JavaAdvanced Java
Advanced Java
 
Java programming and security
Java programming and securityJava programming and security
Java programming and security
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote World
 

More from veszpremimeetup

Égből pottyant paketek
Égből pottyant paketekÉgből pottyant paketek
Égből pottyant paketekveszpremimeetup
 
Domján Balázs - Hang alapú kommunikáció
Domján Balázs - Hang alapú kommunikációDomján Balázs - Hang alapú kommunikáció
Domján Balázs - Hang alapú kommunikációveszpremimeetup
 
Tollas Ferenc - Process composer
Tollas Ferenc - Process composerTollas Ferenc - Process composer
Tollas Ferenc - Process composerveszpremimeetup
 
Dömők Tamás, Kocsi Balázs - Élményeink a 24 órás programozási versenyen
Dömők Tamás, Kocsi Balázs - Élményeink a 24 órás programozási versenyenDömők Tamás, Kocsi Balázs - Élményeink a 24 órás programozási versenyen
Dömők Tamás, Kocsi Balázs - Élményeink a 24 órás programozási versenyenveszpremimeetup
 
Bodócz Tamás- Web Perfomance & Caching Issues
Bodócz Tamás- Web Perfomance & Caching IssuesBodócz Tamás- Web Perfomance & Caching Issues
Bodócz Tamás- Web Perfomance & Caching Issuesveszpremimeetup
 
Bodócz Tamás - Website Perfomance & Load Test - Warm-up
Bodócz Tamás - Website Perfomance & Load Test - Warm-upBodócz Tamás - Website Perfomance & Load Test - Warm-up
Bodócz Tamás - Website Perfomance & Load Test - Warm-upveszpremimeetup
 
Stange Szilárd - Bird's eye view
Stange Szilárd - Bird's eye viewStange Szilárd - Bird's eye view
Stange Szilárd - Bird's eye viewveszpremimeetup
 
Magyar Attila - Kata és a TDD a dojoban
Magyar Attila - Kata és a TDD a dojobanMagyar Attila - Kata és a TDD a dojoban
Magyar Attila - Kata és a TDD a dojobanveszpremimeetup
 
Györkő Zoltán - Startup how to
Györkő Zoltán - Startup how toGyörkő Zoltán - Startup how to
Györkő Zoltán - Startup how toveszpremimeetup
 

More from veszpremimeetup (11)

Blackmagic
BlackmagicBlackmagic
Blackmagic
 
Meetup startup
Meetup startupMeetup startup
Meetup startup
 
Égből pottyant paketek
Égből pottyant paketekÉgből pottyant paketek
Égből pottyant paketek
 
Domján Balázs - Hang alapú kommunikáció
Domján Balázs - Hang alapú kommunikációDomján Balázs - Hang alapú kommunikáció
Domján Balázs - Hang alapú kommunikáció
 
Tollas Ferenc - Process composer
Tollas Ferenc - Process composerTollas Ferenc - Process composer
Tollas Ferenc - Process composer
 
Dömők Tamás, Kocsi Balázs - Élményeink a 24 órás programozási versenyen
Dömők Tamás, Kocsi Balázs - Élményeink a 24 órás programozási versenyenDömők Tamás, Kocsi Balázs - Élményeink a 24 órás programozási versenyen
Dömők Tamás, Kocsi Balázs - Élményeink a 24 órás programozási versenyen
 
Bodócz Tamás- Web Perfomance & Caching Issues
Bodócz Tamás- Web Perfomance & Caching IssuesBodócz Tamás- Web Perfomance & Caching Issues
Bodócz Tamás- Web Perfomance & Caching Issues
 
Bodócz Tamás - Website Perfomance & Load Test - Warm-up
Bodócz Tamás - Website Perfomance & Load Test - Warm-upBodócz Tamás - Website Perfomance & Load Test - Warm-up
Bodócz Tamás - Website Perfomance & Load Test - Warm-up
 
Stange Szilárd - Bird's eye view
Stange Szilárd - Bird's eye viewStange Szilárd - Bird's eye view
Stange Szilárd - Bird's eye view
 
Magyar Attila - Kata és a TDD a dojoban
Magyar Attila - Kata és a TDD a dojobanMagyar Attila - Kata és a TDD a dojoban
Magyar Attila - Kata és a TDD a dojoban
 
Györkő Zoltán - Startup how to
Györkő Zoltán - Startup how toGyörkő Zoltán - Startup how to
Györkő Zoltán - Startup how to
 

Recently uploaded

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Tollas Ferenc - Java security

  • 1. Java Security Ferenc Tollas Sun Certified Developer for Java 2 Platform Sun Certified Programmer for JSE 5.0
  • 3. Agenda ● Java goals ● Java Sandbox ● Java Language Security ● Bytecode verifier ● Class loaders ● Java Security Manager ● Access Controller ● JAAS ● Java Cryptographic Extension (JCE)
  • 4. Java goals ● Originally developed by James Gosling ● Goals: – It should be "simple, object-oriented and familiar" – It should be "robust and secure" – It should be "architecture-neutral and portable" – It should execute with "high performance" – It should be "interpreted, threaded, and dynamic" ● JDK 1.0 : January, 1996
  • 5. Security requirements Safe from malevolent programs Programs should not be allowed to harm a user's computing environment, such as Trojan horses and harmful programs that replicate, like computer viruses. Non−intrusive Programs should be prevented from discovering private information on the host computer or the host computer's network Authenticated, Encrypted, Audited, Well-defined security specification..... ● Only the first two were within the province of Java's 1.0 default security model! ● The other requirements were added in later versions of Java How to provide the security related requirements: ● Java Language security ● Java sandbox implementation ● Pluggable Security Extensions
  • 6. Java Sandbox ● provide an environment where the program can play ● must be configurable by an end user or system administrator ● Protect: – Memory – Files – Network ● Minimal Sandbox: program has access to the CPU, the screen, keyboard, mouse and memory ● Default Sandbox: CPU and its own memory as well as access to the web server from which it was loaded ● Open sandbox : the program has access to whatever resources the host machine normally has access to ● In early versions of Java, only applets were run within a sandbox. ● In the Java 2 platform, all programs have the potential to run in a sandbox
  • 7. Which is faster? Java's new or C's malloc? Response: www.ibm.com/developerworks/java/library/j- jtp09275/index.html
  • 8. Anatomy of a Java application Bytecode Verifier:Java class files follow the rules of the Java language Class Loader: loads all Java classes and can set permissions for each class it loads. Security package: ● SPI ● Message digest ● Key and certificate handling ● Digital signatures ● Encryption : JCE, JSSE ● Authentication : JAAS Security Manager:the primary interface between the core API and the operating system Access Controller: allows or prevents most access from the core API to the operating system, uses the policy files.. Debug what happens in the background: −Djava.security.debug=all/access/failure
  • 9. What is this: jre/lib/[arch]/client/clases.jsa
  • 10. Elements of a sandbox ● A sandbox is composed of five elements: – Permissions : a specific action that code can perform ● type, name and action: permission java.io.FilePermission "/tmp/foo", "read"; ● every Java class carries a set of permissions that defines the activities that the class is allowed to perform ● core Java API are always given permission to perform any action ● application can define its own permissions – Code sources:location from which a class has been loaded. Combination of codebases and signers(alias listed in keystore). – Protection domains: basic concept of sandbox, it is an association of permissions with a particular code source DEMO
  • 11. Elements of a sandbox – Policy files : contains one or more entries that define a protection domain. ● Global policy file:$JREHOME/lib/security/java.policy ● User specific: $HOME/.java.policy ● Result: union of permissions contained in the global and user policy files ● IMPORTANT: deny setting new policy file: java.security : policy.allowSystemProperty=true – Keystores: The certificates themselves are held in a location (usually a file) called the keystore. java −Djava.security.manager −Djava.security.policy=<URL>
  • 12. Java language security ● Question: how Java operates on things that are in memory? ● Objects, primitive types has access level: public, protected, default/package or private ● Programs cannot access arbitrary memory locations, no pointer and casting between int and Object is illegal. ● Entities that are declared as final must not be changed. ● Variables may not be used before they are initialized->instance variables are initialized automatically ● Array bounds must be checked on all array accesses. ● Object serialization....Mark with java.io.Serializable, and use keyword “transient” ● These rules must be enforced! Compiler enforcement. Is it enough???
  • 13. Bytecode verifier ● No interface, users/coders cannot interact with it ● Checks: – The class file has the correct format – Final classes are not subclassed, and final methods are not overridden. – Every class (except for java.lang.Object) has a single superclass. – There is no illegal data conversion of primitive data types (e.g., int to Object) – There are no operand stack overflows or underflows ● Delayed bytecode verification ● Runtime verification:array bounds checking, object casting
  • 14. Class loaders ● mechanism by which files are read into the JVM and converted into class definitions ● Responsibility: – The security manager is consulted to see if this program is allowed to access the class in question – Loads the class – The security manager is consulted to see if this program is allowed to create the class in question – The appropriate protection domain is created for the class
  • 15. Java Security Manager ● determines whether many particular operations should be permitted or rejected ● −Djava.security.manager option installs a security manager ● Partnership between the Ja5va API and the application ● The SecurityException class is a subclass of the RuntimeException public FileInputStream(String name) throws FileNotFoundException { SecurityManager security = System.getSecurityManager( ); if (security != null) { security.checkRead(name); } try { open(name); // open( ) is a private method of this class } catch (IOException e) { throw new FileNotFoundException(name); } }
  • 16. Access Controller ● Security Manager is based entirely on access controller ● Uses the policy file; is built on permissions, protection domains, code sources and policies ● the access controller can do everything the security manager can do; historic reasons ● the access controller is only available in Java 1.2 ● Applications always interact with the SecurityManager
  • 17. JAAS ● Java Authentication and Authorization Service ● enforce access controls based on who runs the code(policy files: where code came from) ● Features: – Single sign-on support – Pure Java – Pluggable Authentication Module framework fir authentication
  • 18. JCE ● Java Cryptographic Extension ● Features: – Support for a wide range of standard algorithms including RSA, DSA, AES, Triple DES, SHA, PKCS#5, RC2, and RC4. – Comprehensive API with support for a wide range of cryptographic services including digital signatures, message digests, ciphers (symmetric, asymmetric, stream & block), message authentication codes, key generators and key factories
  • 19. JSSE ● Java Secure Socket Extension ● APIs and implementations for : – Transport Layer Security (TLS), – Secure Sockets Layer (SSL), – Kerberos (accessible through GSS-API) and – full support for HTTPS over SSL/TLS.