SlideShare une entreprise Scribd logo
1  sur  100
Télécharger pour lire hors ligne
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
アマゾン ウェブ サービス ジャパン株式会社
ソリューションアーキテクト 大村幸敬
2018/07/25
【AWS Black Belt Online Seminar】
AWS Systems Manager
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
大村 幸敬 (おおむら ゆきたか)
• インダストリソリューション部
• ソリューションアーキテクト
• エンタープライズのお客さまを担当
Management Tools & DevOps 系サービスを担当
• 好きなAWSのサービス:AWS CLI
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
内容についての注意点
• 本資料では2018年07月25日時点のサービス内容および価格についてご説明しています。最新の情報
はAWS公式ウェブサイト(https://aws.amazon.com)にてご確認ください
• 資料作成には十分注意しておりますが、資料内の価格とAWS公式ウェブサイト記載の価格に相違が
あった場合、AWS公式ウェブサイトの価格を優先とさせていただきます
• 価格は税抜表記となっています。日本居住者のお客様が東京リージョンを使用する場合、別途消費税
をご請求させていただきます
AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to change in accordance with the AWS Customer Agreement available
at http://aws.amazon.com/agreement/. Any pricing information included in this document is provided only as an estimate of usage charges for AWS services
based on certain information that you have provided. Monthly charges will be based on your actual use of AWS services, and may vary from the estimates
provided.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
Agenda
1. クラウドのサーバ運用
2. AWS Systems Managerの全体像
3. SSM利用の準備
4. タスク別SSMの使い方
1. サーバを設定する
2. 繰り返し作業の自動化
3. トラブルシューティング
4. サーバの構成検証・監査
5. パッチの適用
6. モニタリング&脆弱性チェック
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
クラウドのサーバ運用
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
サーバ運用におけるペットと家畜
• 家畜
• クラウド型の運用
• サーバを使い捨て可能
• Immutable
• テンプレートから同じ設定のサーバを作成
• ペット
• 従来型の運用
• サーバ1台1台に個性がある
• 構成管理
• 初期セットアップと設定変更
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
エンタープライズ企業のクラウドジャーニー
• 全てがクラウドネイティブではない
• 従来型の運用とクラウド型運用のハイブリッド
初期プロジェクト
基盤作り
移行
改革
クラウド・
ネイティブ
技術負債の
返済
価
値
期間
クラウドのメリットを活かせる
最適なアプリケーション開発を
行っていく
最初から、クラウドに適した
設計を導入しながら移行する
ハード老朽化対応、コスト削減
目的でクラウドへ単純移行する
まずクラウドへ移行した後で、
クラウド最適化を目指す
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
サーバ運用担当者の日常
• サーバOSを立ち上げ基本的な設定を投入
• アプリケーション稼働に必要なライブラリや設定を投入
• 設計上の値と実装値のズレを修正
• 手動タスクを繰り返し実施
• 定時外に呼び出されトラブルシュート
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
サーバの運用をこうしたい
• インスタンスの設定が正しく行われている
• ルールに準拠していないサーバを検出できる
• 手順書が集中管理されバージョン管理と共有が行われる
• 共通作業が自動化される
• 容易にトラブルシュートや問題事象の緩和ができる
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Systems Managerの全体像
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Systems Manager が提供するもの
ハイブリッド環境の管理
(EC2/オンプレミス)
クロスプラットフォーム
(Windows/Linux)
スケーラブルかつ監
査可能
セキュリティと
コンプライアンスの改善
繰り返しタスクを容
易に自動化
TCOの削減
(追加コスト不要)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Systems Manager によるサーバ運用
AWS cloud
data center
ドキュメント パラメータストア
オペレーション
定期運用
非定期・障害時運用
構成検証・監査
Run Command
Automationメンテナンスウィンドウ
インベントリステートマネージャー Patch Manager
Lambdaファンクション
Step Functions
マネジメントコンソール
AWS CLI
スケジューリング
構成情報・操作手順
AWS Config CloudWatch EventS3
S3
CloudWatchLogs
SNS
マネージドインスタンス
CloudWatch
メトリクス&ログ
Inspector
セキュリティ評価
CloudWach
Agent
Inspector
Agent
SSM
Agent
IAM
Role
サーバ運用
操作記録・通知
Athena&Quicksight
記録・通知・対応・分析 パラメータストアの参照
CFn CLI Lambda ECS
tag: xxx
tag: xxx
tag: yyy
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Systems Manager によるサーバ運用
AWS cloud
data center
ドキュメント パラメータストア
オペレーション
定期運用
非定期・障害時運用
構成検証・監査
Run Command
Automationメンテナンスウィンドウ
インベントリステートマネージャー Patch Manager
Lambdaファンクション
Step Functions
マネジメントコンソール
AWS CLI
スケジューリング
構成情報・操作手順
AWS Config CloudWatch EventS3
S3
CloudWatchLogs
SNS
マネージドインスタンス
CloudWatch
メトリクス&ログ
Inspector
セキュリティ評価
CloudWach
Agent
Inspector
Agent
SSM
Agent
IAM
Role
サーバ運用
操作記録・通知
Athena&Quicksight
記録・通知・対応・分析 パラメータストアの参照
CFn CLI Lambda ECS
tag: xxx
tag: xxx
tag: yyy
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Systems Manager によるサーバ運用
AWS cloud
data center
ドキュメント パラメータストア
オペレーション
定期運用
非定期・障害時運用
構成検証・監査
Run Command
Automationメンテナンスウィンドウ
インベントリステートマネージャー Patch Manager
Lambdaファンクション
Step Functions
マネジメントコンソール
AWS CLI
スケジューリング
構成情報・操作手順
AWS Config CloudWatch EventS3
S3
CloudWatchLogs
SNS
マネージドインスタンス
CloudWatch
メトリクス&ログ
Inspector
セキュリティ評価
CloudWach
Agent
Inspector
Agent
SSM
Agent
IAM
Role
サーバ運用
操作記録・通知
Athena&Quicksight
記録・通知・対応・分析 パラメータストアの参照
CFn CLI Lambda ECS
tag: xxx
tag: xxx
tag: yyy
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Systems Manager によるサーバ運用
AWS cloud
data center
ドキュメント パラメータストア
オペレーション
定期運用
非定期・障害時運用
構成検証・監査
Run Command
Automationメンテナンスウィンドウ
インベントリステートマネージャー Patch Manager
Lambdaファンクション
Step Functions
マネジメントコンソール
AWS CLI
スケジューリング
構成情報・操作手順
AWS Config CloudWatch EventS3
S3
CloudWatchLogs
SNS
マネージドインスタンス
CloudWatch
メトリクス&ログ
Inspector
セキュリティ評価
CloudWach
Agent
Inspector
Agent
SSM
Agent
IAM
Role
サーバ運用
操作記録・通知
Athena&Quicksight
記録・通知・対応・分析 パラメータストアの参照
CFn CLI Lambda ECS
tag: xxx
tag: xxx
tag: yyy
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Systems Manager によるサーバ運用
AWS cloud
data center
ドキュメント パラメータストア
オペレーション
定期運用
非定期・障害時運用
構成検証・監査
Run Command
Automationメンテナンスウィンドウ
インベントリステートマネージャー Patch Manager
Lambdaファンクション
Step Functions
マネジメントコンソール
AWS CLI
スケジューリング
構成情報・操作手順
AWS Config CloudWatch EventS3
S3
CloudWatchLogs
SNS
マネージドインスタンス
CloudWatch
メトリクス&ログ
Inspector
セキュリティ評価
CloudWach
Agent
Inspector
Agent
SSM
Agent
IAM
Role
サーバ運用
操作記録・通知
Athena&Quicksight
記録・通知・対応・分析 パラメータストアの参照
CFn CLI Lambda ECS
tag: xxx
tag: xxx
tag: yyy
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Systems Manager によるサーバ運用
AWS cloud
data center
ドキュメント パラメータストア
オペレーション
定期運用
非定期・障害時運用
構成検証・監査
Run Command
Automationメンテナンスウィンドウ
インベントリステートマネージャー Patch Manager
Lambdaファンクション
Step Functions
マネジメントコンソール
AWS CLI
スケジューリング
構成情報・操作手順
AWS Config CloudWatch EventS3
S3
CloudWatchLogs
SNS
マネージドインスタンス
CloudWatch
メトリクス&ログ
Inspector
セキュリティ評価
CloudWach
Agent
Inspector
Agent
SSM
Agent
IAM
Role
サーバ運用
操作記録・通知
Athena&Quicksight
記録・通知・対応・分析 パラメータストアの参照
CFn CLI Lambda ECS
tag: xxx
tag: xxx
tag: yyy
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Systems Manager サービス群
サービス名 概要
メンテナンスウィンドウ 定期的に行う管理作業やサービス停止の実施時間帯を定義する
Run Command 安全にインスタンス上の管理作業を実施する
SSHやRDPを使用せず多数のサーバを一括操作
Automation 一連の作業フローを定義する
パッチを適用してAMIを作成する、インスタンススペックを変更するなど
ステートマネージャー あるべきOSの設定値を定義し維持する
ポリシーに準拠したファイアウォール設定やアンチマルウェアツールの設定
インベントリ インストール済みソフトウェアの一覧を収集・検索する
Patch Manager OSパッチの選択と適用を自動的に実施する
ドキュメント Systems Managerの各サービスの挙動を定義する設定ドキュメント
コマンド、ポリシー、自動化の3種類がある
パラメータストア 設定値やパスワードなどを集中管理する階層型ストレージ
アクセス制御や他のサービスからの参照が容易に行える
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
コラム: AWS Systems Manager = SSM ?
2017年12月 re:Inventで「AWS Systems Manager」を発表
• クラウドとハイブリッドリソースを統合的に管理するサービスへ
• Amazon Simple Systems Managerまたは
Amazon EC2 Systems Manager は古い名称
• 現在もEC2管理画面にSystems
Manager Servicesや共有リソースの表
記がある
• 今後はAWS Systems Manager
コンソールがメイン
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM利用の準備
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
0. Systems ManagerがサポートするOS
• Windows Server
• Windows Server 2003 から Windows Server 2016(R2 バージョンを含む)
• Linux
• 64 ビットおよび 32 ビットシステム
• Amazon Linux 基本 AMI 2014.09、2014.03 以降
• Ubuntu Server 18.04 LTS、16.04 LTS、14.04 LTS、または 12.04 LTS
• Red Hat Enterprise Linux (RHEL) 6.5
• CentOS 6.3 以降
• 32 ビットシステムのみ
• Raspbian Jessie
• Raspbian Stretch
• 64 ビットシステムのみ
• Amazon Linux 2015.09、2015.03 以降
• Amazon Linux 2
• Red Hat Enterprise Linux (RHEL) 7.4
• CentOS 7.1 以降
• SUSE Linux Enterprise Server (SLES) 12 以上
2018/07/25 現在。最新情報はこちら: https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/systems-manager-prereqs.html
注:パッチマネージャはこれらすべてのバージョンをサポートしてはいません。詳細は以下を参照
https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/patch-manager-supported-oses.html
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
1. Systems Manager APIへのアクセス経路確保
• SSM AgentはSystems Manager APIを呼び出す
• 以下のいずれかのネットワークを構成する
1. インターネットへのアウトバウンドアクセス
• インバウンドアクセスは不要
• パブリックサブネットやNAT Gatewayを使用
2. VPC エンドポイントへのアクセス
• プライベートネットワークによる接続が可能
• インターフェイスエンドポイント
• com.amazonaws.region.ssm
• com.amazonaws.region.ec2messages
• com.amazonaws.region.ec2
• ゲートウェイエンドポイント
• S3
SSM
Agent
Systems
Manger
API
IAM Role
SSM
Agent
Systems
Manger
API
IAM Role
1. インターネット経由のアクセス
2. VPCエンドポイント経由のアクセス
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
2. IAM Roleの付与
Systems Manager APIを呼び出すためのインスタンスプロファイル
を作成してEC2にアタッチ
• IAM Roleを作成
• IAM ポリシー「AmazonEC2RoleforSSM」を割り当て
• Trusted EntityをEC2とする
(EC2にこのロールを付与できるようにする)
SSM
Agent
Systems
Manger
API
IAM
Role
IAM Policy
(AmazonEC2RoleforSS
M)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
3. SSM Agentの導入
サーバにSSM Agentを導入しサービスを起動
• 次のAMIはデフォルトでSSM Agent導入済み
• Windows Server
• Amazon Linux
• Amazon Linux2
• Ubuntu Server 18.04
• AgentのインストーラはS3に配置
https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/ssm-agent.html
• CloudWatch AgentやInspector Agentは後か
らSSMを使用してインストールすれば良い
SSM
Agent
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
ハイブリッド環境の設定
0. ハイブリッド環境用のIAM Roleを作成(初回のみ)
1. オンプレミスサーバにSSM Agentを導入
2. Systems Manager APIへのアクセス経路を確保
• DirectConnectやProxyによりVPCエンドポイントの利用も可能
3. SSMでアクティベーションコードを生成
4. インスタンスにアクティベーションコードを設定
ハイブリッド環境用の
IAMサービスロール
Systems
Manger API
アクティベーション
コードの設定
SSM
Agent Internet
アクティベーションコード
の作成
SSMサービスに対する
AssumeRoleを許可
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM利用の準備まとめ
• マネージドインスタンス
• SSM 管理下のサーバ
• オンプレミスサーバもEC2も同様に扱う
• 手順
0. Systems ManagerがサポートするOS
1. Systems Manager APIへのアクセス経路確保
2. IAM Roleの付与
3. SSM Agentの導入
• ハイブリッド環境(オンプレミスサーバ)も設定可
SSM
Agent
Systems
Manger
API
IAM Role
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク別SSMの使い方
1. サーバを設定する
2. 繰り返し作業の自動化
3. トラブルシューティング
4. サーバの構成検証・監査
5. パッチの適用
6. モニタリング&脆弱性チェック
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク1:サーバを設定する
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク1: サーバを設定する
• サーバの構成管理と設定
• よくある作業
• AutoScalingGroup内の全サーバを設定
• インスタンス起動時にドメインに参加
• インスタンスの構成をモニタリング
• SSMが提供するもの
• 設定をコードで記述する
• 初期設定を行う
• 継続的に設定値のズレを検出し通知及び修正する
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM ドキュメント
• Systems Manager の設定や操作を記述するために使用
• コマンドドキュメント(主にインスタンス上の操作)
• 自動化ドキュメント(AWS環境を含む一連の操作の定義)
• ポリシードキュメント(ステートマネージャーで使用)
• YAML/JSONで記述
• コードによる管理(編集、バージョン管理)
• パラメータの使用
• 他のアカウントへの共有
• AWSが提供する事前定義済みドキュメントあり
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
例:Ansible Playbookを実行するコマンドドキュメント
---
schemaVersion: "2.2"
description: "MyConfigurationAsCode"
mainSteps:
- action: "aws:runDocument"
name: "InstallApache"
inputs:
documentType: "SSMDocument"
documentPath: "arn:aws:ssm:us-west-1::document/InstallApache"
documentParameters: "{ }"
- action: "aws:downloadContent"
name: "AnsiblePlaybookfromGitHub"
inputs:
sourceType: "GitHub"
sourceInfo: "{¥"owner¥":¥“Amjad¥", ¥"repository¥":¥"MyPrivateRepo¥",¥"path¥"¥
:¥"documents/nginx.yml¥", ¥"tokenInfo¥":¥"{{ ssm-secure:MyAccessToken }}¥"}"
destinationPath: ""
- action: "aws:runShellScript"
name: "RunPlaybook"
inputs:
commands:
- "ansible-playbook -i ¥"localhost,¥" -c local nginx.yml"
Nested Document
Ansible Playbook を自分のGitHub
リポジトリからダウンロード
Ansible Playbookを実行
ドキュメントタイプに応じた適切なスキーマバージョンの指定
コマンド 2.2 / 自動化 0.3 / ポリシー 2.0以降
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSMの定義済みドキュメント(コマンドドキュメント - 1/3)
2018/07/25現在
名前 プラットフォーム
1 AWS-ApplyPatchBaseline Windows
2 AWS-ConfigureAWSPackage Windows Linux
3 AWS-ConfigureCloudWatch Windows
4 AWS-ConfigureDocker Windows Linux
5 AWS-ConfigureWindowsUpdate Windows
6 AWS-FindWindowsUpdates Windows
7 AWS-InstallApplication Windows
8 AWS-InstallMissingWindowsUpdates Windows
9 AWS-InstallPowerShellModule Windows
10 AWS-InstallSpecificWindowsUpdates Windows
11 AWS-InstallWindowsUpdates Windows
12 AWS-JoinDirectoryServiceDomain Windows
13 AWS-ListWindowsInventory Windows
14 AWS-RefreshAssociation Windows Linux
15 AWS-RunAnsiblePlaybook Linux
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSMの定義済みドキュメント(コマンドドキュメント - 2/3)
2018/07/25現在
名前 プラットフォーム
16 AWS-RunDockerAction Windows Linux
17 AWS-RunDocument Windows Linux
18 AWS-RunInspecChecks Windows Linux
19 AWS-RunPatchBaseline Windows Linux
20 AWS-RunPowerShellScript Windows Linux
21 AWS-RunRemoteScript Windows Linux
22 AWS-RunSaltState Linux
23 AWS-RunShellScript Linux
24 AWS-UpdateEC2Config Windows
25 AWS-UpdateSSMAgent Windows Linux
26 AWSSupport-RunEC2RescueForWindowsTool Windows
27 AmazonInspector-ManageAWSAgent Windows Linux
28 AWSEC2-CreateVssSnapshot Windows
29 AWSEC2-ManageVssIO Windows
30 AWSEC2-RunSysprep Windows
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSMの定義済みドキュメント(コマンドドキュメント - 3/3)
2018/07/25現在
名前 プラットフォーム
31 AmazonCloudWatch-ManageAgent Windows Linux
32 AmazonCloudWatch-MigrateCloudWatchAgent Windows
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSMの定義済みドキュメント(ポリシードキュメント)
名前 概要 プラットフォーム
AWS-GatherSoftwareInventory サーバ上のソフトウェア一覧情報を取得する Windows
Linux
2018/07/25現在
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSMの定義済みドキュメント(自動化ドキュメント - 1/3)
2018/07/25現在
名前 プラットフォーム
1 AWS-ASGEnterStandby Windows Linux
2 AWS-ASGExitStandby Windows Linux
3 AWS-AttachEBSVolume Windows Linux
4 AWS-AttachIAMToInstance Windows Linux
5 AWS-ConfigureCloudWatchOnEC2Instance Windows Linux
6 AWS-CopySnapshot Windows Linux
7 AWS-CreateManagedLinuxInstance Windows Linux
8 AWS-CreateManagedLinuxInstanceWithApproval Windows Linux
9 AWS-CreateManagedWindowsInstance Windows Linux
10 AWS-CreateManagedWindowsInstanceWithApproval Windows Linux
11 AWS-CreateSnapshot Windows Linux
12 AWS-DeleteCloudFormationStack Windows Linux
13 AWS-DeleteCloudFormationStackWithApproval Windows Linux
14 AWS-DeleteSnapshot Windows Linux
15 AWS-DetachEBSVolume Windows Linux
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSMの定義済みドキュメント(自動化ドキュメント - 2/3)
2018/07/25現在
名前 プラットフォーム
16 AWS-RebootRdsInstance Windows Linux
17 AWS-ResizeInstance Windows Linux
18 AWS-RestartEC2Instance Windows Linux
19 AWS-RestartEC2InstanceWithApproval Windows Linux
20 AWS-SetupInventory Windows Linux
21 AWS-SetupManagedInstance Windows Linux
22 AWS-SetupManagedRoleOnEc2Instance Windows Linux
23 AWS-StartEC2Instance Windows Linux
24 AWS-StartEC2InstanceWithApproval Windows Linux
25 AWS-StartRdsInstance Windows Linux
26 AWS-StopEC2Instance Windows Linux
27 AWS-StopEC2InstanceWithApproval Windows Linux
28 AWS-StopRdsInstance Windows Linux
29 AWS-TerminateEC2Instance Windows Linux
30 AWS-TerminateEC2InstanceWithApproval Windows Linux
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSMの定義済みドキュメント(自動化ドキュメント - 3/3)
2018/07/25現在
名前 プラットフォーム
31 AWS-UpdateCloudFormationStack Windows Linux
32 AWS-UpdateCloudFormationStackWithApproval Windows Linux
33 AWS-UpdateLinuxAmi Windows Linux
34 AWS-UpdateWindowsAmi Windows Linux
35 AWSSupport-ActivateWindowsWithAmazonLicense Windows Linux
36 AWSSupport-ExecuteEC2Rescue Windows Linux
37 AWSSupport-GrantPermissionsToIAMUser Windows Linux
38 AWSSupport-ManageRDPSettings Windows Linux
39 AWSSupport-ManageWindowsService Windows Linux
40 AWSSupport-ResetAccess Windows Linux
41 AWSSupport-SendLogBundleToS3Bucket Windows Linux
42 AWSSupport-TroubleshootRDP Windows Linux
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM ステートマネージャー
• サーバ群に対して定期的に処理を行うためのフレームワーク
• サーバの構成情報収集や設定の修正などの用途に向く
• サービス停止を伴う作業はメンテナンスウィンドウを使用
• 「関連付け (Association)」を作って次の3つを組合せ
• What: ターゲット (タグ or 個別指定)
• When: スケジュール (cron式など)
• How: SSMドキュメントで処理内容を指定
• 使用例
• Ansible Playbookの定期的な適用
• インベントリ情報の定期的な収集
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM ステートマネージャー
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM パラメータストア
• コンフィグレーションや設定値を
権限別の階層型で保存
• IAMによるアクセス制御
• AMI IDなどAWSが提供する値あり
• パスワードなど機密情報をKMSで暗号化
• CloudFormation, Lambda, ECS,
CodeBuild, CodeDeployなどのサービス
と統合済み
• 環境変数を渡す用途などに使用
No more plaintext secrets !
Dev Test Prod
App App App
/test/app/db_password /prod/app/db_password
email
notification
Rotate password
event
(event-based)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM Parameter Store 使用例
設定パラメータ用ストレージ
• 設定時に使用するDB接続情報などの保存に利用
aws ssm put-parameter --name /MySystem/Prod/DB/User --type String --value myuser
aws ssm get-parameter --name /MySystem/Prod/DB/User
{
"Parameter": {
"Name": "/MySystem/Dev/DB/User",
"Type": "String",
"Value": "ohmurayu",
"Version": 1
}
}
パラメータ設定
パラメータ取得
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM Parameter Store 使用例 (CloudFormation)
CFnテンプレートのParametersから直接利用可能
自身で設定した値を使用
AWSが提供する値を使用
Parameters:
MyAMIID:
Type : AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
Default: /aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-gp2
# Default: /aws/service/ami-windows-latest/Windows_Server-2016-English-Full-Base
注:SecureStringは2018/6/1時点で未対応
Parameters:
Env:
Type: AWS::SSM::Parameter::Value<String>
Default: /MySystem/Prod/DB/User
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
例:ステートマネージャーを使用した構成管理
• ステートマネージャーを使用して
インスタンス起動時に初期設定
• 定期的に設定を確認し、変更され
ていたら元の値に戻す
• AWS-RunAnsible
• Ansible Playbookの実行
• SSMインベントリとAWS Config
Rulesとの連携(後述)
• 設定の準拠状況をレポート
ステート
マネージャー
インスタンス群
https://aws.amazon.com/jp/blogs/mt/running-ansible-playbooks-using-ec2-systems-manager-run-command-and-state-manager/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
例:ステートマネージャーを使用した
インスタンスモニタリングの自動設定
• インスタンス起動時に
CloudWatchのモニタリング設
定を自動的に投入
• カスタムメトリクスによる
OS上のメトリクス監視
• CloudWatchLogsによる
OS上のログ監視
• 恒常的に設定を維持
• オンプレミス上のサーバも
同様に設定
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク2:繰り返し作業の自動化
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク2: 繰り返し作業の自動化
• 多くの運用作業は繰り返し行われる
• よくある作業
• ロードバランサー配下のサーバを
サービス無停止でメンナンス
• インスタンスの起動に承認が必要
• SSMが提供するもの
• 運用作業を自動化する柔軟な手法
• 作業を止め承認を待つためのワークフロー
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM Automation
• 手動かつ繰り返しの作業を自動化す
るためのフレームワーク
• 自動化ドキュメントは事前定義され
たものを使用するか独自に作成
• 処理を進めるために手動で承認の手
順を追加することが可能
• LambdaやRunCommandを使って
処理を拡張
Document
Run the automation
Role and
permission
input
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
承認手続きを含むAutomation
"parameters":{
...
"Approvers":{
"type":"StringList",
"description":"IAM or user ARN of approvers"
},
"mainSteps":[
{
"name":"approve",
"action":"aws:approve",
"timeoutSeconds":999999,
"onFailure":"Abort",
"inputs":{
"NotificationArn":"{{ SNSTopicArn }}",
"Message": "Your approval is required to proceed",
"MinRequiredApprovals":1,
"Approvers":[
"{{Approvers}}"
]
}
承認を求めるIAMユーザや
IAMロールのARNリスト
を
パラメータで定義
承認手続きの定義
パラメータの参照
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
メンテナンスウィンドウ
• サービス停止を伴うような操作を行う時間帯を定義し、
その時間帯に行う操作をスケジュールする
• 操作はターゲットとタスクの組み合わせで指定
• タスクタイプとして次の4種類が利用可能
• RunCommand、Automation、Lambda、StepFunction
• 複数の操作に優先順位をつけたりインスタンス群に対す
る並列実行レートの設定が可能
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
メンテナンスウィンドウ
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
メンテナンスウィンドウ
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
メンテナンスウィンドウ
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
例:繰り返し作業の自動化
ドキュメントによりAutomation/RunCommandいずれかを使用
• AWS-UpdateWindowsAmi
• AMIのメンテナンスとパッチ適用の自動化
• AWSEC2-CreateVssSnapshot
• VSSを有効化してEBSスナップショットを取得
• AWS-RunInSpecChecks SSM
• Chef InSpecの実行
https://aws.amazon.com/jp/blogs/news/streamline-ami-maintenance-and-patching-using-amazon-ec2-systems-manager-
automation/
https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/integration-vss.html
https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/integration-chef-inspec.html
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク3:トラブルシューティング
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク3: トラブルシューティング
• トラブルシューティングは不定期かつ複雑
• よくある作業
• ログを取集し調査コマンドを実行する
• 問題を安全な方法で修正する
• SSMが提供するもの
• インスタンス群に対して操作を行うシンプルかつ安全な方法
• 操作はカスタマイズ可能
• 定型化とパラメータ化によりオペミスを低減
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM RunCommand
• クロスプラットフォームの
リモート処理実行環境
• セキュアなOSオペレーション
• タグ及びIAMを使用したアクセス制御でOSのパスワード不
要
• RDPやSSHアクセスのためのインバウンドポート開放不要
• コマンドドキュメントを実行可能
• AWS-RunShellScriptなどで任意のコマンドも実行可能
• 柔軟な実行制御
• 同時実行及びエラーレート制御可能
• SNSで進捗を通知
• S3に実行ログを保存
• CLIコマンドの生成
• CloudWatchEventsのターゲットに指定可能
AWS cloud
corporate data
center
IT Admin,
DevOps Engineer
Role-based
Access Control
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM RunCommand
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM RunCommand
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM RunCommand
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
例: タグによるファイングレインアクセス制御
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ssm:SendCommand"
],
"Resource": "*",
"Condition": {
"StringLike": {
"ssm:resourceTag/tag_key": [
"tag_value"
]
}
}
aws ssm send-command
--document-name MyDoc
--targets
Key=tag:tag_key,Values=tag_value
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク4: サーバの構成検証・監査
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク4: サーバ構成情報の監査・検証
• サーバの構成情報を収集し分析する
• よくある作業
• サーバに導入したソフトウェアの一覧を作成
• 必須あるいは不要なソフトウェアの存在を検知して対応
• サーバ群の構成を分析
• SSMが提供するもの
• 統合されたインベントリ
• ルールの非準拠を検知して自動的に対応
• 大規模なインベントリに対する分析と可視化
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM インベントリ
• OS上のアプリケーション一覧など
構成情報を記録する
• ステートマネージャーで収集
• AWS Configに構成情報を送信
• ManagedInstanceInventoryと認識
• Config Rulesで準拠状況をチェック
• S3に構成情報を保存
• Athena&QuickSightで分析可能
• 複数アカウントの構成情報も検索可
AWS cloud
Corporate data
center
Amazon
Athena
Amazon
QuickSight
SSM インベントリ
(Amazon S3 data lake)
Custom
Analytic ToolAWS Config
AWS Config Rules
ステートマネージャー
が収集
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
例: ダッシュボード&カスタムインベントリの活用
• ダッシュボードの提供
• 定義済みタイプ
• アプリケーション、ネッ
トワーク構成、ファイル、
Windowsサーバ/ロール
• カスタムインベントリ
• ラック番号などを独自に
追加可能(現状 AWS
Configでは利用不可)
--------- Custom Inventory -----------
aws ssm put-inventory --instance-id "ID" -
-items '[{"CaptureTime": "2016-08-
22T10:01:01Z", "TypeName":
"Custom:RackInfo",
"Content":[{"RackLocation": "Bay B/Row
C/Rack D/Shelf E"}], "SchemaVersion":
"1.0"}]‘
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
例: QuickSightによる分析
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
例: ブラックリストにあるソフトウェア導入を検知
SSM Inventory
AWS Config
インベントリ
情報を記録
Blacklist 用の
AWS Config Rule
AWS Config Rule名 説明
ec2-managedinstance-applications-blacklisted
指定したアプリケーションのいずれもインスタンスにインストー
ルされていないことを確認します
ec2-managedinstance-applications-required
すべての指定したアプリケーションが、インスタンスにインス
トールされているかどうかを確認します
ec2-managedinstance-inventory-blacklisted
AWS Systems Manager が管理するインスタンスが、ブラック
リストに記載されたインベントリタイプを収集するように設定さ
れているかどうかを確認します(AWS:Network,
AWS:WindowsUpdateなど)
ec2-managedinstance-platform-check
EC2 マネージドインスタンスの設定が希望どおりであるかどうか
を確認します
CloudWatch Events &
Lambda
Systems Managerに関連する AWS Config Rules
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク5: パッチの適用
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク5: パッチの適用
• サーバのパッチレベルを適切な状態に維持する
• よくある作業
• サーバOSのパッチ運用ルールを策定
• 導入済みパッチを確認
• パッチの適用
• SSMが提供するもの
• パッチ適用ルール(ベースライン)の策定
• RunCommandを使用したパッチのスキャン及び適用
• ベースラインへの準拠状況のレポート
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM パッチマネージャー
• パッチルール準拠の確認&実施
• パッチ適用ルールの指定(ベースライン)
• 重要度、除外パッチ等を指定
• パッチの適用
• メンテナンスウィンドウと
コマンドドキュメントの使用
(Run-PatchBaseline)
• Scan機能によるレポーティング
• Zero Dayパッチの即時適用
Corp data
center
Patch Group =
DBServers
Patch Group =
WebServers
Patch Group = SQL
Cluster
DB Server
Patch Baseline
Web Server
Patch Baseline
Patch Manager
Maintenanc
e Window
Compliance
Notification
s!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
パッチベースライン FrondEnd
例:Windowsインスタンスへのパッチ適用
パッチベースライン BackEnd
PatchGroup=HR,
Batch
コマンドドキュメント
AWS-RunPatchBaseline 実行
パッチマネージャー
Microsoftから定期的に
wsusscn2.cab(セキュリティ
関連の更新情報)をダウンロード
メンテナンスウィンドウや
ステートマネージャーで
パッチ適用及びスキャンタイミングを指定
ターゲット
各インスタンスがどのパッチベースラインに従うかは
「Patch Group」タグ(固定)に指定されたグループ名で決まる
PatchGroup=Web
Tag:
PatchGroup=HR
Tag:
PatchGroup=Batch
Tag:
PatchGroup=Web
OS: Windows
製品:Windows Server 2016
分類:Security Update
重要度:Critical
自動承認の遅延:7日
承認済みパッチ:KB111111
拒否済みパッチ:KB222222
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
パッチマネージャーがサポートするOS
• Windows Server
• Windows Server 2008 から Windows Server 2016(R2 バージョンを含む)
• Microsoft からパッチがリリースされてから数時間以内に、
すべてのサポート対象のオペレーティングシステムにパッチを提供
• Linux
• 64 ビットおよび 32 ビットシステム
• Red Hat Enterprise Linux (RHEL) 6.5 - 6.9
• Ubuntu Server 14.04 LTS および 16.04 LTS
• Amazon Linux 2012.03 - 2017.03
• CentOS 6.5 以降
• 64 ビットシステムのみ
• Red Hat Enterprise Linux (RHEL) 7.0 - 7.4
• SUSE Linux Enterprise Server (SLES) 12
• Amazon Linux 2015.03 - 2018.03
• CentOS 7.1 以降
2018/07/25現在
https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/patch-manager-supported-
oses.html
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク6:
モニタリング&脆弱性チェック
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
タスク6: モニタリング&脆弱性チェック
• メトリクス&ログモニタリングと脆弱性のチェック
• よくある作業
• CloudWatch Agentやサードパーティエージェントの導入
• Inspectorやサードパーティエージェントの導入
• それぞれの継続的なモニタリング実施
• SSMが提供するもの
• ステートマネージャー等による各エージェントの導入
• Systems Managerマネジメントコンソールのダッシュボード
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
SSM インサイト(ダッシュボード)
AWS環境の全体像を
把握
• CloudWatch
• Config
• Personal Health
Dashboard
• CloudTrail
• Trusted Advisor
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
ウォークスルー:
インスタンス群 に
Inspector による評価と
CloudWatchによる詳細監視を
一括設定する
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
1-1. タグ付け
タグエディタでタグを一括付与
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
1-2. タグ付け
タグエディタでタグを一括付与
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
2-1. Inspector Agentのインストール
(RunCommand)
タグエディタで
付与したのと同じタグ
https://aws.amazon.com/jp/about-aws/whats-new/2017/10/systems-manager-document-now-available-for-installing-amazon-inspector-agents-and-amazon-inspector-now-supports-amazon-linux-
2017-09/
https://aws.amazon.com/jp/blogs/security/how-to-simplify-security-assessment-setup-using-ec2-systems-manager-and-amazon-inspector/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
2-2. Inspectorで評価を実施
タグエディタで
付与したのと同じタグ
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
2-3. Inspector 評価の完了
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
3. CloudWatch Agent を一括導入・設定する
• 統合CloudWatch AgentによりOS上の情報もモニタリング可能
• OS上のメトリクスもCWへ送信可能
• カスタムメトリクスとして記録される
• CloudWatch Logsへのログ配信も合わせて設定
• CloudWatch Agent の利用を推奨
• CloudWatch Logs Agentも利用可能
• SSM Agentによるログ収集は今後廃止予定
• 設定の生成をどこかのインスタンスで一度だけ実施
• amazon-cloudwatch-agent-config-wizardコマンド
• CloudWatch Agentに付属
• 設定はParameter Storeに保存され各サーバが参照可能に
• 4KBのサイズ制限に注意
• CloudWatch Agentの導入・設定をSSMで一括して行う
json
jsonjson
1. Wizardで
コンフィグを
生成
2. コンフィグを
Parameter
Storeに保存
3. SSMで
CW Agentを
一括導入・設定
4. OS上のメトリクスを
CloudWatchカスタムメトリクスに
ログをCloudWatchLogsに送信
https://aws.amazon.com/jp/blogs/news/new-amazon-cloudwatch-agent-with-aws-systems-manager-integration-unified-metrics-log-collection-for-linux-
windows/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
3-1. CloudWatch Agentのインストール
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
3-2. CloudWatch Agentの設定を作成しParameter Storeに保存する
$ sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-
agent-config-wizard
=============================================================
= Welcome to the AWS CloudWatch Agent Configuration Manager =
=============================================================
On which OS are you planning to use the agent?
1. linux
2. windows
default choice: [1]:
1
Trying to fetch the default region based on ec2 metadata...
Are you using EC2 or On-Premises hosts?
1. EC2
2. On-Premises
default choice: [1]:
1
Do you want to monitor any host metrics? e.g. CPU, memory, etc.
1. yes
2. no
default choice: [1]:
1
Do you want to monitor cpu metrics per core? Additional
CloudWatch charges may apply.
1. yes
2. no
default choice: [1]:
1
Do you want to add ec2 dimensions (ImageId, InstanceId,
InstanceType, AutoScalingGroupName) into all of your metrics if
the info is available?
1. yes
2. no
default choice: [1]:
1
Would you like to collect your metrics at high resolution (sub-
minute resolution)? This enables sub-minute resolution for all
metrics, but you can customize for specific metrics in the
output json file.
1. 1s
2. 10s
3. 30s
4. 60s
default choice: [4]:
4
Which default metrics config do you want?
1. Basic
2. Standard
3. Advanced
4. None
default choice: [1]:
3
Are you satisfied with the above config? Note: it can be
manually customized after the wizard completes to add additional
items.
1. yes
2. no
default choice: [1]:
1
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
3-2. CloudWatch Agentの設定を作成しParameter Storeに保存する
Do you have any existing CloudWatch Log Agent
(http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AgentRe
ference.html) configuration file to import for migration?
1. yes
2. no
default choice: [2]:
1
What is the file path for the existing cloudwatch log agent
configuration file?
default choice: [/var/awslogs/etc/awslogs.conf]
Do you want to monitor any log files?
1. yes
2. no
default choice: [1]:
1
Log file path:
/var/log/messages
Log group name:
default choice: [messages]
Do you want to specify any additional log files to monitor?
1. yes
2. no
default choice: [1]:
2
Saved config file to /opt/aws/amazon-cloudwatch-
agent/bin/config.json successfully.
Do you want to store the config in the SSM parameter store?
1. yes
2. no
default choice: [1]:
1
What parameter store name do you want to use to store your
config? (Use 'AmazonCloudWatch-' prefix if you use our managed
AWS policy)
default choice: [AmazonCloudWatch-linux]
Trying to fetch the default region based on ec2 metadata...
Which region do you want to store the config in the parameter
store?
default choice: [ap-northeast-1]
Which AWS credential should be used to send json config to
parameter store?
1. ASIAIWED4ZE2H6FGPZRA(From SDK)
2. Other
default choice: [1]:
1
Successfully put config to parameter store AmazonCloudWatch-
linux.
Program exits now.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
3-2. CloudWatch Agentの設定を作成しParameter Storeに保存する
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
3-3.CloudWatch Agentの設定を各サーバに反映
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
3-3.CloudWatch Agentの設定を各サーバに反映
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
3-4. CloudWatchにメトリクスとログが送信される
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
InspectorとCloudWatchの一括設定まとめ
1. タグエディタでタグを一括付与
2. Inspector Agentを一括導入
• RunCommandを使用
3. CloudWatch Agentを一括導入・設定
• RunCommand / Parameter Store
• amazon-cloudwatch-agent-config-wizard
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
おわりに
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
FAQs
• Systems Manager を使うにはAgentが必要ですか?
• Agentはどの程度の頻度でアップデートが必要ですか?
• 利用するにはどのようなIAM権限が必要ですか?
• どのようにオンプレミスのサーバをセットアップしたら良いですか?
• どのOSをサポートしていますか?
• 管理対象のサーバはどのようなネットワークアクセスが必要ですか?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
Answers
• Systems Manager を使うにはAgentが必要ですか?
• はい。Systems Manager Agentが必要です。CloudWatch Agent、Inspector Agentも合わせてよく使われます
• Agentはどの程度の頻度でアップデートが必要ですか?
• 新バージョンリリース時にSNSから通知を受け取ることができます
https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/ssm-agent-subscribe-notifications.html
• 利用するにはどのようなIAM権限が必要ですか?
• Systems Managerを利用するIAMユーザ: AmazonSSMFullAccessポリシー
• 管理対象のEC2: AmazonEC2RoleforSSMポリシーを持つIAMロール
• この他ハイブリッド環境用のIAMサービスロールや、SNS通知用のロールがあります
• どのようにオンプレミスのサーバをセットアップしたら良いですか?
• サーバに対応するアクティベーションコードを発行し、Agentに設定します
• どのOSをサポートしていますか?
• Windows 2008以降、Amazon Linux、Amazon Linux 2、RHEL、CentOS、Ubuntu、SLES、Raspbianに対応しています
• 詳細はドキュメントを参照
• 管理対象のサーバはどのようなネットワークアクセスが必要ですか?
• Systems Manager APIへのアクセスが必要です
• インターネット経由またはVPCエンドポイントによるプライベート接続が可能です
(Direct Connect経由であればオンプレミスからも接続可能)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Systems Manager によるサーバ運用
AWS cloud
data center
ドキュメント パラメータストア
オペレーション
定期運用
非定期・障害時運用
構成検証・監査
Run Command
Automationメンテナンスウィンドウ
インベントリステートマネージャー Patch Manager
Lambdaファンクション
Step Functions
マネジメントコンソール
AWS CLI
スケジューリング
構成情報・操作手順
AWS Config CloudWatch EventS3
S3
CloudWatchLogs
SNS
マネージドインスタンス
CloudWatch
メトリクス&ログ
Inspector
セキュリティ評価
CloudWach
Agent
Inspector
Agent
SSM
Agent
IAM
Role
サーバ運用
操作記録・通知
Athena&Quicksight
記録・通知・対応・分析 パラメータストアの参照
CFn CLI Lambda ECS
tag: xxx
tag: xxx
tag: yyy
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
まとめ
1. クラウドのサーバ運用
2. AWS Systems Managerの全体像
3. SSM利用の準備
4. タスク別SSMの使い方
1. サーバを設定する
2. 繰り返し作業の自動化
3. トラブルシューティング
4. サーバの構成検証・監査
5. パッチの適用
6. モニタリング&脆弱性チェック
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
参考資料
• AWS Systems Manager ユーザーガイド
• https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/what-is-systems-
manager.html
• AWS Systems Manager サービス制限
• https://docs.aws.amazon.com/ja_jp/general/latest/gr/aws_service_limits.html#limits_ss
m
• AWS Management Tools Blog
• https://aws.amazon.com/jp/blogs/mt/ (Original)
• https://aws.amazon.com/jp/blogs/news/category/management-tools/ (Japanese)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
オンラインセミナー資料の配置場所
AWS クラウドサービス活用資料集
• https://aws.amazon.com/jp/aws-jp-introduction/
Amazon Web Services ブログ
• 最新の情報、セミナー中のQ&A等が掲載されています。
• https://aws.amazon.com/jp/blogs/news/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
公式Twitter/Facebook
AWSの最新情報をお届けします
@awscloud_jp
検索
最新技術情報、イベント情報、お役立ち情報、
お得なキャンペーン情報などを日々更新しています!
もしくは
http://on.fb.me/1vR8yWm
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWSの導入、お問い合わせのご相談
AWSクラウド導入に関するご質問、お見積、資料請求をご希望のお客様は以
下のリンクよりお気軽にご相談下さい。
https://aws.amazon.com/jp/contact-us/aws-sales/
※「AWS 問い合わせ」で検索して下さい。
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights
AWS Well Architected 個別技術相談会お知らせ
• Well Architectedフレームワークに基づく数十個の質問項目を元に、お客様
がAWS上で構築するシステムに潜むリスクやその回避方法をお伝えする個別
相談会です。
https://pages.awscloud.com/well-architected-consulting-jp.html
• 参加無料
• 毎週火曜・木曜開催

Contenu connexe

Plus de Amazon Web Services Japan

202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用Amazon Web Services Japan
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdfAmazon Web Services Japan
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介Amazon Web Services Japan
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon Web Services Japan
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことAmazon Web Services Japan
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチAmazon Web Services Japan
 
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer ProfilesAmazon Web Services Japan
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Web Services Japan
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨Amazon Web Services Japan
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介Amazon Web Services Japan
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介Amazon Web Services Japan
 
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...Amazon Web Services Japan
 
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピAmazon Web Services Japan
 
20211209 Ops-JAWS Re invent2021re-cap-cloud operations
20211209 Ops-JAWS Re invent2021re-cap-cloud operations20211209 Ops-JAWS Re invent2021re-cap-cloud operations
20211209 Ops-JAWS Re invent2021re-cap-cloud operationsAmazon Web Services Japan
 
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報Amazon Web Services Japan
 
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをなAmazon Web Services Japan
 
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPNAmazon Web Services Japan
 

Plus de Amazon Web Services Japan (20)

202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDD
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
 
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
 
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
 
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
 
20211209 Ops-JAWS Re invent2021re-cap-cloud operations
20211209 Ops-JAWS Re invent2021re-cap-cloud operations20211209 Ops-JAWS Re invent2021re-cap-cloud operations
20211209 Ops-JAWS Re invent2021re-cap-cloud operations
 
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
 
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
 
20211109 JAWS-UG SRE keynotes
20211109 JAWS-UG SRE keynotes20211109 JAWS-UG SRE keynotes
20211109 JAWS-UG SRE keynotes
 
20211109 bleaの使い方(基本編)
20211109 bleaの使い方(基本編)20211109 bleaの使い方(基本編)
20211109 bleaの使い方(基本編)
 
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
 

Dernier

TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 

Dernier (9)

TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 

20180725 AWS Black Belt Online Seminar AWS Systems Manager

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights アマゾン ウェブ サービス ジャパン株式会社 ソリューションアーキテクト 大村幸敬 2018/07/25 【AWS Black Belt Online Seminar】 AWS Systems Manager
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 大村 幸敬 (おおむら ゆきたか) • インダストリソリューション部 • ソリューションアーキテクト • エンタープライズのお客さまを担当 Management Tools & DevOps 系サービスを担当 • 好きなAWSのサービス:AWS CLI
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 内容についての注意点 • 本資料では2018年07月25日時点のサービス内容および価格についてご説明しています。最新の情報 はAWS公式ウェブサイト(https://aws.amazon.com)にてご確認ください • 資料作成には十分注意しておりますが、資料内の価格とAWS公式ウェブサイト記載の価格に相違が あった場合、AWS公式ウェブサイトの価格を優先とさせていただきます • 価格は税抜表記となっています。日本居住者のお客様が東京リージョンを使用する場合、別途消費税 をご請求させていただきます AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to change in accordance with the AWS Customer Agreement available at http://aws.amazon.com/agreement/. Any pricing information included in this document is provided only as an estimate of usage charges for AWS services based on certain information that you have provided. Monthly charges will be based on your actual use of AWS services, and may vary from the estimates provided.
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights Agenda 1. クラウドのサーバ運用 2. AWS Systems Managerの全体像 3. SSM利用の準備 4. タスク別SSMの使い方 1. サーバを設定する 2. 繰り返し作業の自動化 3. トラブルシューティング 4. サーバの構成検証・監査 5. パッチの適用 6. モニタリング&脆弱性チェック
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights クラウドのサーバ運用
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights サーバ運用におけるペットと家畜 • 家畜 • クラウド型の運用 • サーバを使い捨て可能 • Immutable • テンプレートから同じ設定のサーバを作成 • ペット • 従来型の運用 • サーバ1台1台に個性がある • 構成管理 • 初期セットアップと設定変更
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights エンタープライズ企業のクラウドジャーニー • 全てがクラウドネイティブではない • 従来型の運用とクラウド型運用のハイブリッド 初期プロジェクト 基盤作り 移行 改革 クラウド・ ネイティブ 技術負債の 返済 価 値 期間 クラウドのメリットを活かせる 最適なアプリケーション開発を 行っていく 最初から、クラウドに適した 設計を導入しながら移行する ハード老朽化対応、コスト削減 目的でクラウドへ単純移行する まずクラウドへ移行した後で、 クラウド最適化を目指す
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights サーバ運用担当者の日常 • サーバOSを立ち上げ基本的な設定を投入 • アプリケーション稼働に必要なライブラリや設定を投入 • 設計上の値と実装値のズレを修正 • 手動タスクを繰り返し実施 • 定時外に呼び出されトラブルシュート
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights サーバの運用をこうしたい • インスタンスの設定が正しく行われている • ルールに準拠していないサーバを検出できる • 手順書が集中管理されバージョン管理と共有が行われる • 共通作業が自動化される • 容易にトラブルシュートや問題事象の緩和ができる
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Systems Managerの全体像
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Systems Manager が提供するもの ハイブリッド環境の管理 (EC2/オンプレミス) クロスプラットフォーム (Windows/Linux) スケーラブルかつ監 査可能 セキュリティと コンプライアンスの改善 繰り返しタスクを容 易に自動化 TCOの削減 (追加コスト不要)
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Systems Manager によるサーバ運用 AWS cloud data center ドキュメント パラメータストア オペレーション 定期運用 非定期・障害時運用 構成検証・監査 Run Command Automationメンテナンスウィンドウ インベントリステートマネージャー Patch Manager Lambdaファンクション Step Functions マネジメントコンソール AWS CLI スケジューリング 構成情報・操作手順 AWS Config CloudWatch EventS3 S3 CloudWatchLogs SNS マネージドインスタンス CloudWatch メトリクス&ログ Inspector セキュリティ評価 CloudWach Agent Inspector Agent SSM Agent IAM Role サーバ運用 操作記録・通知 Athena&Quicksight 記録・通知・対応・分析 パラメータストアの参照 CFn CLI Lambda ECS tag: xxx tag: xxx tag: yyy
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Systems Manager によるサーバ運用 AWS cloud data center ドキュメント パラメータストア オペレーション 定期運用 非定期・障害時運用 構成検証・監査 Run Command Automationメンテナンスウィンドウ インベントリステートマネージャー Patch Manager Lambdaファンクション Step Functions マネジメントコンソール AWS CLI スケジューリング 構成情報・操作手順 AWS Config CloudWatch EventS3 S3 CloudWatchLogs SNS マネージドインスタンス CloudWatch メトリクス&ログ Inspector セキュリティ評価 CloudWach Agent Inspector Agent SSM Agent IAM Role サーバ運用 操作記録・通知 Athena&Quicksight 記録・通知・対応・分析 パラメータストアの参照 CFn CLI Lambda ECS tag: xxx tag: xxx tag: yyy
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Systems Manager によるサーバ運用 AWS cloud data center ドキュメント パラメータストア オペレーション 定期運用 非定期・障害時運用 構成検証・監査 Run Command Automationメンテナンスウィンドウ インベントリステートマネージャー Patch Manager Lambdaファンクション Step Functions マネジメントコンソール AWS CLI スケジューリング 構成情報・操作手順 AWS Config CloudWatch EventS3 S3 CloudWatchLogs SNS マネージドインスタンス CloudWatch メトリクス&ログ Inspector セキュリティ評価 CloudWach Agent Inspector Agent SSM Agent IAM Role サーバ運用 操作記録・通知 Athena&Quicksight 記録・通知・対応・分析 パラメータストアの参照 CFn CLI Lambda ECS tag: xxx tag: xxx tag: yyy
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Systems Manager によるサーバ運用 AWS cloud data center ドキュメント パラメータストア オペレーション 定期運用 非定期・障害時運用 構成検証・監査 Run Command Automationメンテナンスウィンドウ インベントリステートマネージャー Patch Manager Lambdaファンクション Step Functions マネジメントコンソール AWS CLI スケジューリング 構成情報・操作手順 AWS Config CloudWatch EventS3 S3 CloudWatchLogs SNS マネージドインスタンス CloudWatch メトリクス&ログ Inspector セキュリティ評価 CloudWach Agent Inspector Agent SSM Agent IAM Role サーバ運用 操作記録・通知 Athena&Quicksight 記録・通知・対応・分析 パラメータストアの参照 CFn CLI Lambda ECS tag: xxx tag: xxx tag: yyy
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Systems Manager によるサーバ運用 AWS cloud data center ドキュメント パラメータストア オペレーション 定期運用 非定期・障害時運用 構成検証・監査 Run Command Automationメンテナンスウィンドウ インベントリステートマネージャー Patch Manager Lambdaファンクション Step Functions マネジメントコンソール AWS CLI スケジューリング 構成情報・操作手順 AWS Config CloudWatch EventS3 S3 CloudWatchLogs SNS マネージドインスタンス CloudWatch メトリクス&ログ Inspector セキュリティ評価 CloudWach Agent Inspector Agent SSM Agent IAM Role サーバ運用 操作記録・通知 Athena&Quicksight 記録・通知・対応・分析 パラメータストアの参照 CFn CLI Lambda ECS tag: xxx tag: xxx tag: yyy
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Systems Manager によるサーバ運用 AWS cloud data center ドキュメント パラメータストア オペレーション 定期運用 非定期・障害時運用 構成検証・監査 Run Command Automationメンテナンスウィンドウ インベントリステートマネージャー Patch Manager Lambdaファンクション Step Functions マネジメントコンソール AWS CLI スケジューリング 構成情報・操作手順 AWS Config CloudWatch EventS3 S3 CloudWatchLogs SNS マネージドインスタンス CloudWatch メトリクス&ログ Inspector セキュリティ評価 CloudWach Agent Inspector Agent SSM Agent IAM Role サーバ運用 操作記録・通知 Athena&Quicksight 記録・通知・対応・分析 パラメータストアの参照 CFn CLI Lambda ECS tag: xxx tag: xxx tag: yyy
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Systems Manager サービス群 サービス名 概要 メンテナンスウィンドウ 定期的に行う管理作業やサービス停止の実施時間帯を定義する Run Command 安全にインスタンス上の管理作業を実施する SSHやRDPを使用せず多数のサーバを一括操作 Automation 一連の作業フローを定義する パッチを適用してAMIを作成する、インスタンススペックを変更するなど ステートマネージャー あるべきOSの設定値を定義し維持する ポリシーに準拠したファイアウォール設定やアンチマルウェアツールの設定 インベントリ インストール済みソフトウェアの一覧を収集・検索する Patch Manager OSパッチの選択と適用を自動的に実施する ドキュメント Systems Managerの各サービスの挙動を定義する設定ドキュメント コマンド、ポリシー、自動化の3種類がある パラメータストア 設定値やパスワードなどを集中管理する階層型ストレージ アクセス制御や他のサービスからの参照が容易に行える
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights コラム: AWS Systems Manager = SSM ? 2017年12月 re:Inventで「AWS Systems Manager」を発表 • クラウドとハイブリッドリソースを統合的に管理するサービスへ • Amazon Simple Systems Managerまたは Amazon EC2 Systems Manager は古い名称 • 現在もEC2管理画面にSystems Manager Servicesや共有リソースの表 記がある • 今後はAWS Systems Manager コンソールがメイン
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM利用の準備
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 0. Systems ManagerがサポートするOS • Windows Server • Windows Server 2003 から Windows Server 2016(R2 バージョンを含む) • Linux • 64 ビットおよび 32 ビットシステム • Amazon Linux 基本 AMI 2014.09、2014.03 以降 • Ubuntu Server 18.04 LTS、16.04 LTS、14.04 LTS、または 12.04 LTS • Red Hat Enterprise Linux (RHEL) 6.5 • CentOS 6.3 以降 • 32 ビットシステムのみ • Raspbian Jessie • Raspbian Stretch • 64 ビットシステムのみ • Amazon Linux 2015.09、2015.03 以降 • Amazon Linux 2 • Red Hat Enterprise Linux (RHEL) 7.4 • CentOS 7.1 以降 • SUSE Linux Enterprise Server (SLES) 12 以上 2018/07/25 現在。最新情報はこちら: https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/systems-manager-prereqs.html 注:パッチマネージャはこれらすべてのバージョンをサポートしてはいません。詳細は以下を参照 https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/patch-manager-supported-oses.html
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 1. Systems Manager APIへのアクセス経路確保 • SSM AgentはSystems Manager APIを呼び出す • 以下のいずれかのネットワークを構成する 1. インターネットへのアウトバウンドアクセス • インバウンドアクセスは不要 • パブリックサブネットやNAT Gatewayを使用 2. VPC エンドポイントへのアクセス • プライベートネットワークによる接続が可能 • インターフェイスエンドポイント • com.amazonaws.region.ssm • com.amazonaws.region.ec2messages • com.amazonaws.region.ec2 • ゲートウェイエンドポイント • S3 SSM Agent Systems Manger API IAM Role SSM Agent Systems Manger API IAM Role 1. インターネット経由のアクセス 2. VPCエンドポイント経由のアクセス
  • 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 2. IAM Roleの付与 Systems Manager APIを呼び出すためのインスタンスプロファイル を作成してEC2にアタッチ • IAM Roleを作成 • IAM ポリシー「AmazonEC2RoleforSSM」を割り当て • Trusted EntityをEC2とする (EC2にこのロールを付与できるようにする) SSM Agent Systems Manger API IAM Role IAM Policy (AmazonEC2RoleforSS M)
  • 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 3. SSM Agentの導入 サーバにSSM Agentを導入しサービスを起動 • 次のAMIはデフォルトでSSM Agent導入済み • Windows Server • Amazon Linux • Amazon Linux2 • Ubuntu Server 18.04 • AgentのインストーラはS3に配置 https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/ssm-agent.html • CloudWatch AgentやInspector Agentは後か らSSMを使用してインストールすれば良い SSM Agent
  • 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights ハイブリッド環境の設定 0. ハイブリッド環境用のIAM Roleを作成(初回のみ) 1. オンプレミスサーバにSSM Agentを導入 2. Systems Manager APIへのアクセス経路を確保 • DirectConnectやProxyによりVPCエンドポイントの利用も可能 3. SSMでアクティベーションコードを生成 4. インスタンスにアクティベーションコードを設定 ハイブリッド環境用の IAMサービスロール Systems Manger API アクティベーション コードの設定 SSM Agent Internet アクティベーションコード の作成 SSMサービスに対する AssumeRoleを許可
  • 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM利用の準備まとめ • マネージドインスタンス • SSM 管理下のサーバ • オンプレミスサーバもEC2も同様に扱う • 手順 0. Systems ManagerがサポートするOS 1. Systems Manager APIへのアクセス経路確保 2. IAM Roleの付与 3. SSM Agentの導入 • ハイブリッド環境(オンプレミスサーバ)も設定可 SSM Agent Systems Manger API IAM Role
  • 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク別SSMの使い方 1. サーバを設定する 2. 繰り返し作業の自動化 3. トラブルシューティング 4. サーバの構成検証・監査 5. パッチの適用 6. モニタリング&脆弱性チェック
  • 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク1:サーバを設定する
  • 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク1: サーバを設定する • サーバの構成管理と設定 • よくある作業 • AutoScalingGroup内の全サーバを設定 • インスタンス起動時にドメインに参加 • インスタンスの構成をモニタリング • SSMが提供するもの • 設定をコードで記述する • 初期設定を行う • 継続的に設定値のズレを検出し通知及び修正する
  • 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM ドキュメント • Systems Manager の設定や操作を記述するために使用 • コマンドドキュメント(主にインスタンス上の操作) • 自動化ドキュメント(AWS環境を含む一連の操作の定義) • ポリシードキュメント(ステートマネージャーで使用) • YAML/JSONで記述 • コードによる管理(編集、バージョン管理) • パラメータの使用 • 他のアカウントへの共有 • AWSが提供する事前定義済みドキュメントあり
  • 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 例:Ansible Playbookを実行するコマンドドキュメント --- schemaVersion: "2.2" description: "MyConfigurationAsCode" mainSteps: - action: "aws:runDocument" name: "InstallApache" inputs: documentType: "SSMDocument" documentPath: "arn:aws:ssm:us-west-1::document/InstallApache" documentParameters: "{ }" - action: "aws:downloadContent" name: "AnsiblePlaybookfromGitHub" inputs: sourceType: "GitHub" sourceInfo: "{¥"owner¥":¥“Amjad¥", ¥"repository¥":¥"MyPrivateRepo¥",¥"path¥"¥ :¥"documents/nginx.yml¥", ¥"tokenInfo¥":¥"{{ ssm-secure:MyAccessToken }}¥"}" destinationPath: "" - action: "aws:runShellScript" name: "RunPlaybook" inputs: commands: - "ansible-playbook -i ¥"localhost,¥" -c local nginx.yml" Nested Document Ansible Playbook を自分のGitHub リポジトリからダウンロード Ansible Playbookを実行 ドキュメントタイプに応じた適切なスキーマバージョンの指定 コマンド 2.2 / 自動化 0.3 / ポリシー 2.0以降
  • 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSMの定義済みドキュメント(コマンドドキュメント - 1/3) 2018/07/25現在 名前 プラットフォーム 1 AWS-ApplyPatchBaseline Windows 2 AWS-ConfigureAWSPackage Windows Linux 3 AWS-ConfigureCloudWatch Windows 4 AWS-ConfigureDocker Windows Linux 5 AWS-ConfigureWindowsUpdate Windows 6 AWS-FindWindowsUpdates Windows 7 AWS-InstallApplication Windows 8 AWS-InstallMissingWindowsUpdates Windows 9 AWS-InstallPowerShellModule Windows 10 AWS-InstallSpecificWindowsUpdates Windows 11 AWS-InstallWindowsUpdates Windows 12 AWS-JoinDirectoryServiceDomain Windows 13 AWS-ListWindowsInventory Windows 14 AWS-RefreshAssociation Windows Linux 15 AWS-RunAnsiblePlaybook Linux
  • 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSMの定義済みドキュメント(コマンドドキュメント - 2/3) 2018/07/25現在 名前 プラットフォーム 16 AWS-RunDockerAction Windows Linux 17 AWS-RunDocument Windows Linux 18 AWS-RunInspecChecks Windows Linux 19 AWS-RunPatchBaseline Windows Linux 20 AWS-RunPowerShellScript Windows Linux 21 AWS-RunRemoteScript Windows Linux 22 AWS-RunSaltState Linux 23 AWS-RunShellScript Linux 24 AWS-UpdateEC2Config Windows 25 AWS-UpdateSSMAgent Windows Linux 26 AWSSupport-RunEC2RescueForWindowsTool Windows 27 AmazonInspector-ManageAWSAgent Windows Linux 28 AWSEC2-CreateVssSnapshot Windows 29 AWSEC2-ManageVssIO Windows 30 AWSEC2-RunSysprep Windows
  • 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSMの定義済みドキュメント(コマンドドキュメント - 3/3) 2018/07/25現在 名前 プラットフォーム 31 AmazonCloudWatch-ManageAgent Windows Linux 32 AmazonCloudWatch-MigrateCloudWatchAgent Windows
  • 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSMの定義済みドキュメント(ポリシードキュメント) 名前 概要 プラットフォーム AWS-GatherSoftwareInventory サーバ上のソフトウェア一覧情報を取得する Windows Linux 2018/07/25現在
  • 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSMの定義済みドキュメント(自動化ドキュメント - 1/3) 2018/07/25現在 名前 プラットフォーム 1 AWS-ASGEnterStandby Windows Linux 2 AWS-ASGExitStandby Windows Linux 3 AWS-AttachEBSVolume Windows Linux 4 AWS-AttachIAMToInstance Windows Linux 5 AWS-ConfigureCloudWatchOnEC2Instance Windows Linux 6 AWS-CopySnapshot Windows Linux 7 AWS-CreateManagedLinuxInstance Windows Linux 8 AWS-CreateManagedLinuxInstanceWithApproval Windows Linux 9 AWS-CreateManagedWindowsInstance Windows Linux 10 AWS-CreateManagedWindowsInstanceWithApproval Windows Linux 11 AWS-CreateSnapshot Windows Linux 12 AWS-DeleteCloudFormationStack Windows Linux 13 AWS-DeleteCloudFormationStackWithApproval Windows Linux 14 AWS-DeleteSnapshot Windows Linux 15 AWS-DetachEBSVolume Windows Linux
  • 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSMの定義済みドキュメント(自動化ドキュメント - 2/3) 2018/07/25現在 名前 プラットフォーム 16 AWS-RebootRdsInstance Windows Linux 17 AWS-ResizeInstance Windows Linux 18 AWS-RestartEC2Instance Windows Linux 19 AWS-RestartEC2InstanceWithApproval Windows Linux 20 AWS-SetupInventory Windows Linux 21 AWS-SetupManagedInstance Windows Linux 22 AWS-SetupManagedRoleOnEc2Instance Windows Linux 23 AWS-StartEC2Instance Windows Linux 24 AWS-StartEC2InstanceWithApproval Windows Linux 25 AWS-StartRdsInstance Windows Linux 26 AWS-StopEC2Instance Windows Linux 27 AWS-StopEC2InstanceWithApproval Windows Linux 28 AWS-StopRdsInstance Windows Linux 29 AWS-TerminateEC2Instance Windows Linux 30 AWS-TerminateEC2InstanceWithApproval Windows Linux
  • 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSMの定義済みドキュメント(自動化ドキュメント - 3/3) 2018/07/25現在 名前 プラットフォーム 31 AWS-UpdateCloudFormationStack Windows Linux 32 AWS-UpdateCloudFormationStackWithApproval Windows Linux 33 AWS-UpdateLinuxAmi Windows Linux 34 AWS-UpdateWindowsAmi Windows Linux 35 AWSSupport-ActivateWindowsWithAmazonLicense Windows Linux 36 AWSSupport-ExecuteEC2Rescue Windows Linux 37 AWSSupport-GrantPermissionsToIAMUser Windows Linux 38 AWSSupport-ManageRDPSettings Windows Linux 39 AWSSupport-ManageWindowsService Windows Linux 40 AWSSupport-ResetAccess Windows Linux 41 AWSSupport-SendLogBundleToS3Bucket Windows Linux 42 AWSSupport-TroubleshootRDP Windows Linux
  • 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM ステートマネージャー • サーバ群に対して定期的に処理を行うためのフレームワーク • サーバの構成情報収集や設定の修正などの用途に向く • サービス停止を伴う作業はメンテナンスウィンドウを使用 • 「関連付け (Association)」を作って次の3つを組合せ • What: ターゲット (タグ or 個別指定) • When: スケジュール (cron式など) • How: SSMドキュメントで処理内容を指定 • 使用例 • Ansible Playbookの定期的な適用 • インベントリ情報の定期的な収集
  • 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM ステートマネージャー
  • 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM パラメータストア • コンフィグレーションや設定値を 権限別の階層型で保存 • IAMによるアクセス制御 • AMI IDなどAWSが提供する値あり • パスワードなど機密情報をKMSで暗号化 • CloudFormation, Lambda, ECS, CodeBuild, CodeDeployなどのサービス と統合済み • 環境変数を渡す用途などに使用 No more plaintext secrets ! Dev Test Prod App App App /test/app/db_password /prod/app/db_password email notification Rotate password event (event-based)
  • 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM Parameter Store 使用例 設定パラメータ用ストレージ • 設定時に使用するDB接続情報などの保存に利用 aws ssm put-parameter --name /MySystem/Prod/DB/User --type String --value myuser aws ssm get-parameter --name /MySystem/Prod/DB/User { "Parameter": { "Name": "/MySystem/Dev/DB/User", "Type": "String", "Value": "ohmurayu", "Version": 1 } } パラメータ設定 パラメータ取得
  • 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM Parameter Store 使用例 (CloudFormation) CFnテンプレートのParametersから直接利用可能 自身で設定した値を使用 AWSが提供する値を使用 Parameters: MyAMIID: Type : AWS::SSM::Parameter::Value<AWS::EC2::Image::Id> Default: /aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-gp2 # Default: /aws/service/ami-windows-latest/Windows_Server-2016-English-Full-Base 注:SecureStringは2018/6/1時点で未対応 Parameters: Env: Type: AWS::SSM::Parameter::Value<String> Default: /MySystem/Prod/DB/User
  • 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 例:ステートマネージャーを使用した構成管理 • ステートマネージャーを使用して インスタンス起動時に初期設定 • 定期的に設定を確認し、変更され ていたら元の値に戻す • AWS-RunAnsible • Ansible Playbookの実行 • SSMインベントリとAWS Config Rulesとの連携(後述) • 設定の準拠状況をレポート ステート マネージャー インスタンス群 https://aws.amazon.com/jp/blogs/mt/running-ansible-playbooks-using-ec2-systems-manager-run-command-and-state-manager/
  • 45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 例:ステートマネージャーを使用した インスタンスモニタリングの自動設定 • インスタンス起動時に CloudWatchのモニタリング設 定を自動的に投入 • カスタムメトリクスによる OS上のメトリクス監視 • CloudWatchLogsによる OS上のログ監視 • 恒常的に設定を維持 • オンプレミス上のサーバも 同様に設定
  • 46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク2:繰り返し作業の自動化
  • 47. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク2: 繰り返し作業の自動化 • 多くの運用作業は繰り返し行われる • よくある作業 • ロードバランサー配下のサーバを サービス無停止でメンナンス • インスタンスの起動に承認が必要 • SSMが提供するもの • 運用作業を自動化する柔軟な手法 • 作業を止め承認を待つためのワークフロー
  • 48. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM Automation • 手動かつ繰り返しの作業を自動化す るためのフレームワーク • 自動化ドキュメントは事前定義され たものを使用するか独自に作成 • 処理を進めるために手動で承認の手 順を追加することが可能 • LambdaやRunCommandを使って 処理を拡張 Document Run the automation Role and permission input
  • 49. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 承認手続きを含むAutomation "parameters":{ ... "Approvers":{ "type":"StringList", "description":"IAM or user ARN of approvers" }, "mainSteps":[ { "name":"approve", "action":"aws:approve", "timeoutSeconds":999999, "onFailure":"Abort", "inputs":{ "NotificationArn":"{{ SNSTopicArn }}", "Message": "Your approval is required to proceed", "MinRequiredApprovals":1, "Approvers":[ "{{Approvers}}" ] } 承認を求めるIAMユーザや IAMロールのARNリスト を パラメータで定義 承認手続きの定義 パラメータの参照
  • 50. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights メンテナンスウィンドウ • サービス停止を伴うような操作を行う時間帯を定義し、 その時間帯に行う操作をスケジュールする • 操作はターゲットとタスクの組み合わせで指定 • タスクタイプとして次の4種類が利用可能 • RunCommand、Automation、Lambda、StepFunction • 複数の操作に優先順位をつけたりインスタンス群に対す る並列実行レートの設定が可能
  • 51. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights メンテナンスウィンドウ
  • 52. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights メンテナンスウィンドウ
  • 53. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights メンテナンスウィンドウ
  • 54. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 例:繰り返し作業の自動化 ドキュメントによりAutomation/RunCommandいずれかを使用 • AWS-UpdateWindowsAmi • AMIのメンテナンスとパッチ適用の自動化 • AWSEC2-CreateVssSnapshot • VSSを有効化してEBSスナップショットを取得 • AWS-RunInSpecChecks SSM • Chef InSpecの実行 https://aws.amazon.com/jp/blogs/news/streamline-ami-maintenance-and-patching-using-amazon-ec2-systems-manager- automation/ https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/integration-vss.html https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/integration-chef-inspec.html
  • 55. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク3:トラブルシューティング
  • 56. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク3: トラブルシューティング • トラブルシューティングは不定期かつ複雑 • よくある作業 • ログを取集し調査コマンドを実行する • 問題を安全な方法で修正する • SSMが提供するもの • インスタンス群に対して操作を行うシンプルかつ安全な方法 • 操作はカスタマイズ可能 • 定型化とパラメータ化によりオペミスを低減
  • 57. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM RunCommand • クロスプラットフォームの リモート処理実行環境 • セキュアなOSオペレーション • タグ及びIAMを使用したアクセス制御でOSのパスワード不 要 • RDPやSSHアクセスのためのインバウンドポート開放不要 • コマンドドキュメントを実行可能 • AWS-RunShellScriptなどで任意のコマンドも実行可能 • 柔軟な実行制御 • 同時実行及びエラーレート制御可能 • SNSで進捗を通知 • S3に実行ログを保存 • CLIコマンドの生成 • CloudWatchEventsのターゲットに指定可能 AWS cloud corporate data center IT Admin, DevOps Engineer Role-based Access Control
  • 58. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM RunCommand
  • 59. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM RunCommand
  • 60. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM RunCommand
  • 61. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 例: タグによるファイングレインアクセス制御 "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:SendCommand" ], "Resource": "*", "Condition": { "StringLike": { "ssm:resourceTag/tag_key": [ "tag_value" ] } } aws ssm send-command --document-name MyDoc --targets Key=tag:tag_key,Values=tag_value
  • 62. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク4: サーバの構成検証・監査
  • 63. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク4: サーバ構成情報の監査・検証 • サーバの構成情報を収集し分析する • よくある作業 • サーバに導入したソフトウェアの一覧を作成 • 必須あるいは不要なソフトウェアの存在を検知して対応 • サーバ群の構成を分析 • SSMが提供するもの • 統合されたインベントリ • ルールの非準拠を検知して自動的に対応 • 大規模なインベントリに対する分析と可視化
  • 64. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM インベントリ • OS上のアプリケーション一覧など 構成情報を記録する • ステートマネージャーで収集 • AWS Configに構成情報を送信 • ManagedInstanceInventoryと認識 • Config Rulesで準拠状況をチェック • S3に構成情報を保存 • Athena&QuickSightで分析可能 • 複数アカウントの構成情報も検索可 AWS cloud Corporate data center Amazon Athena Amazon QuickSight SSM インベントリ (Amazon S3 data lake) Custom Analytic ToolAWS Config AWS Config Rules ステートマネージャー が収集
  • 65. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 例: ダッシュボード&カスタムインベントリの活用 • ダッシュボードの提供 • 定義済みタイプ • アプリケーション、ネッ トワーク構成、ファイル、 Windowsサーバ/ロール • カスタムインベントリ • ラック番号などを独自に 追加可能(現状 AWS Configでは利用不可) --------- Custom Inventory ----------- aws ssm put-inventory --instance-id "ID" - -items '[{"CaptureTime": "2016-08- 22T10:01:01Z", "TypeName": "Custom:RackInfo", "Content":[{"RackLocation": "Bay B/Row C/Rack D/Shelf E"}], "SchemaVersion": "1.0"}]‘
  • 66. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 例: QuickSightによる分析
  • 67. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 例: ブラックリストにあるソフトウェア導入を検知 SSM Inventory AWS Config インベントリ 情報を記録 Blacklist 用の AWS Config Rule AWS Config Rule名 説明 ec2-managedinstance-applications-blacklisted 指定したアプリケーションのいずれもインスタンスにインストー ルされていないことを確認します ec2-managedinstance-applications-required すべての指定したアプリケーションが、インスタンスにインス トールされているかどうかを確認します ec2-managedinstance-inventory-blacklisted AWS Systems Manager が管理するインスタンスが、ブラック リストに記載されたインベントリタイプを収集するように設定さ れているかどうかを確認します(AWS:Network, AWS:WindowsUpdateなど) ec2-managedinstance-platform-check EC2 マネージドインスタンスの設定が希望どおりであるかどうか を確認します CloudWatch Events & Lambda Systems Managerに関連する AWS Config Rules
  • 68. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク5: パッチの適用
  • 69. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク5: パッチの適用 • サーバのパッチレベルを適切な状態に維持する • よくある作業 • サーバOSのパッチ運用ルールを策定 • 導入済みパッチを確認 • パッチの適用 • SSMが提供するもの • パッチ適用ルール(ベースライン)の策定 • RunCommandを使用したパッチのスキャン及び適用 • ベースラインへの準拠状況のレポート
  • 70. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM パッチマネージャー • パッチルール準拠の確認&実施 • パッチ適用ルールの指定(ベースライン) • 重要度、除外パッチ等を指定 • パッチの適用 • メンテナンスウィンドウと コマンドドキュメントの使用 (Run-PatchBaseline) • Scan機能によるレポーティング • Zero Dayパッチの即時適用 Corp data center Patch Group = DBServers Patch Group = WebServers Patch Group = SQL Cluster DB Server Patch Baseline Web Server Patch Baseline Patch Manager Maintenanc e Window Compliance Notification s!
  • 71. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights パッチベースライン FrondEnd 例:Windowsインスタンスへのパッチ適用 パッチベースライン BackEnd PatchGroup=HR, Batch コマンドドキュメント AWS-RunPatchBaseline 実行 パッチマネージャー Microsoftから定期的に wsusscn2.cab(セキュリティ 関連の更新情報)をダウンロード メンテナンスウィンドウや ステートマネージャーで パッチ適用及びスキャンタイミングを指定 ターゲット 各インスタンスがどのパッチベースラインに従うかは 「Patch Group」タグ(固定)に指定されたグループ名で決まる PatchGroup=Web Tag: PatchGroup=HR Tag: PatchGroup=Batch Tag: PatchGroup=Web OS: Windows 製品:Windows Server 2016 分類:Security Update 重要度:Critical 自動承認の遅延:7日 承認済みパッチ:KB111111 拒否済みパッチ:KB222222
  • 72. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights パッチマネージャーがサポートするOS • Windows Server • Windows Server 2008 から Windows Server 2016(R2 バージョンを含む) • Microsoft からパッチがリリースされてから数時間以内に、 すべてのサポート対象のオペレーティングシステムにパッチを提供 • Linux • 64 ビットおよび 32 ビットシステム • Red Hat Enterprise Linux (RHEL) 6.5 - 6.9 • Ubuntu Server 14.04 LTS および 16.04 LTS • Amazon Linux 2012.03 - 2017.03 • CentOS 6.5 以降 • 64 ビットシステムのみ • Red Hat Enterprise Linux (RHEL) 7.0 - 7.4 • SUSE Linux Enterprise Server (SLES) 12 • Amazon Linux 2015.03 - 2018.03 • CentOS 7.1 以降 2018/07/25現在 https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/patch-manager-supported- oses.html
  • 73. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク6: モニタリング&脆弱性チェック
  • 74. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights タスク6: モニタリング&脆弱性チェック • メトリクス&ログモニタリングと脆弱性のチェック • よくある作業 • CloudWatch Agentやサードパーティエージェントの導入 • Inspectorやサードパーティエージェントの導入 • それぞれの継続的なモニタリング実施 • SSMが提供するもの • ステートマネージャー等による各エージェントの導入 • Systems Managerマネジメントコンソールのダッシュボード
  • 75. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights SSM インサイト(ダッシュボード) AWS環境の全体像を 把握 • CloudWatch • Config • Personal Health Dashboard • CloudTrail • Trusted Advisor
  • 76. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights ウォークスルー: インスタンス群 に Inspector による評価と CloudWatchによる詳細監視を 一括設定する
  • 77. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 1-1. タグ付け タグエディタでタグを一括付与
  • 78. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 1-2. タグ付け タグエディタでタグを一括付与
  • 79. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 2-1. Inspector Agentのインストール (RunCommand) タグエディタで 付与したのと同じタグ https://aws.amazon.com/jp/about-aws/whats-new/2017/10/systems-manager-document-now-available-for-installing-amazon-inspector-agents-and-amazon-inspector-now-supports-amazon-linux- 2017-09/ https://aws.amazon.com/jp/blogs/security/how-to-simplify-security-assessment-setup-using-ec2-systems-manager-and-amazon-inspector/
  • 80. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 2-2. Inspectorで評価を実施 タグエディタで 付与したのと同じタグ
  • 81. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 2-3. Inspector 評価の完了
  • 82. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 3. CloudWatch Agent を一括導入・設定する • 統合CloudWatch AgentによりOS上の情報もモニタリング可能 • OS上のメトリクスもCWへ送信可能 • カスタムメトリクスとして記録される • CloudWatch Logsへのログ配信も合わせて設定 • CloudWatch Agent の利用を推奨 • CloudWatch Logs Agentも利用可能 • SSM Agentによるログ収集は今後廃止予定 • 設定の生成をどこかのインスタンスで一度だけ実施 • amazon-cloudwatch-agent-config-wizardコマンド • CloudWatch Agentに付属 • 設定はParameter Storeに保存され各サーバが参照可能に • 4KBのサイズ制限に注意 • CloudWatch Agentの導入・設定をSSMで一括して行う json jsonjson 1. Wizardで コンフィグを 生成 2. コンフィグを Parameter Storeに保存 3. SSMで CW Agentを 一括導入・設定 4. OS上のメトリクスを CloudWatchカスタムメトリクスに ログをCloudWatchLogsに送信 https://aws.amazon.com/jp/blogs/news/new-amazon-cloudwatch-agent-with-aws-systems-manager-integration-unified-metrics-log-collection-for-linux- windows/
  • 83. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 3-1. CloudWatch Agentのインストール
  • 84. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 3-2. CloudWatch Agentの設定を作成しParameter Storeに保存する $ sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch- agent-config-wizard ============================================================= = Welcome to the AWS CloudWatch Agent Configuration Manager = ============================================================= On which OS are you planning to use the agent? 1. linux 2. windows default choice: [1]: 1 Trying to fetch the default region based on ec2 metadata... Are you using EC2 or On-Premises hosts? 1. EC2 2. On-Premises default choice: [1]: 1 Do you want to monitor any host metrics? e.g. CPU, memory, etc. 1. yes 2. no default choice: [1]: 1 Do you want to monitor cpu metrics per core? Additional CloudWatch charges may apply. 1. yes 2. no default choice: [1]: 1 Do you want to add ec2 dimensions (ImageId, InstanceId, InstanceType, AutoScalingGroupName) into all of your metrics if the info is available? 1. yes 2. no default choice: [1]: 1 Would you like to collect your metrics at high resolution (sub- minute resolution)? This enables sub-minute resolution for all metrics, but you can customize for specific metrics in the output json file. 1. 1s 2. 10s 3. 30s 4. 60s default choice: [4]: 4 Which default metrics config do you want? 1. Basic 2. Standard 3. Advanced 4. None default choice: [1]: 3 Are you satisfied with the above config? Note: it can be manually customized after the wizard completes to add additional items. 1. yes 2. no default choice: [1]: 1
  • 85. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 3-2. CloudWatch Agentの設定を作成しParameter Storeに保存する Do you have any existing CloudWatch Log Agent (http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AgentRe ference.html) configuration file to import for migration? 1. yes 2. no default choice: [2]: 1 What is the file path for the existing cloudwatch log agent configuration file? default choice: [/var/awslogs/etc/awslogs.conf] Do you want to monitor any log files? 1. yes 2. no default choice: [1]: 1 Log file path: /var/log/messages Log group name: default choice: [messages] Do you want to specify any additional log files to monitor? 1. yes 2. no default choice: [1]: 2 Saved config file to /opt/aws/amazon-cloudwatch- agent/bin/config.json successfully. Do you want to store the config in the SSM parameter store? 1. yes 2. no default choice: [1]: 1 What parameter store name do you want to use to store your config? (Use 'AmazonCloudWatch-' prefix if you use our managed AWS policy) default choice: [AmazonCloudWatch-linux] Trying to fetch the default region based on ec2 metadata... Which region do you want to store the config in the parameter store? default choice: [ap-northeast-1] Which AWS credential should be used to send json config to parameter store? 1. ASIAIWED4ZE2H6FGPZRA(From SDK) 2. Other default choice: [1]: 1 Successfully put config to parameter store AmazonCloudWatch- linux. Program exits now.
  • 86. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 3-2. CloudWatch Agentの設定を作成しParameter Storeに保存する
  • 87. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 3-3.CloudWatch Agentの設定を各サーバに反映
  • 88. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 3-3.CloudWatch Agentの設定を各サーバに反映
  • 89. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 3-4. CloudWatchにメトリクスとログが送信される
  • 90. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights InspectorとCloudWatchの一括設定まとめ 1. タグエディタでタグを一括付与 2. Inspector Agentを一括導入 • RunCommandを使用 3. CloudWatch Agentを一括導入・設定 • RunCommand / Parameter Store • amazon-cloudwatch-agent-config-wizard
  • 91. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights おわりに
  • 92. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights FAQs • Systems Manager を使うにはAgentが必要ですか? • Agentはどの程度の頻度でアップデートが必要ですか? • 利用するにはどのようなIAM権限が必要ですか? • どのようにオンプレミスのサーバをセットアップしたら良いですか? • どのOSをサポートしていますか? • 管理対象のサーバはどのようなネットワークアクセスが必要ですか?
  • 93. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights Answers • Systems Manager を使うにはAgentが必要ですか? • はい。Systems Manager Agentが必要です。CloudWatch Agent、Inspector Agentも合わせてよく使われます • Agentはどの程度の頻度でアップデートが必要ですか? • 新バージョンリリース時にSNSから通知を受け取ることができます https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/ssm-agent-subscribe-notifications.html • 利用するにはどのようなIAM権限が必要ですか? • Systems Managerを利用するIAMユーザ: AmazonSSMFullAccessポリシー • 管理対象のEC2: AmazonEC2RoleforSSMポリシーを持つIAMロール • この他ハイブリッド環境用のIAMサービスロールや、SNS通知用のロールがあります • どのようにオンプレミスのサーバをセットアップしたら良いですか? • サーバに対応するアクティベーションコードを発行し、Agentに設定します • どのOSをサポートしていますか? • Windows 2008以降、Amazon Linux、Amazon Linux 2、RHEL、CentOS、Ubuntu、SLES、Raspbianに対応しています • 詳細はドキュメントを参照 • 管理対象のサーバはどのようなネットワークアクセスが必要ですか? • Systems Manager APIへのアクセスが必要です • インターネット経由またはVPCエンドポイントによるプライベート接続が可能です (Direct Connect経由であればオンプレミスからも接続可能)
  • 94. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Systems Manager によるサーバ運用 AWS cloud data center ドキュメント パラメータストア オペレーション 定期運用 非定期・障害時運用 構成検証・監査 Run Command Automationメンテナンスウィンドウ インベントリステートマネージャー Patch Manager Lambdaファンクション Step Functions マネジメントコンソール AWS CLI スケジューリング 構成情報・操作手順 AWS Config CloudWatch EventS3 S3 CloudWatchLogs SNS マネージドインスタンス CloudWatch メトリクス&ログ Inspector セキュリティ評価 CloudWach Agent Inspector Agent SSM Agent IAM Role サーバ運用 操作記録・通知 Athena&Quicksight 記録・通知・対応・分析 パラメータストアの参照 CFn CLI Lambda ECS tag: xxx tag: xxx tag: yyy
  • 95. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights まとめ 1. クラウドのサーバ運用 2. AWS Systems Managerの全体像 3. SSM利用の準備 4. タスク別SSMの使い方 1. サーバを設定する 2. 繰り返し作業の自動化 3. トラブルシューティング 4. サーバの構成検証・監査 5. パッチの適用 6. モニタリング&脆弱性チェック
  • 96. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 参考資料 • AWS Systems Manager ユーザーガイド • https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/what-is-systems- manager.html • AWS Systems Manager サービス制限 • https://docs.aws.amazon.com/ja_jp/general/latest/gr/aws_service_limits.html#limits_ss m • AWS Management Tools Blog • https://aws.amazon.com/jp/blogs/mt/ (Original) • https://aws.amazon.com/jp/blogs/news/category/management-tools/ (Japanese)
  • 97. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights オンラインセミナー資料の配置場所 AWS クラウドサービス活用資料集 • https://aws.amazon.com/jp/aws-jp-introduction/ Amazon Web Services ブログ • 最新の情報、セミナー中のQ&A等が掲載されています。 • https://aws.amazon.com/jp/blogs/news/
  • 98. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights 公式Twitter/Facebook AWSの最新情報をお届けします @awscloud_jp 検索 最新技術情報、イベント情報、お役立ち情報、 お得なキャンペーン情報などを日々更新しています! もしくは http://on.fb.me/1vR8yWm
  • 99. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWSの導入、お問い合わせのご相談 AWSクラウド導入に関するご質問、お見積、資料請求をご希望のお客様は以 下のリンクよりお気軽にご相談下さい。 https://aws.amazon.com/jp/contact-us/aws-sales/ ※「AWS 問い合わせ」で検索して下さい。
  • 100. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights AWS Well Architected 個別技術相談会お知らせ • Well Architectedフレームワークに基づく数十個の質問項目を元に、お客様 がAWS上で構築するシステムに潜むリスクやその回避方法をお伝えする個別 相談会です。 https://pages.awscloud.com/well-architected-consulting-jp.html • 参加無料 • 毎週火曜・木曜開催