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

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 

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.