28
Advanced Security on Kubernetes with Istio 20 June 2018 Shunsuke Miyoshi ([email protected] ) Fujitsu Limited. Copyright 2018 FUJITSU LIMITED 0

Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Advanced Security on Kubernetes with Istio

20 June 2018

Shunsuke Miyoshi ([email protected])

Fujitsu Limited.

Copyright 2018 FUJITSU LIMITED0

Page 2: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Outline

Backgrounds

Recent Cyber Attack Trends

Conventional Network

Zero Trust Network Model

Zero Trust Network in Kubernetes with Istio

Demo

Summary

Copyright 2018 FUJITSU LIMITED1

Page 3: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Recent Cyber Attack Trends

Increasing the number of cyber attacks

Advancing of Attacks

APT(Advanced Persistent Threat) Attack

• continuously attack to special target with long period of time

Copyright 2018 FUJITSU LIMITED2

The number of Targeted e-mail attack in Japan

1009492

1723

38284046

6027

2012 2013 2014 2015 2016 2017

# o

f Ta

rge

ted

e-m

ail

att

ack

Year

*) data from National Police Agency(http://www.npa.go.jp/)

Page 4: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Recent Cyber Attack Trends

Increasing the number of cyber attacks

Advancing of Attacks

APT(Advanced Persistent Threat) Attack

• continuously attack to special target with long period of time

Copyright 2018 FUJITSU LIMITED3

The number of Targeted e-mail attack in Japan

1009492

1723

38284046

6027

2012 2013 2014 2015 2016 2017

# o

f Ta

rge

ted

e-m

ail

att

ack

Year

*) data from National Police Agency(http://www.npa.go.jp/)

Page 5: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Advancing of Targeted e-Mail Attack

Copyright 2018 FUJITSU LIMITED4

Previous Now

e-Mail

From: [email protected]

To: [email protected]

Title: You won the prize money!

Dear member,

You won the prize money!

Please click http://mysite.com

Target: Anyone

Target: Individually

e-Mail

From: [email protected]

To: your-address@travel_egency.com

Title: Notification of attachment

of e-ticket receipt

Attach: e-Ticket.pdf

Please check attached e-Ticket,

and replay me.

Page 6: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Advancing of Targeted e-Mail Attack

Copyright 2018 FUJITSU LIMITED5

Previous Now

e-Mail

From: [email protected]

To: [email protected]

Title: You won the prize money!

Dear member,

You won the prize money!

Please click http://mysite.com

Target: Anyone

Target: Individually

Free Address

Easy to find

this is fake

e-Mail

From: [email protected]

To: your-address@travel_egency.com

Title: Notification of attachment

of e-ticket receipt

Attach: e-Ticket.pdf

Please check attached e-Ticket,

and replay me.

Page 7: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Advancing of Targeted e-Mail Attack

Copyright 2018 FUJITSU LIMITED6

Previous Now

e-Mail

From: [email protected]

To: [email protected]

Title: You won the prize money!

Dear member,

You won the prize money!

Please click http://mysite.com

Target: Anyone

Target: Individually

e-Mail

From: [email protected]

To: your-address@travel_egency.com

Title: Notification of attachment

of e-ticket receipt

Attach: e-Ticket.pdf

Please check attached e-Ticket,

and replay me.

Forge to<name>@<company's addr>

individually targeted

Too difficult to find

this is business e-Mail or not

Forge to PDF file

Page 8: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Conventional Network

Firewall-based Security

Policy: Inside a local network is safety

Copyright 2018 FUJITSU LIMITED7

local network

public network

Once Attacked ・・・Damage greatly expands

Service

Attacked Service

Page 9: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Zero Trust Network Model

Zero Trust Network Model

Concept: Never Trust, Always verify

Ex. Service 'X' is really Service 'X' ?, Data is not wiretapped?, Authorized?

Copyright 2018 FUJITSU LIMITED8

Previous System

・Inside a local network is safety

→ Firewall based system

Next Generation System

we never know where the enemy is

→ Zero Trust Network Model

protecting-line

Page 10: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Zero Trust Network in Kubernetes

Image of Kubernetes

Copyright 2018 FUJITSU LIMITED9

Intra network

Kubernetes Cluster

User

kubectl ・・・

Service

Page 11: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Zero Trust Network in Kubernetes

Role Based Access Control(RBAC)

Access Control: User → Cluster

Ex. allow get/edit resources(Pod, Service, …)

of Namespace 'A'

→ Unsafe yet

Wiretap from other Service

Spoofing of Regular Service

Copyright 2018 FUJITSU LIMITED10

User

kubectl ・・・

Secured by RBACKubernetes Cluster

Page 12: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Zero Trust Network in Kubernetes

Security of Communication between Services

Encryption of Communication Channel

Authentication of Destination Service

• Is the destination service really correct?

• Do you really receive from the correct service?

Copyright 2018 FUJITSU LIMITED11

User

kubectl ・・・

Secured by RBACKubernetes Cluster

Page 13: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Zero Trust Network in Kubernetes

Security of Communication between Services

Encryption of Communication Channel

Authentication of Destination Service

• Is the destination service really correct?

• Do you really receive from the correct service?

Copyright 2018 FUJITSU LIMITED12

User

kubectl ・・・

Secured by RBACKubernetes Cluster

Install certificate to all application

change application code to encrypt data

※ Any Programming Language and Any Framework

For realization

Page 14: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Information that Service Owner Must Manage

Copyright 2018 FUJITSU LIMITED13

Service X

Destination Certificate Path Expiration date

Service A /etc/certs/svc_a.crt 2018/12

Service F /etc/certs/new/svc_f.crt 2019/05

Service Y /etc/certs/v2/svc_y.crt 2019/01

・・・

・・・

・・・

How to install

certificate

in

Ruby on Rails

How to install

certificate

in

Apache

Web Server

・・・

Page 15: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Information that Service Owner Must Manage

Copyright 2018 FUJITSU LIMITED14

Service X

Destination Certificate Expiration date

Service A /etc/certs/svc_a.crt 2018/12

Service F /etc/certs/new/svc_f.crt 2019/05

Service Y /etc/certs/v2/svc_y.crt 2019/01

・・・

・・・

・・・

How to install

certificate

in

Ruby on Rails

How to install

certificate

in

Apache

Web Server

・・・

All service owner must manage them

Too hard …

Istio as a Manager of Service Communication Security

Page 16: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Istio

Copyright 2018 FUJITSU LIMITED15

Page 17: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Overview of Istio

What's Istio?

Network Infrastructure for services communication

Improve services communication

without application code changing

Features

Traffic Management

Policy Enforcement

Observability

Security

Copyright 2018 FUJITSU LIMITED16

Application communication

Istio(Service Mesh)

Kubernetes Network

(Container Connection)

Network Layer Stack

Page 18: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Istio Architecture

Copyright 2018 FUJITSU LIMITED17

17

Control

PlanePilot Mixer Citadel

Envoy

Application

Container

Pod

Data

Plane

Service X Service Y

https, gRPC, …

TLS certs

to EnvoysPolicy checks,

telemetry

Config data

to Envoys

Envoy

Application

Container

Pod

Page 19: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Security of Istio

How Istio secures communication between services

1. Distribute Certificate to Envoy from Citadel

2. Secure Communication with the Certificate

※ Citadel manage certificate

• Automate key and certificate generation, distribution, rotation, and revocation

Copyright 2018 FUJITSU LIMITED18

Service X

Envoy

Application

Pod

Service Y

Citadel

Envoy

Application

Pod

Page 20: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Istio Role Based Access Control(RBAC)

Authorize

Service to Service

End User to Service

Copyright 2018 FUJITSU LIMITED19

Service Y

Service X

Svc 𝑇1Svc 𝑇2

Svc 𝑇3

Namespace T

User A○

×deny

allow

allowIstio RBAC Policy

Service X allow

User A allow

Namespace T deny

Page 21: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Zero Trust Network Kubernetes with Istio

Copyright 2018 FUJITSU LIMITED20

Service

Attacked Servicek8s RBAC controls user access

*) Istio internally uses k8s RBAC

Never Expand!

k8s RBAC only

k8s RBAC

+ Istio

Page 22: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Demo

Copyright 2018 FUJITSU LIMITED21

*source code: https://github.com/sh-miyoshi/sectest

Page 23: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Demo

Contents

Wiretap

Spoofing1(Already Password Leaked)

Spoofing2(Already Password and Certificate Leaked)

Configuration of Demo

Copyright 2018 FUJITSU LIMITED22

Internet

User

Frontend

Web Server

Backend

API Server

MySQL DB

Web API

request

JSON

response

Kubernetes Cluster

with https

Page 24: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Demo 1

Wiretap

Overview of attack

• Web Server communicate to API Server via http(not encrypt)

• Attacker is trying to wiretap the communication

Countermeasure

• All communication use https

Copyright 2018 FUJITSU LIMITED23

Frontend

Web Server

Backend

API Server

MySQL DB

name, pw

with http

attacker

with https

User

Ingress

with http

Kubernetes Cluster

Page 25: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Demo 2

Spoofing1(Already Password Leaked)

Overview of attack

• Password of DB was already leaked. (e.g. leaked by other service)

Countermeasure

• Mutual Authentication

• Authenticate Frontend ⇔ Backend

Copyright 2018 FUJITSU LIMITED24

Frontend

Web Server

Backend

API Server

MySQL DB

I have password!

Please send secret info

Page 26: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Demo 3

Spoofing2(Already Password and Certificate Leaked)

Overview of attack

• Password and Istio certificate are leaked due to sloppy management.

Countermeasure

• Setting Access Policy to Service

• default: deny

• allow: only from Service 'Frontend'

Copyright 2018 FUJITSU LIMITED25

Frontend

Web Server

Backend

API Server

MySQL DB

I am legitimate service.

Because I have certificate.

I need secret info

Page 27: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU

Summary

Introduction of Zero Trust Network Model

Attacks become more sophisticated

Serious damage to your business when attacked

→ Never increase the damage

Kubernetes + Istio

Become more secure without application code changing

Copyright 2018 FUJITSU LIMITED26

Istio

Page 28: Advanced Security on Kubernetes with Istio - Linux Foundation … › wp-content › uploads › ... · 2019-12-21 · Advancing of Targeted e-Mail Attack 6 Copyright 2018 FUJITSU