AWS Account Management im Unternehmensumfeld Andreas Heidötting – Director Systems Admin, NASDAQ Creative Commons: Namensnennung - Nicht-kommerziell - Keine Bearbeitung 3.0 http://creativecommons.org/licenses/by-nc-nd/3.0/de/
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 1
Inhalt • Verwendung mehrerer AWS Accounts • Entdeckung von Angriffen • Einleitung von Gegenmaßnahmen • Vermeidung von Konsequenzen • Aufgaben- und Funktionstrennung • Ressourcen- und Benutzerverwaltung • Schutz von Logfiles, Backups, geistigem Eigentum • Absicherung der AWS Zugänge • Angriffserkennung, Alarmierung und Abwehr Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 2
Risiken • Unberechtigter Zugriff auf die AWS Konsole bzw. AWS APIs • Verlust der Kontrolle über Ressourcen- und Benutzerverwaltung • Verlust bzw. Manipulation von Daten, Logfiles, Source Code • Zusätzliche Kosten, die durch den Missbrauch entstehen
• Haftung für die durch den Missbrauch entstehenden Schäden Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 3
Sicherheit bei einem Account Developer
Tester
Operations
ServiceDesk
Network
Storage
Data Base
Security
Audit
Hacker
CloudTrail Root User + Config Security Challenge EC2 Identity & Access Management
RDS
RDS
EC2
Development
CloudWatch Logs
Test VPC Flow Logs
Password Policy Elastic Load Balancing Users +
Groups
CodeDeploy
Lambda EC2
RDS
RDS
EC2
Integration
Production
S3
Backups
CodePipeline
CloudFront
Policies Conditions
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
CodeCommit
Logfiles
Intellectual Property
AWS Account
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 4
Mehrere Accounts Intellectual Property
Development Hacker
Test
Backup
Integration
Logging
Production
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Billing
Access & Identity Management
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 5
Abrechnung Development
Identity & Access Management
Test
Logging
Integration
Backup
Production
Intellectual Property
S3 Detailed Billing Billing
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 6
Identitäts- und Zugriffsverwaltung Roles Root User + Developer
Network
Development
Billing
Security Challenge
Identity & Access Management Tester
Roles
Users +
Storage
Password Policy
Roles
Roles
Root User + Test
Logging
Security Challenge Users + Operations Data Base
Identity & Access Management Groups Roles
ServiceDesk Security
Roles Integration
Roles Backup
Policies Policies Conditions Conditions
Audit
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Identity & Access Management
Example
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
Roles Production
Roles Intellectual Property
CC BY-NC-ND 3.0 7
Systemumgebungen Roles
Identity & Access Management Account
Development Account
Test Account
Integration Account
Production Account
IAM Master Role
Create / Modify Policies Enable IAM Manager
Create / Modify Policies Enable IAM Manager
Create / Modify Policies Enable IAM Manager
Create / Modify Policies Enable IAM Manager
Create / Modify Policies Enable IAM Manager
IAM Manager Role
Create Users / Groups Use Pre-Defined Policies
Create Roles Use Pre-Defined Policies
Create Roles Use Pre-Defined Policies
Create Roles Use Pre-Defined Policies
Create Roles Use Pre-Defined Policies
Developer
Assume Developer Role
Limited
Read Only
Read Only
None
Tester
Assume Tester Role
Read Only
Limited
Limited
None
Operations
Assume Operations Role Assume IAM Manager Role
Limited
Limited
Limited
Limited
ServiceDesk
Change User passwords
None
None
None
None
Network
Assume Network Role
Limited
Limited
Limited
Limited
Storage
Assume Storage Role
Limited
Limited
Limited
Limited
Data Base
Assume Data Base Role
Limited
Limited
Limited
Limited
Security
Assume Security Role Assume IAM Master Role
Limited
Limited
Limited
Limited
Audit
Assume Audit Role
Read Only
Read Only
Read Only
Read Only
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 8
Systemumgebungen Roles
Roles
Identity & Access Management Developer
Network Password Policy Users +
Tester
EC2
RDS
EC2
Application 1
Storage
RDS
Application 2
EC2
RDS
EC2
Application 1
Development
RDS
Application 2 Test
Groups
Operations Data Base
Roles
Policies
Roles
Conditions ServiceDesk Security
Identity & Access Management EC2
RDS
Application 1 Audit
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
EC2
RDS
Application 2
Integration
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
EC2
RDS
EC2
Application 1
RDS
Application 2
Production
CC BY-NC-ND 3.0 9
Identitäts- und Zugriffsverwaltung • Absichern des AWS Root Users • Setzen einer sicheren Passwort-Richtlinie • Erstellen von IAM Benutzern • Verwendung von Multi-Faktor-Authentifizierungs-Geräten • Verwendung von IAM Gruppen • Vergabe von minimalen Zugriffsrechten • Einschränkung des Zugriffs durch Bedingungen in Richtlinien • Verwendung einer zentralen Benutzerverwaltung • Verwendung von IAM Rollen Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 10
Protokollierung CloudTrail
SNS
Network
SNS
Config
Config Developer
CloudTrail
Identity & Access Management
CloudWatch Logs VPC Flow Logs
Tester
Storage
CloudTrail
SNS
Elastic Load Balancing
Users +
+ Versioning + MFA Delete + Replication
+ Versioning + MFA Delete
Region 1
Region 2
Lambda SQS
Lambda
Config Operations Data Base
Backup Account
Config
SES
Logging Account
CloudFront
S3 ServiceDesk Security
CloudTrail Config
Audit
Billing Account
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
SNS
Environment Accounts [Development] [Test] [Integration] [Production] Intellectual Property
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 11
Datensicherung Roles
EC2
RDS
EC2
Application 1
Roles
RDS
Application 2
EC2
RDS
EC2
Application 1
Development
Users +
RDS
Application 2 Test
Roles
Roles
S3 + Versioning + MFA Delete + Replication
S3 + Versioning + MFA Delete
EBS Snapshots + Sharing + Copy + Replication
EBS Snapshots + Sharing + Copy
RDS Snapshots + Sharing + Copy + Replication
RDS Snapshots + Sharing + Copy Region 2
Region 1
EC2
RDS
Application 1 Integration
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
EC2
RDS
Application 2
EC2
RDS
Application 1
EC2
RDS
Application 2
Production
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
Backup Account
CC BY-NC-ND 3.0 12
Geistiges Eigentum EC2 Shared AMIs
CodeCommit
EC2 Shared AMIs
CodePipeline S3 + Versioning + MFA Delete EC2 AMIs + Sharing
EC2
EC2
EC2
EC2
CodeDeploy
CodeDeploy
CodeDeploy
CodeDeploy
Application 1
Application 2
Application 1
Application 2
Development
Test
Reproducible Builds
OpsWorks
EC2 Shared AMIs
EC2 Shared AMIs
Desired State Configuration EC2
EC2
EC2
EC2
CodeDeploy
CodeDeploy
CodeDeploy
CodeDeploy
Application 1 Intellectual Property
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Application 2
Application 1
Integration
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
Application 2
Production
CC BY-NC-ND 3.0 13
Funktionsumgebungen Roles
Billing Account
Logging Account
Backup Account
Intellectual Property Account
IAM Master
Create / Modify Policies Enable IAM Manager
Create / Modify Policies Enable IAM Manager
Create / Modify Policies Enable IAM Manager
Create / Modify Policies Enable IAM Manager
IAM Manager
Create Roles Use Pre-Defined Policies
Create Roles Use Pre-Defined Policies
Create Roles Use Pre-Defined Policies
Create Roles Use Pre-Defined Policies
Developer
None
Read Only
Read Only
Commit Code
Tester
None
Read Only
Read Only
Deploy Code to Test
Operations
Read Only
Read Only
Read Only
Deploy Code to Intergation Deploy Code to Production
ServiceDesk
None
Read Only
Read Only
None
Network
None
Read Only
Read Only
None
Storage
None
Read Only
Read Only
None
Data Base
None
Read Only
Read Only
None
Security
None
Read Only
Read Only
Read Only
Audit
None
Read Only
Read Only
Read Only
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 14
Funktionsumgebungen • Aktivierung der Protokollierung • Aggregieren von Logfiles • Schutz von Logfiles • Tools zur Analyse und Überwachung • Erstellung von Backups • Zentralisierung von Backups • Schutz von Backups • Zentralisierung von geistigem Eigentum • Schutz von geistigem Eigentum Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 15
IAM Credential Report • Verwendung des IAM Credential Reports • Entfernen von ungenutzten IAM Usern • Entfernen von ungenutzten IAM User Konsolen-Passwörtern • Entfernen von ungenutzten IAM User API Access Keys • Zwei API Access Keys pro IAM User • Rotation der API Access Keys • Keine API Access Keys für den AWS Root User, IAM Master, IAM Manager • IAM Rollen für Applikationen, die auf Amazon EC2 Instance laufen Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 16
Erreichbarkeit • Kontrolle der eignen Kontaktdaten • Zusätzliche Ansprechpartner
• Kontrolle der von Amazon verschickten E-Mails
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 17
Überwachung mit CloudWatch Logs OS & App Logs
VPC Flow
Lambda
CloudWatch Logs
Metric Filter + Alarm
Email / SMS
CloudTrail Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 18
CloudWatch Logs + Metric Filter / Alarm • Verwendung des Root Users • Verwendung der AWS Konsole ohne MFA-Gerät • Verwendung der AWS API ohne MFA-Gerät • Fehlgeschlagene Anmeldeversuche an der AWS Konsole • Verwendung von nicht erlaubten API Kommandos • Veränderung von IAM Richtlinien • Verwendung großer EC2 Instanz-Typen • Veränderung der CloudTrail-Einstellungen Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 19
CloudTrail / Root User CloudTrail
CloudWatch Logs
Quelle:
CloudTrail Events in CloudWatch Logs
Dienst:
CloudWatch Logs Metric Filter
Filter:
{ $.userIdentity.type = "Root" &&
Metric Filter + Alarm
Email / SMS
$.userIdentity.invokedBy NOT EXISTS && $.eventType != "AwsServiceEvent" }
Alarm:
Summe >= 1 in 5 minute(s)
Aktion:
Send E-Mail notifications
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 20
Beispiele • CloudTrail/AWS Konsole ohne MFA-Gerät { $.eventName = "ConsoleLogin" && $.additionalEventData.MFAUsed != "No" } • CloudTrail/AWS APIs ohne MFA-Gerät { $.userIdentity.sessionContext.attributes.mfaAuthenticated != "true" • CloudTrail/nicht erlaubte API Kommandos { ($.errorCode = "*UnauthorizedOperation") || ($.errorCode = "AccessDenied*") } • CloudTrail/große EC2 Instanz-Typen { ($.eventName = RunInstances) && (($.requestParameters.instanceType = *.8xlarge) || ($.requestParameters.instanceType = *.4xlarge)) } • CloudTrail/Veränderung an CloudTrail { ($.eventName = CreateTrail) || ($.eventName = UpdateTrail) || ($.eventName = DeleteTrail) || ($.eventName = StartLogging) || ($.eventName = StopLogging) } Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 21
Beispiele • CloudTrail/Veränderung von IMA Richtlinien {($.eventName=DeleteGroupPolicy)||($.eventName=DeleteRolePolicy)|| ($.eventName=DeleteUserPolicy)||($.eventName=PutGroupPolicy)|| ($.eventName=PutRolePolicy)||($.eventName=PutUserPolicy)|| ($.eventName=CreatePolicy)||($.eventName=DeletePolicy)|| ($.eventName=CreatePolicyVersion)||($.eventName=DeletePolicyVersion)|| ($.eventName=AttachRolePolicy)||($.eventName=DetachRolePolicy)|| ($.eventName=AttachUserPolicy)||($.eventName=DetachUserPolicy)||( $.eventName=AttachGroupPolicy)||($.eventName=DetachGroupPolicy)}
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 22
CloudTrail / Anmeldeversuche an der AWS Konsole
CloudTrail
CloudWatch Logs
Metric Filter + Alarm
Quelle:
CloudTrail Events in CloudWatch Logs
Dienst:
CloudWatch Logs Metric Filter
Filter:
{ ($.eventName = ConsoleLogin) && ($.errorMessage = "Failed authentication") }
Alarm:
Summe >= 3 in 5 minute(s)
Aktion:
Send E-Mail notifications
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
Email / SMS
CC BY-NC-ND 3.0 23
CloudWatch Logs + Lambda OS & App Logs
SNS
Email / SMS
VPC Flow
Lambda
CloudWatch Logs
Lambda Parsing Logic
Action
CloudTrail Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 24
Gegenmaßnamen • Verwendung der AWS Konsole ohne MFA-Gerät => Benutzer sperren • Fehlgeschlagene Anmeldeversuche an der AWS Konsole => Benutzer sperren • Verwendung der AWS API ohne MFA-Gerät => API Zugriff sperren
• Verwendung großer EC2 Instanz-Typen => Stoppen der Instanzen Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 25
Einschränkungen / Kosten • Lambda Funktionen pro AWS Account • Kosten für Langzeitarchivierung
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 26
Überwachung mit CloudWatch Logs OS & App Logs
Lambda Parsing Logic
SNS
Email / SMS
VPC Flow
Lambda
CloudWatch Logs
Kinesis Action
Amazon S3
CloudTrail Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 27
Überwachung von CloudTrail / Config via S3 < 15 m
CloudTrail
SNS
S3 Bucket CloudTrail Logs < 6h
Config
Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
Email / SMS
Lambda Parsing Logic
S3 Bucket Config Logs
Action
Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 28
Überwachung von CloudFront / S3 / ELB via S3 < 15 m
S3 Bucket CloudTrail Logs
CloudFront < 15 m
SNS S3 Bucket CloudTrail Logs
S3 < 15 m
Email / SMS
Lambda Parsing Logic
Action ELB Donnerstag, 28. Januar 2016 09:00 Uhr MEZ
S3 Bucket ELB Logs Amazon Web Services Security Cloud Web Day AWS Account Management im Unternehmensumfeld
CC BY-NC-ND 3.0 29
Überwachung Config via SNS / Rules