SlideShare a Scribd company logo
© Hitachi Solutions, Ltd. 2016. All rights reserved.
Hitachi Solutions Ltd.,
2016/11/11
Toshio Maki
Cloud Foundry over the Proxy
© Hitachi Solutions, Ltd. 2016. All rights reserved.
Toshio Maki / Hitachi Solutions Ltd.,
Working at R&D division
Our missions are
• Technical assistance
• Software productivity improvement
• Develop and operate our platform
I started Cloud Foundry at Jan 2016.
(In our company, we started researching from April 2015.)
1
About me
© Hitachi Solutions, Ltd. 2016. All rights reserved.
Our platform
2
We are building DevOps platform on Public Cloud.
• Limit access only our network (not VPN)
• Permit only HTTPS protocol
Developer
Our company
Source Code Management
PaaS
Developer
Developer
LDAP
drone
CI/CD
Public IaaS
© Hitachi Solutions, Ltd. 2016. All rights reserved.
Our platform
3
We are building DevOps platform on Public Cloud.
• Limit access only our network (not VPN)
• Permit only HTTPS protocol
• Our accesses are restricted by Proxy with LDAP authentication
Developer
Our company
Source Code Management
PaaS
Developer
Developer
LDAP
drone
CI/CD
Public IaaS
© Hitachi Solutions, Ltd. 2016. All rights reserved.
Our problems are…
4
How to integrate Cloud Foundry over proxy?
© Hitachi Solutions, Ltd. 2016. All rights reserved.
Case 1: “cf login”
5
© Hitachi Solutions, Ltd. 2016. All rights reserved.
How to integrate LDAP authentication over proxy?
6
We would like to use LDAP authentication. But…
Developer
Our company
Source Code Management
PaaS
Developer
Developer
LDAP
drone
CI/CD
Public IaaS
© Hitachi Solutions, Ltd. 2016. All rights reserved.
How to integrate LDAP authentication over proxy?
7
We would like to use LDAP authentication. But…
• We can’t move LDAP server to Public Cloud(security reason)
Developer
Our company
Source Code Management
PaaS
Developer
Developer
LDAP
drone
CI/CD
Public IaaS
© Hitachi Solutions, Ltd. 2016. All rights reserved.
How to integrate LDAP authentication over proxy?
8
We would like to use LDAP authentication. But…
• We can’t move LDAP server to Public Cloud(security reason)
• Cloud Foundry can’t access LDAP server directly.
Developer
Our company
Source Code Management
PaaS
Developer
Developer
LDAP
drone
CI/CD
NG
Public IaaS
© Hitachi Solutions, Ltd. 2016. All rights reserved. 9
Developer
Our company
Source Code Management
PaaS
Developer
Developer
LDAP
drone
CI/CD
We solved this problem using SAML by IDP server
How to integrate LDAP authentication over proxy?
Public IaaS
© Hitachi Solutions, Ltd. 2016. All rights reserved.
Cloud Foundry login sequence with SAML provider
10
developer OpenAM UAALDAP
1. Run “cf login --sso” and it requires one time token from uaa.
2. When I access uaa, redirect to IDP server.
3. When I authenticate LDAP user, IDP returns SAML token.
4. I get one time token from uaa, and “cf login” is successful.
Run “cf login --sso”
Access https://login.xxxxxxxxxxxxxxx.com/passcode
Redirect to IDP server
Access Login page and insert ID/Password
Authenticate
Success
Post SAML token to UAA
Returns one time token
Insert one time token and authenticate
Returns SAML Token
© Hitachi Solutions, Ltd. 2016. All rights reserved.
Case 2: “cf push” and “cf logs”
11
© Hitachi Solutions, Ltd. 2016. All rights reserved.
How to get stream logs via WebSocket over proxy?
12
“cf push/logs” does not work fine when over proxy.
• Failed to get stream logs from doppler via WebSocket
• Failed to proxy authentication
• This problem was reported cf-cli issues#127 about 1 year ago
WEBSOCKET REQUEST: [2016-09-02T12:43:56+09:00]
GET /apps/a1dfce70-2517-4dab-bb3e-a79c15cc2ab1/stream HTTP/1.1
Host: wss://doppler.xxxxxxxxxxxxxxxxxxxxxx.com:443
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: [HIDDEN]
Origin: http://localhost
Authorization: [PRIVATE DATA HIDDEN]
失敗
Error dialing traffic controller server: Proxy Authentication Required.
Please ask your Cloud Foundry Operator to check the platform configuration (traffic controller
is wss://doppler.xxxxxxxxxxxxxxxxxxxxxx.com:443).
© Hitachi Solutions, Ltd. 2016. All rights reserved.
How to get stream logs via WebSocket over proxy?
13
We have found this problem.
• Noaa is not supported proxy credentials
• We created a patch and send to Cloud Foundry committer
• In current version, this problem is fixed. (Thanks Gwenn!)
https://github.com/cloudfoundry/cli/releases/tag/v6.22.0
© Hitachi Solutions, Ltd. 2016. All rights reserved.
Case 3: “cf ssh”
14
© Hitachi Solutions, Ltd. 2016. All rights reserved.
How to connect Cloud Foundry via SSH over proxy?
15
“cf ssh” does not work fine in our environment.
• We can not connect external DNS directly
• We can not resolve hostname
• Even if we can resolve hostname, Proxy blocks SSH connection
% cf ssh sample-application
FAILED
Error opening SSH connection: dial tcp: lookup ssh.xxxxxxxxxxxxxx.com on 127.0.1.1:53: no
such host
© Hitachi Solutions, Ltd. 2016. All rights reserved.
How to connect Cloud Foundry via SSH over proxy?
16
1. Write hostname and IP address in /etc/hosts.
2. Get app guid by “cf app --guid”
% cf app sample-application --guid
14ed7f28-289a-4134-8ba0-e6535f733714
3. Write SSH configuration in .ssh/config.
Host sample-application
HostName ssh.xxxxxxxxxxxxxx.com
User cf:14ed7f28-289a-4134-8ba0-e6535f733714/0 # cf:$(cf app app-name --guid)/0
Port 2222
ProxyCommand connect -H ($LDAP_ID)@proxy.xxxxxxxxxxxxxx.co.jp:8080 %h %p
4. Get one time token by “cf ssh-code”.
% cf ssh-code
4MhakB
5. Run ssh command with proxy password and one time token
% ssh sample-application
Enter proxy authentication password for ($LDAP_ID)@proxy.xxxxxxxxxxxxxx.co.jp: -> Enter LDAP
password
The authenticity of host '[ssh.xxxxxxxxxxxxxx.com]:2222 (<no hostip for proxy command>)' can't be
established.
RSA key fingerprint is a6:d1:08:0b:b0:cb:9b:5f:c4:ba:44:2a:97:26:19:8a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[ssh.xxxxxxxxxxxxxx.com]:2222' (RSA) to the list of known hosts.
This is important to connect SSH over proxy.
© Hitachi Solutions, Ltd. 2016. All rights reserved.
How to connect Cloud Foundry via SSH over proxy?
17
1. Write hostname and IP address in /etc/hosts.
2. Get app guid by “cf app --guid”
% cf app sample-application --guid
14ed7f28-289a-4134-8ba0-e6535f733714
3. Write SSH configuration in .ssh/config.
Host sample-application
HostName ssh.xxxxxxxxxxxxxx.com
User cf:14ed7f28-289a-4134-8ba0-e6535f733714/0 # cf:$(cf app app-name --guid)/0
Port 2222
ProxyCommand connect -H ($LDAP_ID)@proxy.xxxxxxxxxxxxxx.co.jp:8080 %h %p
4. Get one time token by “cf ssh-code”.
% cf ssh-code
4MhakB
5. Run ssh command with proxy password and one time token
% ssh sample-application
Enter proxy authentication password for ($LDAP_ID)@proxy.xxxxxxxxxxxxxx.co.jp: -> Enter LDAP
password
The authenticity of host '[ssh.xxxxxxxxxxxxxx.com]:2222 (<no hostip for proxy command>)' can't be
established.
RSA key fingerprint is a6:d1:08:0b:b0:cb:9b:5f:c4:ba:44:2a:97:26:19:8a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[ssh.xxxxxxxxxxxxxx.com]:2222' (RSA) to the list of known hosts.
This is important to connect SSH over proxy.
It’s so crazy!
© Hitachi Solutions, Ltd. 2016. All rights reserved.
We are considering more simple solution
18
We will set up terminal on docker container.
• We can access terminal via WebSocket over proxy.
• Run “cf ssh” on docker container.
Developer
Our company
Source Code Management
PaaS
Developer
Developer
LDAP
drone
CI/CD
Docker Cluster
cf sshWebSocket
Public IaaS
© Hitachi Solutions, Ltd. 2016. All rights reserved.
Trademarks
19
• Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc in the
United States and/or other countries.
• Drone is either trademarks or registrered trademarks of Drone.io in the United States and/or
other countries.
• GitLab is either trademarks or registered trademarks of GITLAB BV CORPORATION in the
United States and/or other countries.
• OpenAM is registered trademarks of Open Source Solution Technology Corporation.
• Cloud Foundry is either trademarks or registered trademarks of Pivotal Software, Inc. in the
United States, Japan and/or other countries.
Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the Proxy

More Related Content

PPTX
Everyday life with Cloud Foundry in a big organization (Cloud Foundry Days To...
PDF
Cloud Foundry Introduction for CF Meetup Tokyo March 2016
PDF
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
PPTX
Building Developer Pipelines with PKS, Harbor, Clair, and Concourse
PDF
Open shift 4-update
PPTX
Cloud Foundry Roadmap Update - OSCON - May 2017
PDF
Run your Java code on Cloud Foundry
PDF
Devops: Enabled Through a Recasting of Operational Roles
Everyday life with Cloud Foundry in a big organization (Cloud Foundry Days To...
Cloud Foundry Introduction for CF Meetup Tokyo March 2016
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
Building Developer Pipelines with PKS, Harbor, Clair, and Concourse
Open shift 4-update
Cloud Foundry Roadmap Update - OSCON - May 2017
Run your Java code on Cloud Foundry
Devops: Enabled Through a Recasting of Operational Roles

What's hot (20)

ODP
OpenShift Enterprise
PDF
A DevOps guide to Kubernetes
ODP
DevOps @ OpenShift Online
PDF
Introduction into Cloud Foundry and Bosh | anynines
PDF
Part 3: Enabling Continuous Delivery (Pivotal Cloud Platform Roadshow)
PDF
Red Hat OpenShift on Bare Metal and Containerized Storage
PPTX
Cloud Foundry Deployment Tools: BOSH vs Juju Charms
PDF
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
ODP
OpenShift PaaS Anywhere (Infrastructure.Next Ghent 2014-02-24) Diane Mueller
PPTX
Successful Patterns for running platforms
PDF
Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...
PPTX
Kubernetes day 2 Operations
PDF
Open shift 4 infra deep dive
PDF
Openshift YARN - strata 2014
PDF
Continuous Delivery & Integration with JBoss Fuse on Openshift
PPTX
A year with Cloud Foundry and BOSH
PDF
Cloud Foundry BOSH CPI for OpenStack
PDF
Red Hat OpenShift V3 Overview and Deep Dive
PDF
OpenShift on OpenStack
PPTX
Application Modernization with PKS / Kubernetes
OpenShift Enterprise
A DevOps guide to Kubernetes
DevOps @ OpenShift Online
Introduction into Cloud Foundry and Bosh | anynines
Part 3: Enabling Continuous Delivery (Pivotal Cloud Platform Roadshow)
Red Hat OpenShift on Bare Metal and Containerized Storage
Cloud Foundry Deployment Tools: BOSH vs Juju Charms
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
OpenShift PaaS Anywhere (Infrastructure.Next Ghent 2014-02-24) Diane Mueller
Successful Patterns for running platforms
Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...
Kubernetes day 2 Operations
Open shift 4 infra deep dive
Openshift YARN - strata 2014
Continuous Delivery & Integration with JBoss Fuse on Openshift
A year with Cloud Foundry and BOSH
Cloud Foundry BOSH CPI for OpenStack
Red Hat OpenShift V3 Overview and Deep Dive
OpenShift on OpenStack
Application Modernization with PKS / Kubernetes
Ad

Viewers also liked (20)

PDF
Short Lived Tasks in Cloud Foundry #cfdtokyo
PDF
Cloud Foundryで学ぶ、PaaSのしくみ講座
PDF
今年のOss業界10大ニュース
PDF
161118 tistudy open_stack summit(barcelona)報告会_インプレス河原
PPTX
OpenStack summit report 2016 in barcelona
PDF
OpenStack Summit Report
PDF
Is spark streaming based on reactive streams?
PDF
データ活用を推進する「Pivotal HDB(Apache HAWQ(ホーク))」
PDF
Introduction to Hortonworks Data Cloud for AWS
PPTX
Open stack ptg-forum
PPTX
サーバーの脆弱性管理に関して(OpenStack + Vuls) - OpenStack最新情報セミナー(2016年12月)
PDF
Ceph Performance on OpenStack - Barcelona Summit
PDF
クラウド運用のベストプラクティスを考える - OpenStack最新情報セミナー(2016年12月)
PDF
Doma SQLテンプレートのしくみ
PPTX
Bare Metal Provisioning for Big Data - OpenStack最新情報セミナー(2016年12月)
PPTX
How logging makes a private cloud a better cloud - OpenStack最新情報セミナー(2016年12月)
PPTX
Cloud Foundry varz
PDF
たまにはOpenShiftも触ってみよう
PPTX
NTTドコモ様 導入事例 OpenStack Summit 2016 Barcelona 講演「Expanding and Deepening NTT D...
PDF
Awsでつくるapache kafkaといろんな悩み
Short Lived Tasks in Cloud Foundry #cfdtokyo
Cloud Foundryで学ぶ、PaaSのしくみ講座
今年のOss業界10大ニュース
161118 tistudy open_stack summit(barcelona)報告会_インプレス河原
OpenStack summit report 2016 in barcelona
OpenStack Summit Report
Is spark streaming based on reactive streams?
データ活用を推進する「Pivotal HDB(Apache HAWQ(ホーク))」
Introduction to Hortonworks Data Cloud for AWS
Open stack ptg-forum
サーバーの脆弱性管理に関して(OpenStack + Vuls) - OpenStack最新情報セミナー(2016年12月)
Ceph Performance on OpenStack - Barcelona Summit
クラウド運用のベストプラクティスを考える - OpenStack最新情報セミナー(2016年12月)
Doma SQLテンプレートのしくみ
Bare Metal Provisioning for Big Data - OpenStack最新情報セミナー(2016年12月)
How logging makes a private cloud a better cloud - OpenStack最新情報セミナー(2016年12月)
Cloud Foundry varz
たまにはOpenShiftも触ってみよう
NTTドコモ様 導入事例 OpenStack Summit 2016 Barcelona 講演「Expanding and Deepening NTT D...
Awsでつくるapache kafkaといろんな悩み
Ad

Similar to Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the Proxy (20)

PPTX
Inside Sqale's Backend at YAPC::Asia Tokyo 2012
PPTX
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
PDF
Importance of sshfp and configuring sshfp for network devices
PDF
Importance of SSHFP for Network Devices
PPT
SmartCloud Enterprise: Using a SOCKS Proxy with VLANs
PDF
Advanced open ssh
PPTX
Inside Sqale's Backend at RubyConf Taiwan 2012
PDF
Defeating The Network Security Infrastructure V1.0
PDF
Baidu cloudfoundry english
PDF
Information System Security
PDF
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
PDF
Continuous Delivery: The Next Frontier
PDF
quickguide-einnovator-4-cloudfoundry
PDF
February EPD Webinar: How do I...use PiCloud for cloud computing?
PPT
Netkitmig
PDF
Python on Cloud Foundry
PDF
ENHANCING PERFORMANCE OF AN HPC CLUSTER BY ADOPTING NONDEDICATED NODES
PDF
PDF
Working in the multi-cloud with libcloud
PPT
Bh usa-01-kaminsky
Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Importance of sshfp and configuring sshfp for network devices
Importance of SSHFP for Network Devices
SmartCloud Enterprise: Using a SOCKS Proxy with VLANs
Advanced open ssh
Inside Sqale's Backend at RubyConf Taiwan 2012
Defeating The Network Security Infrastructure V1.0
Baidu cloudfoundry english
Information System Security
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
Continuous Delivery: The Next Frontier
quickguide-einnovator-4-cloudfoundry
February EPD Webinar: How do I...use PiCloud for cloud computing?
Netkitmig
Python on Cloud Foundry
ENHANCING PERFORMANCE OF AN HPC CLUSTER BY ADOPTING NONDEDICATED NODES
Working in the multi-cloud with libcloud
Bh usa-01-kaminsky

More from Maki Toshio (11)

PDF
Rails 6.1 → 7.0アップデート記録
PDF
自社サービスのAPIをOAuth2対応にして公開した
PDF
Searched gems which supports only ruby 2.6
PPTX
ActiveRecordで複雑なクエリを書くのは間違っているのか
PPTX
やさしいGemパッチの作り方
PPTX
ファイルシステムのスナップショット機能でバックアップを取得する
PDF
メール製品を作って気づいたmailライブラリの光と闇について語る
KEY
明日から使える(?)Rubyトリビア
ZIP
Rubyで簡単にremote access apiを実行する
ZIP
レガシーコード改善ガイド
PPT
Ruby on rails on hudsonの活用事例
Rails 6.1 → 7.0アップデート記録
自社サービスのAPIをOAuth2対応にして公開した
Searched gems which supports only ruby 2.6
ActiveRecordで複雑なクエリを書くのは間違っているのか
やさしいGemパッチの作り方
ファイルシステムのスナップショット機能でバックアップを取得する
メール製品を作って気づいたmailライブラリの光と闇について語る
明日から使える(?)Rubyトリビア
Rubyで簡単にremote access apiを実行する
レガシーコード改善ガイド
Ruby on rails on hudsonの活用事例

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Approach and Philosophy of On baking technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPT
Teaching material agriculture food technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25 Week I
Approach and Philosophy of On baking technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Encapsulation_ Review paper, used for researhc scholars
Reach Out and Touch Someone: Haptics and Empathic Computing
The Rise and Fall of 3GPP – Time for a Sabbatical?
Unlocking AI with Model Context Protocol (MCP)
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
“AI and Expert System Decision Support & Business Intelligence Systems”
Teaching material agriculture food technology
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the Proxy

  • 1. © Hitachi Solutions, Ltd. 2016. All rights reserved. Hitachi Solutions Ltd., 2016/11/11 Toshio Maki Cloud Foundry over the Proxy
  • 2. © Hitachi Solutions, Ltd. 2016. All rights reserved. Toshio Maki / Hitachi Solutions Ltd., Working at R&D division Our missions are • Technical assistance • Software productivity improvement • Develop and operate our platform I started Cloud Foundry at Jan 2016. (In our company, we started researching from April 2015.) 1 About me
  • 3. © Hitachi Solutions, Ltd. 2016. All rights reserved. Our platform 2 We are building DevOps platform on Public Cloud. • Limit access only our network (not VPN) • Permit only HTTPS protocol Developer Our company Source Code Management PaaS Developer Developer LDAP drone CI/CD Public IaaS
  • 4. © Hitachi Solutions, Ltd. 2016. All rights reserved. Our platform 3 We are building DevOps platform on Public Cloud. • Limit access only our network (not VPN) • Permit only HTTPS protocol • Our accesses are restricted by Proxy with LDAP authentication Developer Our company Source Code Management PaaS Developer Developer LDAP drone CI/CD Public IaaS
  • 5. © Hitachi Solutions, Ltd. 2016. All rights reserved. Our problems are… 4 How to integrate Cloud Foundry over proxy?
  • 6. © Hitachi Solutions, Ltd. 2016. All rights reserved. Case 1: “cf login” 5
  • 7. © Hitachi Solutions, Ltd. 2016. All rights reserved. How to integrate LDAP authentication over proxy? 6 We would like to use LDAP authentication. But… Developer Our company Source Code Management PaaS Developer Developer LDAP drone CI/CD Public IaaS
  • 8. © Hitachi Solutions, Ltd. 2016. All rights reserved. How to integrate LDAP authentication over proxy? 7 We would like to use LDAP authentication. But… • We can’t move LDAP server to Public Cloud(security reason) Developer Our company Source Code Management PaaS Developer Developer LDAP drone CI/CD Public IaaS
  • 9. © Hitachi Solutions, Ltd. 2016. All rights reserved. How to integrate LDAP authentication over proxy? 8 We would like to use LDAP authentication. But… • We can’t move LDAP server to Public Cloud(security reason) • Cloud Foundry can’t access LDAP server directly. Developer Our company Source Code Management PaaS Developer Developer LDAP drone CI/CD NG Public IaaS
  • 10. © Hitachi Solutions, Ltd. 2016. All rights reserved. 9 Developer Our company Source Code Management PaaS Developer Developer LDAP drone CI/CD We solved this problem using SAML by IDP server How to integrate LDAP authentication over proxy? Public IaaS
  • 11. © Hitachi Solutions, Ltd. 2016. All rights reserved. Cloud Foundry login sequence with SAML provider 10 developer OpenAM UAALDAP 1. Run “cf login --sso” and it requires one time token from uaa. 2. When I access uaa, redirect to IDP server. 3. When I authenticate LDAP user, IDP returns SAML token. 4. I get one time token from uaa, and “cf login” is successful. Run “cf login --sso” Access https://login.xxxxxxxxxxxxxxx.com/passcode Redirect to IDP server Access Login page and insert ID/Password Authenticate Success Post SAML token to UAA Returns one time token Insert one time token and authenticate Returns SAML Token
  • 12. © Hitachi Solutions, Ltd. 2016. All rights reserved. Case 2: “cf push” and “cf logs” 11
  • 13. © Hitachi Solutions, Ltd. 2016. All rights reserved. How to get stream logs via WebSocket over proxy? 12 “cf push/logs” does not work fine when over proxy. • Failed to get stream logs from doppler via WebSocket • Failed to proxy authentication • This problem was reported cf-cli issues#127 about 1 year ago WEBSOCKET REQUEST: [2016-09-02T12:43:56+09:00] GET /apps/a1dfce70-2517-4dab-bb3e-a79c15cc2ab1/stream HTTP/1.1 Host: wss://doppler.xxxxxxxxxxxxxxxxxxxxxx.com:443 Upgrade: websocket Connection: Upgrade Sec-WebSocket-Version: 13 Sec-WebSocket-Key: [HIDDEN] Origin: http://localhost Authorization: [PRIVATE DATA HIDDEN] 失敗 Error dialing traffic controller server: Proxy Authentication Required. Please ask your Cloud Foundry Operator to check the platform configuration (traffic controller is wss://doppler.xxxxxxxxxxxxxxxxxxxxxx.com:443).
  • 14. © Hitachi Solutions, Ltd. 2016. All rights reserved. How to get stream logs via WebSocket over proxy? 13 We have found this problem. • Noaa is not supported proxy credentials • We created a patch and send to Cloud Foundry committer • In current version, this problem is fixed. (Thanks Gwenn!) https://github.com/cloudfoundry/cli/releases/tag/v6.22.0
  • 15. © Hitachi Solutions, Ltd. 2016. All rights reserved. Case 3: “cf ssh” 14
  • 16. © Hitachi Solutions, Ltd. 2016. All rights reserved. How to connect Cloud Foundry via SSH over proxy? 15 “cf ssh” does not work fine in our environment. • We can not connect external DNS directly • We can not resolve hostname • Even if we can resolve hostname, Proxy blocks SSH connection % cf ssh sample-application FAILED Error opening SSH connection: dial tcp: lookup ssh.xxxxxxxxxxxxxx.com on 127.0.1.1:53: no such host
  • 17. © Hitachi Solutions, Ltd. 2016. All rights reserved. How to connect Cloud Foundry via SSH over proxy? 16 1. Write hostname and IP address in /etc/hosts. 2. Get app guid by “cf app --guid” % cf app sample-application --guid 14ed7f28-289a-4134-8ba0-e6535f733714 3. Write SSH configuration in .ssh/config. Host sample-application HostName ssh.xxxxxxxxxxxxxx.com User cf:14ed7f28-289a-4134-8ba0-e6535f733714/0 # cf:$(cf app app-name --guid)/0 Port 2222 ProxyCommand connect -H ($LDAP_ID)@proxy.xxxxxxxxxxxxxx.co.jp:8080 %h %p 4. Get one time token by “cf ssh-code”. % cf ssh-code 4MhakB 5. Run ssh command with proxy password and one time token % ssh sample-application Enter proxy authentication password for ($LDAP_ID)@proxy.xxxxxxxxxxxxxx.co.jp: -> Enter LDAP password The authenticity of host '[ssh.xxxxxxxxxxxxxx.com]:2222 (<no hostip for proxy command>)' can't be established. RSA key fingerprint is a6:d1:08:0b:b0:cb:9b:5f:c4:ba:44:2a:97:26:19:8a. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[ssh.xxxxxxxxxxxxxx.com]:2222' (RSA) to the list of known hosts. This is important to connect SSH over proxy.
  • 18. © Hitachi Solutions, Ltd. 2016. All rights reserved. How to connect Cloud Foundry via SSH over proxy? 17 1. Write hostname and IP address in /etc/hosts. 2. Get app guid by “cf app --guid” % cf app sample-application --guid 14ed7f28-289a-4134-8ba0-e6535f733714 3. Write SSH configuration in .ssh/config. Host sample-application HostName ssh.xxxxxxxxxxxxxx.com User cf:14ed7f28-289a-4134-8ba0-e6535f733714/0 # cf:$(cf app app-name --guid)/0 Port 2222 ProxyCommand connect -H ($LDAP_ID)@proxy.xxxxxxxxxxxxxx.co.jp:8080 %h %p 4. Get one time token by “cf ssh-code”. % cf ssh-code 4MhakB 5. Run ssh command with proxy password and one time token % ssh sample-application Enter proxy authentication password for ($LDAP_ID)@proxy.xxxxxxxxxxxxxx.co.jp: -> Enter LDAP password The authenticity of host '[ssh.xxxxxxxxxxxxxx.com]:2222 (<no hostip for proxy command>)' can't be established. RSA key fingerprint is a6:d1:08:0b:b0:cb:9b:5f:c4:ba:44:2a:97:26:19:8a. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[ssh.xxxxxxxxxxxxxx.com]:2222' (RSA) to the list of known hosts. This is important to connect SSH over proxy. It’s so crazy!
  • 19. © Hitachi Solutions, Ltd. 2016. All rights reserved. We are considering more simple solution 18 We will set up terminal on docker container. • We can access terminal via WebSocket over proxy. • Run “cf ssh” on docker container. Developer Our company Source Code Management PaaS Developer Developer LDAP drone CI/CD Docker Cluster cf sshWebSocket Public IaaS
  • 20. © Hitachi Solutions, Ltd. 2016. All rights reserved. Trademarks 19 • Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc in the United States and/or other countries. • Drone is either trademarks or registrered trademarks of Drone.io in the United States and/or other countries. • GitLab is either trademarks or registered trademarks of GITLAB BV CORPORATION in the United States and/or other countries. • OpenAM is registered trademarks of Open Source Solution Technology Corporation. • Cloud Foundry is either trademarks or registered trademarks of Pivotal Software, Inc. in the United States, Japan and/or other countries.