SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
Security in OSGi applications:
                 Robust OSGi Platforms, secure Bundles
                                                      27.10.2009




                                     Pierre Parrend
RESEARCH ON YOUR BEHALF              parrend@fzi.de
The vision
                                                              What happens if the WebCam Driver is a
     Dynamic applications                                     Malware ?

    WebCamDriver
       Bundle



                                         1.                                           3.
                    2.
                                                                                             WebCam
                                               WebCam
    Component
    Repository
                                                                                  PDA
                                   PDA                        WebCamDriver
                                                                 Bundle
                                                                                    DriverLister Bundle
                                        DriverLister Bundle



                         SOP Platform                               SOP Platform
                    (installed on the PDA)                          (installed on the PDA)




2   Pierre Parrend – OSGi: Secure Platforms, secure bundles                                           27.07.2009
Existing applications
             Jboss, Server-side Eclipse

            • OSGi as application server
            • Integration of open source bundles from several sources
            • Abuse cases
              • Attacks through the web front end
              • Backdoor bundles inside the server



             Yoxos secure source

            • Validation of open source code
            • Three levels
              • Access from a secure repository
              • Basic security analysis of code
              • TÜV Certified security audit: external reach, malicious behavior



3   Pierre Parrend – OSGi: Secure Platforms, secure bundles                           27.07.2009
Outline

                       Java Security

                       Assessment method

                       Robust OSGi Platforms

                       Secure Bundles

                       An integration


4   Pierre Parrend – OSGi: Secure Platforms, secure bundles             27.07.2009
Java1: Do not trust the Bytecode
     The Bytecode validation process




5   Pierre Parrend – OSGi: Secure Platforms, secure bundles                    27.07.2009
Java2: From the Sandbox to Permission Domains

     JDK 1.1                                                  JDK 1.2




                                                                          [LiGong1997]




6   Pierre Parrend – OSGi: Secure Platforms, secure bundles                              27.07.2009
OSGi-based Applications: Threats


     Exploitation of the platform
     Exploitation of the 3d party bundles




7   Pierre Parrend – OSGi: Secure Platforms, secure bundles                   27.07.2009
Outline

    Java Security

    Assessment method

    Robust OSGi Platforms

    Secure Bundles

    An integration


8                                     27.07.2009
A Metric for Security Protection
     The Coverage Metric
           • Percentage of the known vulnerabilities that are protected
           • Based on the Attack Surface metric


                  C


           • Enables to
                  o Assess individual security mechanism
                  o Compare execution environments




9   Pierre Parrend – OSGi: Secure Platforms, secure bundles                      27.07.2009
Outline

     Java Security

     Assessment method

     Robust OSGi Platforms

     Secure Bundles

     An integration


10                                     27.07.2009
Security Issues in OSGi Platforms

     The OSGi Platform                                         Threats
                                                                Denial of service
                                                                   • Platform stop
                                                                   • Resource consumption
                                                                   • Blocking the console
                                                                Undue access
                              Service layer                        • Bundle Management
                             Module layer
                                                                   • Bundle code
                             Life-cycle layer
                                  JVM
                                  Host




11   Pierre Parrend – OSGi: Secure Platforms, secure bundles                                27.07.2009
Stopping the Platform

     Stop your application                                     Just crash it

     public class RuntimeHaltActivator                          public class Stopper extends Thread{
     implements BundleActivator{
         public void start(BundleContext                            public void run(){
     context){                                                          Stopper tt = new Stopper();
             Runtime.getRuntime().halt(0);                              tt.start();
         }                                                              Stopper tt2 = new Stopper();
     }                                                                  tt2.start();
                                                                        Stopper tt3 = new Stopper();
                                                                        tt3.start();
                                                                    }
                                                                }


      Simple example                                           Thread management features do
            • Bundelized application                             not help
                                                                Bytecode Forgery is another way
                                                                 to crash the JVM
12   Pierre Parrend – OSGi: Secure Platforms, secure bundles                                    27.07.2009
Blocking the console

     Simply sleepy                                             Resource greedy

     public class SleepingBundleActivator                       public class
     implements BundleActivator{                                InfStartupLoopActivator implements
         public void start(BundleContext                        BundleActivator{
     context){                                                      public void start(BundleContext
             try{                                               context){
               int sec = 50;                                            while(1==1){}
               Thread.sleep(sec * 1000);                            }
             }                                                  }
             catch(InterruptedException e)
               {e.printStackTrace();}
         }
     }



      Management actions no longer                             Also consume most of the
       possible                                                  available CPU

13   Pierre Parrend – OSGi: Secure Platforms, secure bundles                                    27.07.2009
Playing with the bundles of your neighbour
                                                    applications



              public class PiratBundleManagerActivator implements BundleActivator{

                    public void start(BundleContext context){
                        try {
                          Bundle[] bundleList = context.getBundles();
                          String symbolicName;
                          for(int i=0; i < bundleList.length ; i++) {
                              symbolicName = bundleList[i].getSymbolicName();
                              bundleList[i].stop();
                              bundleList[i].start();
                         }
                        } catch(Exception e) {e.printStackTrace();}
                    }
              }




14   Pierre Parrend – OSGi: Secure Platforms, secure bundles                         27.07.2009
Some other issues
              Denial of service

             • Consume memory
             • Fill the disk
             • Saturate the service registry



              Illegal access

             • Exploit split packages




15   Pierre Parrend – OSGi: Secure Platforms, secure bundles                       27.07.2009
Assessment of OSGi Platforms


          Platform Type                             # of protected   # of identified   Coverage
                                                    Vulns            Vulns
          Concierge                                 0                28                0%
          Felix                                     1                32                3,1 %
          Knopflerfish                              1                31                3,2 %
          Equinox                                   4                31                13 %

          Java Permissions                          13               32                41 %
          Concierge with Permissions                10               28                36 %
          Felix with Permissions                    14               32                44 %
          Knopflerfish with Permissions             14               31                44 %
          Equinox with Permissions                  17               31                55 %




16   Pierre Parrend – OSGi: Secure Platforms, secure bundles                                      27.07.2009
Hardened OSGi
          Introduces

          • Check component size before download, and control
            the cumulated size of loaded components
          • Check digital signature at install time
          • Launch the component activator in a separate Thread
          • Limit the number of registered services


                                                                      Hardened OSGi
          Systematizes
                                                                          Host
          • Do not reject harmless unnecessary metadata
          • Remove all component data from disk at
            uninstallation


      Protection Rate: 25 % for the ‘Malicious Bundles’ catalog entries

17   Pierre Parrend – OSGi: Secure Platforms, secure bundles                          27.07.2009
Outline

     Java Security

     Assessment method

     Robust OSGi Platforms

     Secure Bundles

     An integration


18                                     27.07.2009
Security Issues in OSGi Bundles
              OSGi bundles

             • Shared resources exposed
               • Vulnerabilities can be directly exploited
             • Internal code can have more relaxed constraints



                                                   Shared
                                                   Objects     Internal
                                                               Code


                                          Shared
                                          Classes




19   Pierre Parrend – OSGi: Secure Platforms, secure bundles                      27.07.2009
Security Issues in OSGi Bundles
      Point of view of the architecture


                                            Isolation from         Isolation between components
                                               the user




                                                                           VM

                                  Client              Access control        Isolation from the environment




      More issues
            • Enforcement of component life-cycle
            • Denial of service

20   Pierre Parrend – OSGi: Secure Platforms, secure bundles                                                 27.07.2009
Access Control

     Weak class                                                Abuse


        public class AlmostSecure{
                                                                public class AlmostSecureOverriden {
            public AlmostSecure(){
                                                                    public AlmostSecure(){
                this.init();
                                                                        super();
            }
                                                                    }
             protected void init(){
                                                                    protected void init(){
                 SecurityManager.check();
                                                                    }
             }
                                                                }
        }




                                                                Generic issue to Java




21   Pierre Parrend – OSGi: Secure Platforms, secure bundles                                           27.07.2009
Isolation between components
     The service who likes to be
     manipulated                                               The not so private data

     public class HelloWorldServiceImpl
     implements HelloWorldService{
                                                                package fr.inria.ares.helloworld;
         public final String[]                                  public class HelloWorld{
     myData={„Param1",„Param2"};
                                                                    private class HelloWorldPrinter {
                                                                      private String textHello="HelloWorld";
           public void helloWorld() {                               }
            System.out.println("Hello World");                  }
           }
     }




      Similar issues with static                               Corrected in Java 5
       variables, mutable variables



22   Pierre Parrend – OSGi: Secure Platforms, secure bundles                                            27.07.2009
Denial-of-Service
      A controversial example
            •        Synchronized code




            • Do you consider this a vulnerability ?
23   Pierre Parrend – OSGi: Secure Platforms, secure bundles                       27.07.2009
Recommendations (1/3)

             Bundles should

             • only have dependencies on bundles they trust
             • never used synchronized statements that rely on third
               party code
             • provide a hardened public code implementation following
               given recommendations




24   Pierre Parrend – OSGi: Secure Platforms, secure bundles                           27.07.2009
Recommendations (2/3)

             Shared Classes should

             • provide only final static non-mutable fields
             • set security manager calls during creation in all required
               places at the beginning of the method
               • all constructors
               • clone() method if the class is cloneable
               • readObject(ObjectInputStream) if the class is
                 serializable
             • have security check in final methods only




25   Pierre Parrend – OSGi: Secure Platforms, secure bundles                           27.07.2009
Recommendations (3/3)

             Shared Objects (OSGi Services) should

             • only have basic types and serializable final types as
               parameter
             • perform copy and validation of parameters before using them
             • perform data copy before returning a given object in a method
               • returned object should be either a basic type or serializable.
             • not use Exception that carry any configuration information,
               and not serialize data unless a specific security mechanism is
               available
             • never execute sensitive operations on behalf of other
               components.




26   Pierre Parrend – OSGi: Secure Platforms, secure bundles                           27.07.2009
Contact


     FZI Software Engineering
     Domain
     http://www.fzi.de/se

     Dr. Pierre Parrend
     Senior Scientist


                        FZI Forschungszentrum Informatik
                        Haid-und-Neu-Str. 10-14
                        D-76131 Karlsruhe
                        Tel.: +49-721-9654-620
                        Fax: +49-721-9654-621
                        http://www.fzi.de/se



27

Mais conteúdo relacionado

Mais procurados

Looking into trusted and encrypted keys
Looking into trusted and encrypted keysLooking into trusted and encrypted keys
Looking into trusted and encrypted keysSUSE Labs Taipei
 
OpenSolaris Introduction
OpenSolaris IntroductionOpenSolaris Introduction
OpenSolaris Introductionsatyajit_t
 
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesJan S. Rellermeyer
 
Osol Netadmin Solaris Administrator
Osol Netadmin Solaris AdministratorOsol Netadmin Solaris Administrator
Osol Netadmin Solaris AdministratorOpeyemi Olakitan
 
Deploying FuseMQ with Fuse Fabric
Deploying FuseMQ with Fuse FabricDeploying FuseMQ with Fuse Fabric
Deploying FuseMQ with Fuse Fabricdejanb
 
XPDS16: A Paravirtualized Interface for Socket Syscalls - Dimitri Stiliadis, ...
XPDS16: A Paravirtualized Interface for Socket Syscalls - Dimitri Stiliadis, ...XPDS16: A Paravirtualized Interface for Socket Syscalls - Dimitri Stiliadis, ...
XPDS16: A Paravirtualized Interface for Socket Syscalls - Dimitri Stiliadis, ...The Linux Foundation
 
Devicemgmt
DevicemgmtDevicemgmt
Devicemgmtxyxz
 
Apache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikApache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikEdgar Espina
 
Multi-signed Kernel Module
Multi-signed Kernel ModuleMulti-signed Kernel Module
Multi-signed Kernel ModuleSUSE Labs Taipei
 
Testing Docker Images Security -All day dev ops 2017
Testing Docker Images Security -All day dev ops 2017Testing Docker Images Security -All day dev ops 2017
Testing Docker Images Security -All day dev ops 2017Jose Manuel Ortega Candel
 
Everything you need to know about containers security
Everything you need to know about containers securityEverything you need to know about containers security
Everything you need to know about containers securityJose Manuel Ortega Candel
 
VxWorks - Holistic Security (Art of Testing)
VxWorks - Holistic Security (Art of  Testing)VxWorks - Holistic Security (Art of  Testing)
VxWorks - Holistic Security (Art of Testing)Aditya K Sood
 
Dds presentation omg
Dds presentation omgDds presentation omg
Dds presentation omgmilsoftSDC
 
Rootlinux17: An introduction to Xen Project Virtualisation
Rootlinux17:  An introduction to Xen Project VirtualisationRootlinux17:  An introduction to Xen Project Virtualisation
Rootlinux17: An introduction to Xen Project VirtualisationThe Linux Foundation
 

Mais procurados (20)

System Integrity
System IntegritySystem Integrity
System Integrity
 
Looking into trusted and encrypted keys
Looking into trusted and encrypted keysLooking into trusted and encrypted keys
Looking into trusted and encrypted keys
 
OpenSolaris Introduction
OpenSolaris IntroductionOpenSolaris Introduction
OpenSolaris Introduction
 
Mastering VMware Datacenter Part-1
Mastering VMware Datacenter Part-1Mastering VMware Datacenter Part-1
Mastering VMware Datacenter Part-1
 
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
 
Osol Netadmin Solaris Administrator
Osol Netadmin Solaris AdministratorOsol Netadmin Solaris Administrator
Osol Netadmin Solaris Administrator
 
Deploying FuseMQ with Fuse Fabric
Deploying FuseMQ with Fuse FabricDeploying FuseMQ with Fuse Fabric
Deploying FuseMQ with Fuse Fabric
 
XPDS16: A Paravirtualized Interface for Socket Syscalls - Dimitri Stiliadis, ...
XPDS16: A Paravirtualized Interface for Socket Syscalls - Dimitri Stiliadis, ...XPDS16: A Paravirtualized Interface for Socket Syscalls - Dimitri Stiliadis, ...
XPDS16: A Paravirtualized Interface for Socket Syscalls - Dimitri Stiliadis, ...
 
Devicemgmt
DevicemgmtDevicemgmt
Devicemgmt
 
Apache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikApache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip Hanik
 
Testing Docker Security Linuxlab 2017
Testing Docker Security Linuxlab 2017Testing Docker Security Linuxlab 2017
Testing Docker Security Linuxlab 2017
 
Multi-signed Kernel Module
Multi-signed Kernel ModuleMulti-signed Kernel Module
Multi-signed Kernel Module
 
Testing Docker Images Security -All day dev ops 2017
Testing Docker Images Security -All day dev ops 2017Testing Docker Images Security -All day dev ops 2017
Testing Docker Images Security -All day dev ops 2017
 
Testing Docker Images Security
Testing Docker Images SecurityTesting Docker Images Security
Testing Docker Images Security
 
Testing Docker Images Security -NcN edition
Testing Docker Images Security -NcN editionTesting Docker Images Security -NcN edition
Testing Docker Images Security -NcN edition
 
Everything you need to know about containers security
Everything you need to know about containers securityEverything you need to know about containers security
Everything you need to know about containers security
 
VxWorks - Holistic Security (Art of Testing)
VxWorks - Holistic Security (Art of  Testing)VxWorks - Holistic Security (Art of  Testing)
VxWorks - Holistic Security (Art of Testing)
 
Jetty Vs Tomcat
Jetty Vs TomcatJetty Vs Tomcat
Jetty Vs Tomcat
 
Dds presentation omg
Dds presentation omgDds presentation omg
Dds presentation omg
 
Rootlinux17: An introduction to Xen Project Virtualisation
Rootlinux17:  An introduction to Xen Project VirtualisationRootlinux17:  An introduction to Xen Project Virtualisation
Rootlinux17: An introduction to Xen Project Virtualisation
 

Destaque

Common Security Services. Consolidation patterns for legacy components - Stef...
Common Security Services. Consolidation patterns for legacy components - Stef...Common Security Services. Consolidation patterns for legacy components - Stef...
Common Security Services. Consolidation patterns for legacy components - Stef...mfrancis
 
Security Policy Enforcement for the OSGi Framework using Aspect-Oriented Pr...
Security Policy Enforcement for the OSGi Framework using Aspect-Oriented Pr...Security Policy Enforcement for the OSGi Framework using Aspect-Oriented Pr...
Security Policy Enforcement for the OSGi Framework using Aspect-Oriented Pr...Phú Phùng
 
OSGi als App-Plattform - Ein Ausflug durch den Security-Layer
OSGi als App-Plattform - Ein Ausflug durch den Security-Layer	OSGi als App-Plattform - Ein Ausflug durch den Security-Layer
OSGi als App-Plattform - Ein Ausflug durch den Security-Layer OSGiUsers
 
Java bytecode Malware Analysis
Java bytecode Malware AnalysisJava bytecode Malware Analysis
Java bytecode Malware AnalysisBrian Baskin
 
Introduction To OSGi
Introduction To OSGiIntroduction To OSGi
Introduction To OSGiccustine
 
Casual Cyber Crime
Casual Cyber CrimeCasual Cyber Crime
Casual Cyber CrimeBrian Baskin
 
Enabling Java 2 Runtime Security with Eclipse Plug-ins - Ted Habeck, Advisory...
Enabling Java 2 Runtime Security with Eclipse Plug-ins - Ted Habeck, Advisory...Enabling Java 2 Runtime Security with Eclipse Plug-ins - Ted Habeck, Advisory...
Enabling Java 2 Runtime Security with Eclipse Plug-ins - Ted Habeck, Advisory...mfrancis
 
The Role of the OSGi Gateway in GST Security Objectives and Architecture - An...
The Role of the OSGi Gateway in GST Security Objectives and Architecture - An...The Role of the OSGi Gateway in GST Security Objectives and Architecture - An...
The Role of the OSGi Gateway in GST Security Objectives and Architecture - An...mfrancis
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's Howmrdon
 
Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)Peter R. Egli
 
Sia door supervisor training 5
Sia door supervisor training 5Sia door supervisor training 5
Sia door supervisor training 5hilario859
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in PractiseDavid Bosschaert
 
Information Gathering Over Twitter
Information Gathering Over TwitterInformation Gathering Over Twitter
Information Gathering Over TwitterBrian Baskin
 
Privacy_Engineering_Privacy Assurance_Lecture-Ecole_Polytechnic_Nice_SA-20150127
Privacy_Engineering_Privacy Assurance_Lecture-Ecole_Polytechnic_Nice_SA-20150127Privacy_Engineering_Privacy Assurance_Lecture-Ecole_Polytechnic_Nice_SA-20150127
Privacy_Engineering_Privacy Assurance_Lecture-Ecole_Polytechnic_Nice_SA-20150127Frank Dawson
 
Raising information security awareness
Raising information security awarenessRaising information security awareness
Raising information security awarenessTerranovatraining
 
Workshop OSGI PPT
Workshop OSGI PPTWorkshop OSGI PPT
Workshop OSGI PPTSummer Lu
 

Destaque (19)

Common Security Services. Consolidation patterns for legacy components - Stef...
Common Security Services. Consolidation patterns for legacy components - Stef...Common Security Services. Consolidation patterns for legacy components - Stef...
Common Security Services. Consolidation patterns for legacy components - Stef...
 
Security Policy Enforcement for the OSGi Framework using Aspect-Oriented Pr...
Security Policy Enforcement for the OSGi Framework using Aspect-Oriented Pr...Security Policy Enforcement for the OSGi Framework using Aspect-Oriented Pr...
Security Policy Enforcement for the OSGi Framework using Aspect-Oriented Pr...
 
OSGi als App-Plattform - Ein Ausflug durch den Security-Layer
OSGi als App-Plattform - Ein Ausflug durch den Security-Layer	OSGi als App-Plattform - Ein Ausflug durch den Security-Layer
OSGi als App-Plattform - Ein Ausflug durch den Security-Layer
 
Java bytecode Malware Analysis
Java bytecode Malware AnalysisJava bytecode Malware Analysis
Java bytecode Malware Analysis
 
P2P Forensics
P2P ForensicsP2P Forensics
P2P Forensics
 
Introduction To OSGi
Introduction To OSGiIntroduction To OSGi
Introduction To OSGi
 
Casual Cyber Crime
Casual Cyber CrimeCasual Cyber Crime
Casual Cyber Crime
 
Enabling Java 2 Runtime Security with Eclipse Plug-ins - Ted Habeck, Advisory...
Enabling Java 2 Runtime Security with Eclipse Plug-ins - Ted Habeck, Advisory...Enabling Java 2 Runtime Security with Eclipse Plug-ins - Ted Habeck, Advisory...
Enabling Java 2 Runtime Security with Eclipse Plug-ins - Ted Habeck, Advisory...
 
The Role of the OSGi Gateway in GST Security Objectives and Architecture - An...
The Role of the OSGi Gateway in GST Security Objectives and Architecture - An...The Role of the OSGi Gateway in GST Security Objectives and Architecture - An...
The Role of the OSGi Gateway in GST Security Objectives and Architecture - An...
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's How
 
Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)
 
Sia door supervisor training 5
Sia door supervisor training 5Sia door supervisor training 5
Sia door supervisor training 5
 
Intro To OSGi
Intro To OSGiIntro To OSGi
Intro To OSGi
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
Information Gathering Over Twitter
Information Gathering Over TwitterInformation Gathering Over Twitter
Information Gathering Over Twitter
 
Why OSGi?
Why OSGi?Why OSGi?
Why OSGi?
 
Privacy_Engineering_Privacy Assurance_Lecture-Ecole_Polytechnic_Nice_SA-20150127
Privacy_Engineering_Privacy Assurance_Lecture-Ecole_Polytechnic_Nice_SA-20150127Privacy_Engineering_Privacy Assurance_Lecture-Ecole_Polytechnic_Nice_SA-20150127
Privacy_Engineering_Privacy Assurance_Lecture-Ecole_Polytechnic_Nice_SA-20150127
 
Raising information security awareness
Raising information security awarenessRaising information security awareness
Raising information security awareness
 
Workshop OSGI PPT
Workshop OSGI PPTWorkshop OSGI PPT
Workshop OSGI PPT
 

Semelhante a Security in OSGi applications: Robust OSGi Platforms, secure Bundles

Robust Embedded Applications OSGi ME Platforms
Robust Embedded Applications OSGi ME PlatformsRobust Embedded Applications OSGi ME Platforms
Robust Embedded Applications OSGi ME PlatformsOSGi User Group France
 
Getting Into The Flow With CQ DAM
Getting Into The Flow With CQ DAMGetting Into The Flow With CQ DAM
Getting Into The Flow With CQ DAMLars Trieloff
 
Getting Into The Flow With Cq Dam
Getting Into The Flow With Cq DamGetting Into The Flow With Cq Dam
Getting Into The Flow With Cq Damday
 
OSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishOSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishArun Gupta
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaArun Gupta
 
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...mfrancis
 
Shmoocon 2013 - OpenStack Security Brief
Shmoocon 2013 - OpenStack Security BriefShmoocon 2013 - OpenStack Security Brief
Shmoocon 2013 - OpenStack Security Briefopenfly
 
Automated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security IntelligenceAutomated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security IntelligenceJason Choi
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud ComputingGoa App
 
OSGi User Forum US DC Metro
OSGi User Forum US DC MetroOSGi User Forum US DC Metro
OSGi User Forum US DC MetropjhInovex
 
OSGi user forum dc metro v1
OSGi user forum dc metro v1OSGi user forum dc metro v1
OSGi user forum dc metro v1pjhInovex
 
Enterprise OSGi at eBay
Enterprise OSGi at eBayEnterprise OSGi at eBay
Enterprise OSGi at eBayTony Ng
 
Forecast 2012 Panel: Security POC NAB, Terremark, Trapezoid
Forecast 2012 Panel: Security POC NAB, Terremark, TrapezoidForecast 2012 Panel: Security POC NAB, Terremark, Trapezoid
Forecast 2012 Panel: Security POC NAB, Terremark, TrapezoidOpen Data Center Alliance
 
stackconf 2022: Minimum Viable Security for Cloud Native Stacks
stackconf 2022: Minimum Viable Security for Cloud Native Stacksstackconf 2022: Minimum Viable Security for Cloud Native Stacks
stackconf 2022: Minimum Viable Security for Cloud Native StacksNETWAYS
 
Guidelines to Improve the Robustness of the OSGi Framework and Its Services A...
Guidelines to Improve the Robustness of the OSGi Framework and Its Services A...Guidelines to Improve the Robustness of the OSGi Framework and Its Services A...
Guidelines to Improve the Robustness of the OSGi Framework and Its Services A...mfrancis
 
Enterprise Applications With OSGi and SpringSource dm Server
Enterprise Applications With OSGi and SpringSource dm ServerEnterprise Applications With OSGi and SpringSource dm Server
Enterprise Applications With OSGi and SpringSource dm ServerSam Brannen
 
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)David Bosschaert
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009Roland Tritsch
 

Semelhante a Security in OSGi applications: Robust OSGi Platforms, secure Bundles (20)

Robust Embedded Applications OSGi ME Platforms
Robust Embedded Applications OSGi ME PlatformsRobust Embedded Applications OSGi ME Platforms
Robust Embedded Applications OSGi ME Platforms
 
Getting Into The Flow With CQ DAM
Getting Into The Flow With CQ DAMGetting Into The Flow With CQ DAM
Getting Into The Flow With CQ DAM
 
Getting Into The Flow With Cq Dam
Getting Into The Flow With Cq DamGetting Into The Flow With Cq Dam
Getting Into The Flow With Cq Dam
 
OSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishOSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFish
 
Eclipse RT Day
Eclipse RT DayEclipse RT Day
Eclipse RT Day
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 India
 
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
 
Shmoocon 2013 - OpenStack Security Brief
Shmoocon 2013 - OpenStack Security BriefShmoocon 2013 - OpenStack Security Brief
Shmoocon 2013 - OpenStack Security Brief
 
Automated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security IntelligenceAutomated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security Intelligence
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
OSGi User Forum US DC Metro
OSGi User Forum US DC MetroOSGi User Forum US DC Metro
OSGi User Forum US DC Metro
 
OSGi user forum dc metro v1
OSGi user forum dc metro v1OSGi user forum dc metro v1
OSGi user forum dc metro v1
 
Enterprise OSGi at eBay
Enterprise OSGi at eBayEnterprise OSGi at eBay
Enterprise OSGi at eBay
 
Forecast 2012 Panel: Security POC NAB, Terremark, Trapezoid
Forecast 2012 Panel: Security POC NAB, Terremark, TrapezoidForecast 2012 Panel: Security POC NAB, Terremark, Trapezoid
Forecast 2012 Panel: Security POC NAB, Terremark, Trapezoid
 
stackconf 2022: Minimum Viable Security for Cloud Native Stacks
stackconf 2022: Minimum Viable Security for Cloud Native Stacksstackconf 2022: Minimum Viable Security for Cloud Native Stacks
stackconf 2022: Minimum Viable Security for Cloud Native Stacks
 
Guidelines to Improve the Robustness of the OSGi Framework and Its Services A...
Guidelines to Improve the Robustness of the OSGi Framework and Its Services A...Guidelines to Improve the Robustness of the OSGi Framework and Its Services A...
Guidelines to Improve the Robustness of the OSGi Framework and Its Services A...
 
Enterprise Applications With OSGi and SpringSource dm Server
Enterprise Applications With OSGi and SpringSource dm ServerEnterprise Applications With OSGi and SpringSource dm Server
Enterprise Applications With OSGi and SpringSource dm Server
 
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009
 

Security in OSGi applications: Robust OSGi Platforms, secure Bundles

  • 1. Security in OSGi applications: Robust OSGi Platforms, secure Bundles 27.10.2009 Pierre Parrend RESEARCH ON YOUR BEHALF parrend@fzi.de
  • 2. The vision What happens if the WebCam Driver is a Dynamic applications Malware ? WebCamDriver Bundle 1. 3. 2. WebCam WebCam Component Repository PDA PDA WebCamDriver Bundle DriverLister Bundle DriverLister Bundle SOP Platform SOP Platform (installed on the PDA) (installed on the PDA) 2 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 3. Existing applications Jboss, Server-side Eclipse • OSGi as application server • Integration of open source bundles from several sources • Abuse cases • Attacks through the web front end • Backdoor bundles inside the server Yoxos secure source • Validation of open source code • Three levels • Access from a secure repository • Basic security analysis of code • TÜV Certified security audit: external reach, malicious behavior 3 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 4. Outline Java Security Assessment method Robust OSGi Platforms Secure Bundles An integration 4 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 5. Java1: Do not trust the Bytecode  The Bytecode validation process 5 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 6. Java2: From the Sandbox to Permission Domains  JDK 1.1  JDK 1.2 [LiGong1997] 6 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 7. OSGi-based Applications: Threats  Exploitation of the platform  Exploitation of the 3d party bundles 7 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 8. Outline Java Security Assessment method Robust OSGi Platforms Secure Bundles An integration 8 27.07.2009
  • 9. A Metric for Security Protection  The Coverage Metric • Percentage of the known vulnerabilities that are protected • Based on the Attack Surface metric C • Enables to o Assess individual security mechanism o Compare execution environments 9 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 10. Outline Java Security Assessment method Robust OSGi Platforms Secure Bundles An integration 10 27.07.2009
  • 11. Security Issues in OSGi Platforms The OSGi Platform Threats  Denial of service • Platform stop • Resource consumption • Blocking the console  Undue access Service layer • Bundle Management Module layer • Bundle code Life-cycle layer JVM Host 11 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 12. Stopping the Platform Stop your application Just crash it public class RuntimeHaltActivator public class Stopper extends Thread{ implements BundleActivator{ public void start(BundleContext public void run(){ context){ Stopper tt = new Stopper(); Runtime.getRuntime().halt(0); tt.start(); } Stopper tt2 = new Stopper(); } tt2.start(); Stopper tt3 = new Stopper(); tt3.start(); } }  Simple example  Thread management features do • Bundelized application not help  Bytecode Forgery is another way to crash the JVM 12 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 13. Blocking the console Simply sleepy Resource greedy public class SleepingBundleActivator public class implements BundleActivator{ InfStartupLoopActivator implements public void start(BundleContext BundleActivator{ context){ public void start(BundleContext try{ context){ int sec = 50; while(1==1){} Thread.sleep(sec * 1000); } } } catch(InterruptedException e) {e.printStackTrace();} } }  Management actions no longer  Also consume most of the possible available CPU 13 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 14. Playing with the bundles of your neighbour applications public class PiratBundleManagerActivator implements BundleActivator{ public void start(BundleContext context){ try { Bundle[] bundleList = context.getBundles(); String symbolicName; for(int i=0; i < bundleList.length ; i++) { symbolicName = bundleList[i].getSymbolicName(); bundleList[i].stop(); bundleList[i].start(); } } catch(Exception e) {e.printStackTrace();} } } 14 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 15. Some other issues Denial of service • Consume memory • Fill the disk • Saturate the service registry Illegal access • Exploit split packages 15 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 16. Assessment of OSGi Platforms Platform Type # of protected # of identified Coverage Vulns Vulns Concierge 0 28 0% Felix 1 32 3,1 % Knopflerfish 1 31 3,2 % Equinox 4 31 13 % Java Permissions 13 32 41 % Concierge with Permissions 10 28 36 % Felix with Permissions 14 32 44 % Knopflerfish with Permissions 14 31 44 % Equinox with Permissions 17 31 55 % 16 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 17. Hardened OSGi Introduces • Check component size before download, and control the cumulated size of loaded components • Check digital signature at install time • Launch the component activator in a separate Thread • Limit the number of registered services Hardened OSGi Systematizes Host • Do not reject harmless unnecessary metadata • Remove all component data from disk at uninstallation  Protection Rate: 25 % for the ‘Malicious Bundles’ catalog entries 17 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 18. Outline Java Security Assessment method Robust OSGi Platforms Secure Bundles An integration 18 27.07.2009
  • 19. Security Issues in OSGi Bundles OSGi bundles • Shared resources exposed • Vulnerabilities can be directly exploited • Internal code can have more relaxed constraints Shared Objects Internal Code Shared Classes 19 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 20. Security Issues in OSGi Bundles  Point of view of the architecture Isolation from Isolation between components the user VM Client Access control Isolation from the environment  More issues • Enforcement of component life-cycle • Denial of service 20 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 21. Access Control Weak class Abuse public class AlmostSecure{ public class AlmostSecureOverriden { public AlmostSecure(){ public AlmostSecure(){ this.init(); super(); } } protected void init(){ protected void init(){ SecurityManager.check(); } } } }  Generic issue to Java 21 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 22. Isolation between components The service who likes to be manipulated The not so private data public class HelloWorldServiceImpl implements HelloWorldService{ package fr.inria.ares.helloworld; public final String[] public class HelloWorld{ myData={„Param1",„Param2"}; private class HelloWorldPrinter { private String textHello="HelloWorld"; public void helloWorld() { } System.out.println("Hello World"); } } }  Similar issues with static  Corrected in Java 5 variables, mutable variables 22 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 23. Denial-of-Service  A controversial example • Synchronized code • Do you consider this a vulnerability ? 23 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 24. Recommendations (1/3) Bundles should • only have dependencies on bundles they trust • never used synchronized statements that rely on third party code • provide a hardened public code implementation following given recommendations 24 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 25. Recommendations (2/3) Shared Classes should • provide only final static non-mutable fields • set security manager calls during creation in all required places at the beginning of the method • all constructors • clone() method if the class is cloneable • readObject(ObjectInputStream) if the class is serializable • have security check in final methods only 25 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 26. Recommendations (3/3) Shared Objects (OSGi Services) should • only have basic types and serializable final types as parameter • perform copy and validation of parameters before using them • perform data copy before returning a given object in a method • returned object should be either a basic type or serializable. • not use Exception that carry any configuration information, and not serialize data unless a specific security mechanism is available • never execute sensitive operations on behalf of other components. 26 Pierre Parrend – OSGi: Secure Platforms, secure bundles 27.07.2009
  • 27. Contact FZI Software Engineering Domain http://www.fzi.de/se Dr. Pierre Parrend Senior Scientist FZI Forschungszentrum Informatik Haid-und-Neu-Str. 10-14 D-76131 Karlsruhe Tel.: +49-721-9654-620 Fax: +49-721-9654-621 http://www.fzi.de/se 27