© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless Application Security on AWS
Hayato KIRIYAMA | Oct 31, 2018
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
自己紹介
氏名: 桐山隼人
役職: シニアセキュリティソリューションアーキテクト
業務: 顧客提案、ソリューション開発、市場開拓
プロフィール:
外資系総合IT会社の開発研究所にて開発エンジニア、セキュリティベンダーにて
技術営業を経た後、現職。CISSP, CISA, ITIL, MBA, セキュリティ関連特許多数。
クラウドセキュリティに関するセミナー登壇・記事寄稿など。
@hkiriyam1
RSA Conference 2017 APJ
「Cloud Security Strategy」
Session Speaker
AWS Summit Tokyo 2017
「AWSで実現するセキュリティ・オートメーション」
(マイナビニュース)
「IoTビジネスとセキュリティ
を3段階と4要素で理解する」
記事寄稿
(ISC)2 Information Security
Leadership Achievements
Asia-Pacific Award 2018
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
サーバーレスアプリケーションの特長
サーバー管理が不要 柔軟なスケーリング
アイドル時リソース確保不要
高可用性
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
開発者とAWSの役割分担
電源・ネットワーク
ラッキング
HWメンテナンス
OSパッチ
ミドルウェアパッチ
定形運用設計
スケールアウト設計
ミドルウェア導入
OS導入
アプリケーション作成
オンプレミス 独自構築 on EC2 マネージドサービス
開発者が担当 AWSが担当
電源・ネットワーク
ラッキング
HWメンテナンス
OSパッチ
ミドルウェアパッチ
定形運用設計
スケールアウト設計
ミドルウェア導入
OS導入
アプリケーション作成
電源・ネットワーク
ラッキング
HWメンテナンス
OSパッチ
ミドルウェアパッチ
定形運用設計
スケールアウト設計
ミドルウェア導入
OS導入
アプリケーション作成
サーバーレス
アーキテクチャ
電源・ネットワーク
ラッキング
HWメンテナンス
OSパッチ
ミドルウェアパッチ
定形運用設計
スケールアウト設計
ミドルウェア導入
OS導入
アプリケーション作成
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
サーバーレスなアプリケーションモデル
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RESTful Microservices
AWS LambdaAmazon API Gateway Amazon DynamoDBClient
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda
100ms
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API Gateway
API
API AWS Auth
DDoS
API
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
サーバーレスのユースケース
Web
Applications
Data
Processing
ChatbotsBackends
</></>
Amazon
Alexa
Autonomous
IT
• Static
websites
• Complex web
apps
• Packages for
Flask and
Express
• Real time
• MapReduce
• Batch
• Powering
chatbot logic
• Apps &
services
• Mobile
• IoT
• Powering
voice-enabled
apps
• Alexa Skills
Kit
• Policy engines
• Extending
AWS services
• Infrastructure
management
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Backends
/ Amazon API Gateway Amazon DynamoDB
Amazon S3Amazon CloudFront
Amazon
Cognito
Lambda
function
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Stream Data Processing
Amazon Kinesis Lambda
function
Amazon
DynamoDB
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Web Application
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
サーバーレスアプリケーションを構成する層
Compute Layer Data LayerMessaging and
Streaming Layer
User Management and Identity Layer
System Monitoring and Deployment Layer
Edge Layer
AWS
Lambda
Amazon API
Gateway
AWS Step
Functions
Amazon
DynamoDB
Amazon
S3
Amazon
CloudFront
Amazon
Elasticsearch
Service
Amazon
SNS
Amazon
Kinesis
Amazon Cognito
Amazon CloudWatch AWS X-Ray
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Well-Architected
Serverless Application
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Framework
クラウドにおけるシステム設計・運用のベストプラクティス集
Framework
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Well-Architected Framework
Serverless Application Lens
ワークロード固有の考え方やベストプラク
ティスにフォーカスを当てたレンズ(Lens)
サーバーレスアプリケーションに関しても、
Well-Architected Frameworkの5つの柱
でまとめられている
https://d1.awsstatic.com/whitepapers/architecture/AWS-Serverless-Applications-Lens.pdf
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
セキュリティの柱
ビジネスにおける価値を生み出しながら、リスクアセスメントと防御戦略
により、情報、システム、資産を守る能力
• IDとアクセス管理
• 発見的統制
• インフラストラクチャー保護
• データ保護
• インシデントレスポンス
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IDとアクセス管理の考慮事項
1. APIアクセスの認証認可をどのようにしていますか?
2. LambdaファンクションがアクセスできるAWSサービスを
どのように保護していますか?
考え方例
• ユーザー管理とアイデンティティ管理
• IAMの活用
• 既存IdPの活用
• 最小権限の原則
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Cognito User Pools
モバイルおよびWebアプリに
サインアップとサインインの機
能を簡単に追加
ユーザ管理を簡単に
電話番号やemailアドレスのの
検証と多要素認証の提供
拡張されたセキュリティ機能
数億のユーザまでスケールす
るユーザディレクトリを作成・
管理するシンプル、セキュア、
低コストでフルマネージドな
サービス
マネージド型
ユーザディレクトリ
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
API Gatewayアクセス認可の方法
1. Cognito User Pools Authorizer
2. AWS IAM Authorization
3. Lambda Authorizer
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cognito User Pools Authorizer
Mobile app
AmazonAPI
Gateway
Amazon Cognito
User Pools
Amazon
DynamoDB
Lambda
function
4. Validate Access or
Identity token
5. Invoke API Call 6. Access
AWS Resources
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS IAM Authorization
Mobile app
Amazon
DynamoDB
Lambda
function
AmazonAPI
Gateway
Amazon Cognito
User Pools
AWS Identity &
Access Management
Amazon Cognito
Identity Pools
3. Request AWS credentials
4. Validate Id token
5. Temp AWS credentials
8. Invoke Lambda
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IAM Policy Detail
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "execute-api:Invoke",
"Effect": ”Allow",
"Resource": "arn:aws:execute-api:*:*:ff5h9tpwfh/*"
},
{
"Action": "execute-api:Invoke",
"Effect": "Deny",
"Resource": "arn:aws:execute-api:*:*:ff5h9tpwfh/*/POST/locations/*"
}
]
}
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Custom Authorizer
Lambda function
Mobile app
Lambda
function
AmazonAPI
Gateway
Amazon
DynamoDB
AWS Identity &
Access Management
Lambda
Authorizers
4. Check
policy
cache
5.Validatetoken
6.Generateandreturn
userIAMpolicy
8. Invoke
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda Authorizer Function
Sample Code
var testPolicy = new AuthPolicy(”userIdentifier", "XXXXXXXXXXXX", apiOptions);
testPolicy.allowMethod(AuthPolicy.HttpVerb.POST, "/locations/*");
testPolicy.allowMethod(AuthPolicy.HttpVerb.DELETE, "/locations/*");
callback(null, testPolicy.getPolicy());
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
発見的統制の考慮事項
3. サーバーレスアプリケーションのログをどのように
分析していますか?
4. アプリケーションの依存関係や脆弱性をどのように
監視していますか?
考え方例
• アプリケーションログは、CloudWatch Logsの利用
• AWSサービスAPI呼び出しは、CloudTrailの利用
• ログに機微な情報が含まれる可能性の配慮
• 脆弱性やアプリケーション依存関係の追跡
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
メトリクスとログ
CloudWatchメトリクス
• 標準
• Invocations
• Duration
• Throttles
• Errors
• カスタムメトリクスの作成
CloudWatch Logs
• 呼び出しごとに「START」、
「END」、「REPORT」エン
トリがCloudWatch Logsに出
力される
• 独自のログエントリを出力
• 可視化のためにサードパーテ
ィツールを利用
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS X-Rayを使ったトラブルシューティング
AWS X-Rayを用いることでサービス間のイベン
トの遷移を可視化
Lambdaファンクションから他のサービスに対す
る呼び出しと時間をトレース
ファンクションとサービスの依存関係、関連性
を実際に目視
消えたイベントやスロットルといった状態を確
認したり診断したりが簡単に
簡単なセットアップ
簡単セットアップ
AWS
Lambda
Amazon
S3
Amazon
DynamoDB
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS X-Rayを使ったトラブルシューティング
非同期呼び出しの滞留時間とリトライを確認
AWSサービスに対する呼び出しパフォーマンスをプロファイリング
• イベント処理の失敗を検知
• パフォーマンス問題の特定と修正が簡単に
dwell
times
service
call times
retries
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
インフラストラクチャー保護の考慮事項
5. LambdaファンクションがアクセスできるVPC内のAWSリソースに関し
て、どのようにネットワーク境界を保護していますか?
考え方例
• Network ACLやSecurity Groupによるネットワーク境界保護
(参考:考え方は一般のWell-Architected Frameworkと同じ)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データ保護の考慮事項
5. サーバーレスアプリケーション内の機微な情報をどのように
保護していますか?
6. どのように入力値チェックをしますか?
考え方例
• 通信データの暗号化
• クライアントサイド暗号化
• ログに機微な情報が含まれる可能性の配慮
• JSONスキーマやURIパラメータ、クエリ文字列、ヘッダー妥当性検証
• アプリケーションレベルの入力値検証
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
保護すべきデータの外部化
AWS Systems Manager
Parameter Store
AWS Secrets Manager
• 設定データの安全なストレージで、
シークレットを含めることができる
• 作成中に指定したユニークな名前を
使って値を参照する
• 設定や自動化にはスクリプト内のパラ
メータを使用する
• 無料
• 組織内のシークレットのライフサイクルを管理
• 自動的にシークレットをローテーションすることで
セキュリティとコンプライアンスの要件を満たす
手助けになる
• Amazon RDS との組み込みの連携機能はデータ
ベースの認証情報をローテーションする事ができる
• Lambda で拡張可能
• シークレット毎、アクセス毎に課金
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Systems Manager Parameter Store
• Run Command、Automation、State Managerから参照可能
• 例:Run Commandから参照する場合
• KMSで暗号化していた値を参照する場合
• Parameter Storeを参照するインスタンスにIAM Roleを付与後に参照
aws ssm send-command --instance-ids i-1a2b3c4d5e6f7g8 ¥
--document-name AWS-RunPowerShellScript ¥
--parameter '{"commands":["echo {{ssm:param}}"]}'
{
"Effect": "Allow",
"Action": [
"kms:Decrypt",
],
"Resource": [
"arn:aws:kms:region:account_id:key/key_id"
]
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2
AWS
プラットフォーム
Secrets Manager
AWS リソース
その他の
リソース
AWS 認証情報
を提供
DB 認証情報
を保存
安全な ロー
テーション
この組み合わせは、すべての認証情報に対して信頼性が高く、
安全な自動ローテーションをアプリケーションに提供する
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
シークレットをローテーションする
AWS
Secrets
Manager
アプリケー
ション
統合された
バックエンド
リソース
1) ローテーション
のイベント
2) 新しい認証情報
の作成を開始
3) 新しい認証情報
作成完了4) 新しい認証情報
の提供を開始
5) 新しいバージョンの
シークレットを取り出し
6) 新しい認証情報で接続
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
インシデントレスポンスの考慮事項
(参考:考慮事項は一般のWell-Architected Frameworkと同じ)
セキュリティインシデントについて調査や対応ができるように
どのような準備をしていますか?
考え方例
• 人、ツール、プロセスの定義
• インシデント対応訓練の実施
• セキュリティ・オートメーション
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
セキュリティ・オートメーション
Amazon GuardDuty IP
GuardDuty CloudWatch
Events
Lambda
Amazon
GuardDuty
Amazon
CloudWatc
h
CloudWatc
h Event
Lambda
Function
AWS
Lambda
Firewall Manager
Account 2
Account 3
Account 1
AWS WAF
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
侵入テスト
https://aws.amazon.com/jp/security/penetration-testing/
AWS
AWS
• EC2(*)
• RDS(*)
• Aurora
• CloudFront
• API Gateway
• Lambda
• Lightsail
•
* m1.small, t1.micro, t2.nano EC2
RDS
URL
•
•
•
•
•
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デジタルトランスフォーメーション
時代のセキュリティ
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWSが加速する2つの変革
デジタルトランス
フォーメーション
ITトランス
フォーメーション
• 新しい顧客体験
• 革新的な製品や
サービスの創造
• 新ビジネスモデルへ
の移行
• IoT, AI, モバイル等
新しい技術の応用
• トライ&エラー…
• 本業に集中
• ITコスト削減
• グローバル展開、
BCP等の付加価値
• セキュリティ
• システム堅牢性向上
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DX時代の新しいセキュリティ技術領域
各種センサー
各種クライアント
各種モバイルデバイス
Amazon S3
AWS
Lambda
Function
各種IoT GWサーバー
Amazon
QuickSight
Amazon
Redshift
cluster
AWS
Glue
Amazon
SageMaker
IoTセキュリティ
データレイク
セキュリティ
サーバーレス
セキュリティ
ITインフラストラクチャセキュリティ
デジタル
セキュリティ
トランスフォー
メーション
ITセキュリティ
トランスフォー
メーション
カタログデータ
Amazon
Glacier
アーカイブデータ
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
関連セッション
サーバーレスセキュリティ
10/31(水) 11:20~ Serverless Application Security on AWS
データレイクセキュリティ
11/1(木) 15:20~ Data Lake Security on AWS
IoTセキュリティ
11/1(木) 14:00~ IoTにおけるセキュリティ
ITインフラストラクチャセキュリティ
10/30(火) 14:00~ Threat Detection and Remediation on AWS
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ありがとうございました

Serverless Application Security on AWS

  • 1.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Serverless Application Security on AWS Hayato KIRIYAMA | Oct 31, 2018
  • 2.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 自己紹介 氏名: 桐山隼人 役職: シニアセキュリティソリューションアーキテクト 業務: 顧客提案、ソリューション開発、市場開拓 プロフィール: 外資系総合IT会社の開発研究所にて開発エンジニア、セキュリティベンダーにて 技術営業を経た後、現職。CISSP, CISA, ITIL, MBA, セキュリティ関連特許多数。 クラウドセキュリティに関するセミナー登壇・記事寄稿など。 @hkiriyam1 RSA Conference 2017 APJ 「Cloud Security Strategy」 Session Speaker AWS Summit Tokyo 2017 「AWSで実現するセキュリティ・オートメーション」 (マイナビニュース) 「IoTビジネスとセキュリティ を3段階と4要素で理解する」 記事寄稿 (ISC)2 Information Security Leadership Achievements Asia-Pacific Award 2018
  • 3.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. サーバーレスアプリケーションの特長 サーバー管理が不要 柔軟なスケーリング アイドル時リソース確保不要 高可用性
  • 4.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 開発者とAWSの役割分担 電源・ネットワーク ラッキング HWメンテナンス OSパッチ ミドルウェアパッチ 定形運用設計 スケールアウト設計 ミドルウェア導入 OS導入 アプリケーション作成 オンプレミス 独自構築 on EC2 マネージドサービス 開発者が担当 AWSが担当 電源・ネットワーク ラッキング HWメンテナンス OSパッチ ミドルウェアパッチ 定形運用設計 スケールアウト設計 ミドルウェア導入 OS導入 アプリケーション作成 電源・ネットワーク ラッキング HWメンテナンス OSパッチ ミドルウェアパッチ 定形運用設計 スケールアウト設計 ミドルウェア導入 OS導入 アプリケーション作成 サーバーレス アーキテクチャ 電源・ネットワーク ラッキング HWメンテナンス OSパッチ ミドルウェアパッチ 定形運用設計 スケールアウト設計 ミドルウェア導入 OS導入 アプリケーション作成
  • 5.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. サーバーレスなアプリケーションモデル
  • 6.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. RESTful Microservices AWS LambdaAmazon API Gateway Amazon DynamoDBClient
  • 7.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS Lambda 100ms
  • 8.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway API API AWS Auth DDoS API
  • 9.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. サーバーレスのユースケース Web Applications Data Processing ChatbotsBackends </></> Amazon Alexa Autonomous IT • Static websites • Complex web apps • Packages for Flask and Express • Real time • MapReduce • Batch • Powering chatbot logic • Apps & services • Mobile • IoT • Powering voice-enabled apps • Alexa Skills Kit • Policy engines • Extending AWS services • Infrastructure management
  • 10.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Backends / Amazon API Gateway Amazon DynamoDB Amazon S3Amazon CloudFront Amazon Cognito Lambda function
  • 11.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Stream Data Processing Amazon Kinesis Lambda function Amazon DynamoDB
  • 12.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Web Application
  • 13.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. サーバーレスアプリケーションを構成する層 Compute Layer Data LayerMessaging and Streaming Layer User Management and Identity Layer System Monitoring and Deployment Layer Edge Layer AWS Lambda Amazon API Gateway AWS Step Functions Amazon DynamoDB Amazon S3 Amazon CloudFront Amazon Elasticsearch Service Amazon SNS Amazon Kinesis Amazon Cognito Amazon CloudWatch AWS X-Ray
  • 14.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Well-Architected Serverless Application
  • 15.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Framework クラウドにおけるシステム設計・運用のベストプラクティス集 Framework
  • 16.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Well-Architected Framework Serverless Application Lens ワークロード固有の考え方やベストプラク ティスにフォーカスを当てたレンズ(Lens) サーバーレスアプリケーションに関しても、 Well-Architected Frameworkの5つの柱 でまとめられている https://d1.awsstatic.com/whitepapers/architecture/AWS-Serverless-Applications-Lens.pdf
  • 17.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. セキュリティの柱 ビジネスにおける価値を生み出しながら、リスクアセスメントと防御戦略 により、情報、システム、資産を守る能力 • IDとアクセス管理 • 発見的統制 • インフラストラクチャー保護 • データ保護 • インシデントレスポンス
  • 18.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. IDとアクセス管理の考慮事項 1. APIアクセスの認証認可をどのようにしていますか? 2. LambdaファンクションがアクセスできるAWSサービスを どのように保護していますか? 考え方例 • ユーザー管理とアイデンティティ管理 • IAMの活用 • 既存IdPの活用 • 最小権限の原則
  • 19.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Amazon Cognito User Pools モバイルおよびWebアプリに サインアップとサインインの機 能を簡単に追加 ユーザ管理を簡単に 電話番号やemailアドレスのの 検証と多要素認証の提供 拡張されたセキュリティ機能 数億のユーザまでスケールす るユーザディレクトリを作成・ 管理するシンプル、セキュア、 低コストでフルマネージドな サービス マネージド型 ユーザディレクトリ
  • 20.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. API Gatewayアクセス認可の方法 1. Cognito User Pools Authorizer 2. AWS IAM Authorization 3. Lambda Authorizer
  • 21.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Cognito User Pools Authorizer Mobile app AmazonAPI Gateway Amazon Cognito User Pools Amazon DynamoDB Lambda function 4. Validate Access or Identity token 5. Invoke API Call 6. Access AWS Resources
  • 22.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS IAM Authorization Mobile app Amazon DynamoDB Lambda function AmazonAPI Gateway Amazon Cognito User Pools AWS Identity & Access Management Amazon Cognito Identity Pools 3. Request AWS credentials 4. Validate Id token 5. Temp AWS credentials 8. Invoke Lambda
  • 23.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. IAM Policy Detail { "Version": "2012-10-17", "Statement": [ { "Action": "execute-api:Invoke", "Effect": ”Allow", "Resource": "arn:aws:execute-api:*:*:ff5h9tpwfh/*" }, { "Action": "execute-api:Invoke", "Effect": "Deny", "Resource": "arn:aws:execute-api:*:*:ff5h9tpwfh/*/POST/locations/*" } ] }
  • 24.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Custom Authorizer Lambda function Mobile app Lambda function AmazonAPI Gateway Amazon DynamoDB AWS Identity & Access Management Lambda Authorizers 4. Check policy cache 5.Validatetoken 6.Generateandreturn userIAMpolicy 8. Invoke
  • 25.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Lambda Authorizer Function Sample Code var testPolicy = new AuthPolicy(”userIdentifier", "XXXXXXXXXXXX", apiOptions); testPolicy.allowMethod(AuthPolicy.HttpVerb.POST, "/locations/*"); testPolicy.allowMethod(AuthPolicy.HttpVerb.DELETE, "/locations/*"); callback(null, testPolicy.getPolicy());
  • 26.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 発見的統制の考慮事項 3. サーバーレスアプリケーションのログをどのように 分析していますか? 4. アプリケーションの依存関係や脆弱性をどのように 監視していますか? 考え方例 • アプリケーションログは、CloudWatch Logsの利用 • AWSサービスAPI呼び出しは、CloudTrailの利用 • ログに機微な情報が含まれる可能性の配慮 • 脆弱性やアプリケーション依存関係の追跡
  • 27.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. メトリクスとログ CloudWatchメトリクス • 標準 • Invocations • Duration • Throttles • Errors • カスタムメトリクスの作成 CloudWatch Logs • 呼び出しごとに「START」、 「END」、「REPORT」エン トリがCloudWatch Logsに出 力される • 独自のログエントリを出力 • 可視化のためにサードパーテ ィツールを利用
  • 28.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS X-Rayを使ったトラブルシューティング AWS X-Rayを用いることでサービス間のイベン トの遷移を可視化 Lambdaファンクションから他のサービスに対す る呼び出しと時間をトレース ファンクションとサービスの依存関係、関連性 を実際に目視 消えたイベントやスロットルといった状態を確 認したり診断したりが簡単に 簡単なセットアップ 簡単セットアップ AWS Lambda Amazon S3 Amazon DynamoDB
  • 29.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS X-Rayを使ったトラブルシューティング 非同期呼び出しの滞留時間とリトライを確認 AWSサービスに対する呼び出しパフォーマンスをプロファイリング • イベント処理の失敗を検知 • パフォーマンス問題の特定と修正が簡単に dwell times service call times retries
  • 30.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. インフラストラクチャー保護の考慮事項 5. LambdaファンクションがアクセスできるVPC内のAWSリソースに関し て、どのようにネットワーク境界を保護していますか? 考え方例 • Network ACLやSecurity Groupによるネットワーク境界保護 (参考:考え方は一般のWell-Architected Frameworkと同じ)
  • 31.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. データ保護の考慮事項 5. サーバーレスアプリケーション内の機微な情報をどのように 保護していますか? 6. どのように入力値チェックをしますか? 考え方例 • 通信データの暗号化 • クライアントサイド暗号化 • ログに機微な情報が含まれる可能性の配慮 • JSONスキーマやURIパラメータ、クエリ文字列、ヘッダー妥当性検証 • アプリケーションレベルの入力値検証
  • 32.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 保護すべきデータの外部化 AWS Systems Manager Parameter Store AWS Secrets Manager • 設定データの安全なストレージで、 シークレットを含めることができる • 作成中に指定したユニークな名前を 使って値を参照する • 設定や自動化にはスクリプト内のパラ メータを使用する • 無料 • 組織内のシークレットのライフサイクルを管理 • 自動的にシークレットをローテーションすることで セキュリティとコンプライアンスの要件を満たす 手助けになる • Amazon RDS との組み込みの連携機能はデータ ベースの認証情報をローテーションする事ができる • Lambda で拡張可能 • シークレット毎、アクセス毎に課金
  • 33.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS Systems Manager Parameter Store • Run Command、Automation、State Managerから参照可能 • 例:Run Commandから参照する場合 • KMSで暗号化していた値を参照する場合 • Parameter Storeを参照するインスタンスにIAM Roleを付与後に参照 aws ssm send-command --instance-ids i-1a2b3c4d5e6f7g8 ¥ --document-name AWS-RunPowerShellScript ¥ --parameter '{"commands":["echo {{ssm:param}}"]}' { "Effect": "Allow", "Action": [ "kms:Decrypt", ], "Resource": [ "arn:aws:kms:region:account_id:key/key_id" ]
  • 34.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. EC2 AWS プラットフォーム Secrets Manager AWS リソース その他の リソース AWS 認証情報 を提供 DB 認証情報 を保存 安全な ロー テーション この組み合わせは、すべての認証情報に対して信頼性が高く、 安全な自動ローテーションをアプリケーションに提供する
  • 35.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. シークレットをローテーションする AWS Secrets Manager アプリケー ション 統合された バックエンド リソース 1) ローテーション のイベント 2) 新しい認証情報 の作成を開始 3) 新しい認証情報 作成完了4) 新しい認証情報 の提供を開始 5) 新しいバージョンの シークレットを取り出し 6) 新しい認証情報で接続
  • 36.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. インシデントレスポンスの考慮事項 (参考:考慮事項は一般のWell-Architected Frameworkと同じ) セキュリティインシデントについて調査や対応ができるように どのような準備をしていますか? 考え方例 • 人、ツール、プロセスの定義 • インシデント対応訓練の実施 • セキュリティ・オートメーション
  • 37.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. セキュリティ・オートメーション Amazon GuardDuty IP GuardDuty CloudWatch Events Lambda Amazon GuardDuty Amazon CloudWatc h CloudWatc h Event Lambda Function AWS Lambda Firewall Manager Account 2 Account 3 Account 1 AWS WAF
  • 38.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 侵入テスト https://aws.amazon.com/jp/security/penetration-testing/ AWS AWS • EC2(*) • RDS(*) • Aurora • CloudFront • API Gateway • Lambda • Lightsail • * m1.small, t1.micro, t2.nano EC2 RDS URL • • • • •
  • 39.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. デジタルトランスフォーメーション 時代のセキュリティ
  • 40.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWSが加速する2つの変革 デジタルトランス フォーメーション ITトランス フォーメーション • 新しい顧客体験 • 革新的な製品や サービスの創造 • 新ビジネスモデルへ の移行 • IoT, AI, モバイル等 新しい技術の応用 • トライ&エラー… • 本業に集中 • ITコスト削減 • グローバル展開、 BCP等の付加価値 • セキュリティ • システム堅牢性向上
  • 41.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. DX時代の新しいセキュリティ技術領域 各種センサー 各種クライアント 各種モバイルデバイス Amazon S3 AWS Lambda Function 各種IoT GWサーバー Amazon QuickSight Amazon Redshift cluster AWS Glue Amazon SageMaker IoTセキュリティ データレイク セキュリティ サーバーレス セキュリティ ITインフラストラクチャセキュリティ デジタル セキュリティ トランスフォー メーション ITセキュリティ トランスフォー メーション カタログデータ Amazon Glacier アーカイブデータ
  • 42.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 関連セッション サーバーレスセキュリティ 10/31(水) 11:20~ Serverless Application Security on AWS データレイクセキュリティ 11/1(木) 15:20~ Data Lake Security on AWS IoTセキュリティ 11/1(木) 14:00~ IoTにおけるセキュリティ ITインフラストラクチャセキュリティ 10/30(火) 14:00~ Threat Detection and Remediation on AWS
  • 43.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. ありがとうございました