24
Leveraging the Serverless Architecture for Securing Linux Containers Nilton Bila, Paolo Dettori, Ali Kanso, Yuji Watanabe*, Alaa Youssef IBM T.J. Watson Research Center – New York *IBM Research - Tokyo, IBM Japan Ltd. Ali Kanso, PhD Senior Cloud SW Engineer IBM T.J. Watson, NY

Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

Leveraging the Serverless Architecture for Securing Linux Containers

NiltonBila, PaoloDettori,Ali Kanso, YujiWatanabe*, Alaa YoussefIBMT.J. WatsonResearchCenter –NewYork

*IBMResearch- Tokyo, IBM Japan Ltd.

Ali Kanso, PhDSenior CloudSWEngineerIBMT.J. Watson,NY

Page 2: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

Leveraging the Serverless Architecture for Securing Linux Containers

Page 3: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

ShippingCode

Binary• exe• elf

Packaged• JAR• WAR• Gem

Containerized

• Images(dockerfiles)

ButContainerimagescanhavevulnerabilities bakedinthem!

Page 4: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

SoftwareVulnerabilitiesPackageVu

lnerability

E.g.: Ghost Vulnerability in gLibclibrary < 2.18

(2000à2013)

ConfigurationVu

lnerability

E.g.: OpenSSH installed &#PasswordAuthenticationyes#PermitEmptyPasswords

Yes (or even no)

MalwareSignature

E.g.:- Viruses- Worms

- SpyWares- Trojan Horses

Page 5: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

ScanningforVulnerabilities

IBMVulnerabilityAdvisor

Docker SecurityScanning

ü Scanimagesanddeployedcontainersü Vulnerabilitiesininstalledsoftwarepackagesü Securityconfigurationchecksü Malwaresignaturedetection

Page 6: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

ClusteringContainers

Clusteringcanbeoverwhelming

Kubernetescanhelp

Page 7: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

WhatisKubernetes?

Applications Containerized Clustered

Kubernetesmaster

Kubernetesagent

ContainerizedappsContainerizedappsContainerizedappsü Schedulingü Monitoringü Recoverymanagementü Auto-scalingü Authorization/Authentica

tion…

MasterNode

WorkerNode(Minion)

ü Monitoringü Reportingü Executingmaster’s

recommendations…

Page 8: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

KubernetesResourceOrganizationExamplepoddescription

kind:Podmetadata:name:myPodspec:containers:- name:sleep-foreverimage:pause:0.8.0resources:limits:memory:1000Mi

Page 9: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

K8sAPIs

CoreGroup ExtensionsGroupmonolithicv1API

RESTpath/api/v1ü Podsü Servicesü Replicationcontrollersü Resourcequotasü Nodesü Endpointsü …

RESTpath/apis/extensions/$VERSIONü Deploymentsü HorizontalPodAutoscalersü Ingressü Jobsü DaemonSetsü Thirdpartyresourcesü …

Page 10: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

K8sOperators

K8sAPI Thirdpartyresources Operators<<Leverage>><<Extend>>

Page 11: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

K8sThirdPartyResource(TPR)

K8sMaster(APIserver)

APIpathØ TPR

Ø SecurityactionsØ quarantine<<CRUDoperations>>

Third-PartySoftware(executable)

<<Watch&react>>

Controller:bridgingtheactualstatewiththedesiredstate

Resourceinstance:reflectingthedesiredstate

Securityaction,toquarantine ordelete container

http://192.168.0.15:8080/apis/myorg.com/v1/namespaces/default/securityactions/quarantine

Page 12: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

KubernetesLimitation• K8sdoesnotimplementtheneededrangeofactionstocontainathreat

– Limitedto:Killpod,Rolling-Upgrade(involveskilling)PackageVu

lnerability

Quarantineuntil patched

ConfigurationVu

lnerability

Gracefully shutdown and preserve state for future investigation

MalwareSignature

Immediate kill

Weneedtohaveseverity-basedactions!

Page 13: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

IntroducingtheSecurityEnforcementOperator

Kubernetesmaster KubernetesWorker

K8sAPI-server

Docker Docker

OS

PodsPods

OS

SEO

ü Quarantine/Unqarantineü Pause/unpauseü Stop/startü Fast-deleteü Graceful-delete

Net-plugin

Basedonscanningresults

Page 14: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

VulnerabilityScanner

RegistryMonitorK8sWorkersImageRegistries VS-agent

scanimages

K8sWorkersK8sWorker Nodes

VS-agent

PodsPods

scandeployedcontainers

containerconfigurationinformation

ThreadIntelligenceingestthreatdata

periodically

VulnerabilityScanner

securityconfigurationchecks

packagevulnerabilitydetection

malwaresignaturedetection

?Notification+summaryofvulnerabilityfindings

(ReportfromVulnerabilityAdvisor)

imageconfigurationinformation

Page 15: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

VSReportExample• Identifyspecificsoftwarepackageversionsinthecontainerwithdisclosedvulnerabilities

• Identifyspecificissueswiththecontainerconfigurations

Page 16: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

Leveraging the Serverless Architecture for Securing Linux Containers

Page 17: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

K8sWorkers

VS

OpenWhisk

K8sAPIserver

K8sWorkers

CRUDoperations

VS-agentSEO

PodsPods

K8sAPIserver

PoliciesPolicies

Add/Remove/ModifyActionbasedpolicies

IntroducingOpenWhisk

?

Page 18: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

WhyOpenWhisk?

• OpenWhisk istheGluebetweenVSandK8s,itenables:– Different policies fordifferentusers–Multiple Clusters registertothesameOpenWhisk deployment

– Central point ofpolicymanagementacrossclusters

Actionbasedpolicies

Page 19: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

ReportAPIandNotificationsonVulnerabilityScanner

• SupportsscansformultipleregisteredKubernetesclusters.• ProvideRESTful APIsforaccesstoVulnerabilityreportsforeachcontainer

• UseauthenticationtokentorestrictaccesstoclusterdataatthegranularityofKubernetesnamespaces.

• NotifyeventswithnewvulnerabilityfindingstoregisteredOpenWhisk APIendpoints.

• TriggeractioninvocationstotheOpenWhisk APIendpointsregisteredfortheKubernetescluster.

Page 20: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

Notifications

• UsercreatesactionwithknownURLendpoint:– https://openwhisk.ng.bluemix.net/api/v1/web/<USER>/policy

• VulnerabilityScannerpostsvulnerabilitynotificationtopolicyendpoint

{“clusterid”: “xyz”,“podid”: “nginx- 3382653011-3p4p0”,“vulnerability_type”: “package”,“vulnerability_status”: “vulnerable”

}

PerUserPolicy!

Page 21: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

• import vsimport kubernetes

def main(params):findings = vs.get_findings(pod_id, timestamp) vulnerable_packages = findings['vulnerable_packages'] insecure_configs = findings['insecure_configurations']

if len(vulnerable_packages) > 0: kubernetes.snapshot(pod_id) kubernetes.terminate_graceful(pod_id)return {'text': 'Deleted pod ' + pod_id }

if 'remote_shell_installed' in insecure_configs:kubernetes.quarantine(pod_id)return {'text': 'Quarantined pod ' + pod_id}

return {'text': 'Container was not modified ' + pod_id}

Serverless Policy

Terminate_faste(pod_id)

User1: marketing

User2: accounting

Terminated pod

Page 22: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

VS OpenWhisk SEOK8s Networking

QuarantinePod

Podquarantined

Threatcontained

Quarantinecontainer(s)

Container(s)quarantined

NewPodcreatedScanningtriggered

Vulnerabilityfound

QuarantinePod

Executepolicy

InteractionSummary

Page 23: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

RelatedWork

SecuringContainers

Starlight implementsakernelmodulethatinterceptslocaloperationsoneachhostandpassesthemtoalocalagentwhichinturnpassesthemtoaneventprocessorthatanalyzestheeventand

determineswhetherornottoalerttheadmin.

LiCShield generatesAppArmor profilesbytracingthecontainerengine(Docker daemon)

duringthebuildandtheexecutionofthecontainers.

UsingServerless intheCloud

Lambdefy frameworktodemonstratethedifferingrequirementsbetweenapplicationsdeployedtoIaaS andapplicationsdeployedasacloudevent,andMediaManagementSystemforshowinghigh

scalabilityofimageresizingtasksonLambda.

ContainerScanners

OpenSCAP (SecurityContentAutomationProtocol)searchesforanappropriatefixelement,resolvesit,preparestheenvironment,andexecutesthefixscript.

Docker SecurityScanningcanscanimagesinprivaterepositoriestoverifythattheyarefreefromknownsecurityvulnerabilitiesorexposures,andreporttheresultsofthescanforeachimagetag

Page 24: Leveraging the ServerlessArchitecture for Securing Linux ... · Leveraging the ServerlessArchitecture for Securing Linux Containers NiltonBila,PaoloDettori,AliKanso,YujiWatanabe*,AlaaYoussef

That’sit!Questions?

Leveraging the Serverless Architecture for Securing Linux Containers

OpenWhisk

KubernetesVulnerability scannerSecurity Enforcement Operator