40

堅牢性を高めるためのInfrastructure as Code

Embed Size (px)

Citation preview

Page 1: 堅牢性を高めるためのInfrastructure as Code
Page 2: 堅牢性を高めるためのInfrastructure as Code

{

“名前” : “真壁徹(まかべ とおる)”,

“所属” : “日本マイクロソフト株式会社”,

“役割” : “クラウド ソリューションアーキテクト”,

“経歴” : “大和総研 HP Enterprise”,

“特技” : [ “クラウド”, “OSS”, “ビール” ]

}

Page 3: 堅牢性を高めるためのInfrastructure as Code

「このクラウドに載るシステムは

非常に重要であるため

プロビジョニング申請受領後

Hardeningなどの作業に

3営業日を要します」

Page 4: 堅牢性を高めるためのInfrastructure as Code

むしろ「脆い」かもしれない

Page 5: 堅牢性を高めるためのInfrastructure as Code
Page 6: 堅牢性を高めるためのInfrastructure as Code
Page 7: 堅牢性を高めるためのInfrastructure as Code

{ "$schema":

"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",

"contentVersion": "1.0.0.0","parameters": { "adminUsername":

{ "type": "string", "defaultValue": "azureuser", "metadata": { "description": "User name for the Virtual Machine." } }…

- hosts: webserversvars: http_port: 80max_clients: 200remote_user: roottasks:- name: ensure apache is at the latest

versionyum: name=httpd state=latest

- name: write the apache config file template: src=/srv/httpd.j2…

「実現したい環境」をコードにできる -> 技術者の働き方が変わる

GUIがうれしいのは

3回目まで

Page 8: 堅牢性を高めるためのInfrastructure as Code
Page 9: 堅牢性を高めるためのInfrastructure as Code
Page 10: 堅牢性を高めるためのInfrastructure as Code

バージョニング、テスト、コラボレーション、etc

みなが専門家ではないので、楽に適用できるようにする

「実環境はコードの通りです」

うちのシステムはどっちかって言うと「守り」モードなんですよね

えっ、守りにも効くんすか

Page 11: 堅牢性を高めるためのInfrastructure as Code
Page 12: 堅牢性を高めるためのInfrastructure as Code
Page 13: 堅牢性を高めるためのInfrastructure as Code
Page 14: 堅牢性を高めるためのInfrastructure as Code

いやもうほんと、ちょっとだけですから

勇気をもって、システムに任せましょう

• 変更作業は必ず自動化ツール経由で

• まず開発・検証環境やPoCで自信をつける

Page 15: 堅牢性を高めるためのInfrastructure as Code

システムA システムB システムC

共通インフラチーム

http://slide.meguro.ryuzee.com/slides/75

Page 16: 堅牢性を高めるためのInfrastructure as Code

Dynamic Static

Page 17: 堅牢性を高めるためのInfrastructure as Code

Frontend subnet

Backend Subnet踏み台 Subnet

resource "azurerm_network_security_rule" "frontend_web80" {

name = "frontend_web80“

priority = 100

direction = "Inbound"

access = "Allow“

protocol = "Tcp"

source_port_range = "*"

destination_port_range = "80"

…VPN

Gateway

Page 18: 堅牢性を高めるためのInfrastructure as Code
Page 19: 堅牢性を高めるためのInfrastructure as Code
Page 20: 堅牢性を高めるためのInfrastructure as Code
Page 21: 堅牢性を高めるためのInfrastructure as Code
Page 22: 堅牢性を高めるためのInfrastructure as Code
Page 23: 堅牢性を高めるためのInfrastructure as Code
Page 24: 堅牢性を高めるためのInfrastructure as Code

Dynamic Resources

DatastoreLogging&AnalyticsService

Datastore

Static Resources

Page 25: 堅牢性を高めるためのInfrastructure as Code
Page 26: 堅牢性を高めるためのInfrastructure as Code

ToolsAzure

Dynamic Static Utilities

Code

PowerShell/Azure CLI

Terraform

Packer

Ansible

(ローカル/オンプレミス/Azure VMを要件に合わせて選択) (オンプレミス

/AzureのVMにGitlabなどを配置してもよい)

Jenkins

Page 27: 堅牢性を高めるためのInfrastructure as Code

PowerShell/Azure CLI

https://channel9.msdn.com/Events/de-code/2016/INF-011

Page 28: 堅牢性を高めるためのInfrastructure as Code

Packer

https://www.packer.io/docs/

Ansible

Page 29: 堅牢性を高めるためのInfrastructure as Code

https://www.terraform.io/docs/index.html

Dynamic & Static

Resources

Terraform

Page 30: 堅牢性を高めるためのInfrastructure as Code
Page 31: 堅牢性を高めるためのInfrastructure as Code
Page 32: 堅牢性を高めるためのInfrastructure as Code

リソースにアクセスできる Active Directory アプリケーションを作成するhttps://azure.microsoft.com/ja-jp/documentation/articles/resource-group-authenticate-service-principal/

Page 33: 堅牢性を高めるためのInfrastructure as Code

http://torumakabe.github.io/post/azure_auditlog_alert/

カジュアルにVMでも作ってみよう

あー、エージェント入れるの、めんどくせー

監査ログアラート

Azure Automation

例: OMS(ログ管理エージェントの導入)

Page 34: 堅牢性を高めるためのInfrastructure as Code

https://azure.microsoft.com/ja-jp/documentation/articles/role-based-access-control-what-is/

Page 35: 堅牢性を高めるためのInfrastructure as Code

http://torumakabe.github.io/post/azure_cli_resourcepolicy/

気分転換に欧州でGシリーズを起動してみよう

あれっ

Page 36: 堅牢性を高めるためのInfrastructure as Code
Page 37: 堅牢性を高めるためのInfrastructure as Code

Jackie Stewart, the Formula 1 racing legend

これまで培ったインフラの知識は、クラウドでも無駄になりません。むしろ武器です。

Page 38: 堅牢性を高めるためのInfrastructure as Code
Page 39: 堅牢性を高めるためのInfrastructure as Code

“Infrastructure as Code”

(O’Reilly Media, June 2016)概念の整理と言葉使いで、とても参考になりました

Page 40: 堅牢性を高めるためのInfrastructure as Code