SlideShare uma empresa Scribd logo
1 de 68
Baixar para ler offline
Pragmatic Cloud Security: Hands-On
Turbocharged Edition
Rich Mogull

@rmogull

rmogull@securosis.com
1
‣ Four days of training…

‣ in four hours

‣ Nearly all labs

‣ Some of you won’t be able to keep up

‣ That’s okay, you have the materials to go through later

‣ Doesn’t mean you’re dumb, just that it’s outside your experience

‣ We probably won’t get through everything. This really is material
taken from 4 days of training, slimmed down as best we can
What to Expect
2
Really… costs are minimal for our 4 hours, but will add up if you leave things running.
Reminder: We are not responsible for your AWS bill if you forget to
delete things after class finishes.
3
‣ All labs are how it's done for real, these aren't merely academic exercises.

‣ Part 1: we will configure a production-quality account with multiple virtual
networks and core security controls.

‣ Part 2: we will build a deployment pipeline, integrate it into our existing
application stack, and code a variety of security automation controls.

‣ Most programming labs and examples are in Ruby, with some use of Python. 

‣ We provide enough code that those of you with less experience can still
participate.

‣ Nearly all labs are in Amazon Web Services

‣ AWS is 85% of the market and the most mature (for now)

‣ We will reference Azure and Google Compute Cloud, but all the labs are in
AWS due to logistics as much as anything
Labs
4
There is minimal hand holding.

We don't have slides for every step.
5
Architecting with Accounts
W
hiteboard
6
W
hiteboard
Root Account Security
7
Important Lab Note

All labs should be performed in the
us-west-2 (Oregon) region unless
otherwise specified
8
‣ Enable MFA 

‣ Authy is free, easy, and on iOS and Android

‣ Disable Access Keys

‣ Create new IAM user with the “Administrator”
managed policy attached

‣ Use that user for the remainder of class
AWS Root Account Security Lab
9
Identity and Access
Management
10
‣ Users

‣ An individual/account capable of logging into AWS 

‣ Groups

‣ A collection of users

‣ Roles

‣ Temporary permissions other entities can assume

‣ Core to internal AWS services and federation

‣ Policies

‣ The core of IAM

‣ Managed and Inline options

‣ Identity Providers

‣ SAML support

‣ Console URL

‣ How IAM users can log into your account
AWS IAM Primitives
11
‣ Access/Secret Keys

‣ For API calls

‣ Uses Signature 4 HTTP request signing

‣ Username/Password

‣ MFA
‣ Host keys (Linux)

‣ Administrator Password (Windows)

‣ SSH keys (CodeCommit today, maybe more later)
Credentials
12
‣ JSON, but a specific policy
language

‣ Inline apply to a single entity

‣ Generally limit use

‣ Managed policy updates roll out
to all linked entities

‣ Supports versioning

‣ Advanced capabilities for
dynamic use

‣ Especially conditionals
Policies
13
Creating Policies
Policy Generator Hand-Editing
14
Testing Policies
https://policysim.aws.amazon.com
15
Using Roles (Demo)
16
‣ Create a new role for EC2 Instances

‣ Name it “Dev”

‣ We need this later, do NOT use a
different name

‣ Assign the PowerUserAccess role

‣ Launch an instance with the role
assigned

‣ Log in

‣ From the command line, type:

‣ aws ec2 describe-instances
‣ aws iam list-users
‣ It work? Terminate
Lab: Create an Instance Role
17
Using Conditionals (Demo)
18
‣ Write an IAM policy that restricts a user
to only a single region

‣ Write an IAM policy that allows an
administrator to manage their own MFA,
and requires MFA to log into the
console.
Lab: IAM Policies with Conditionals
Check
the
cheat
sheet
if
you
get
stuck
19
Cloud Network Security
20
AWS Network Primitives
Account
Virtual Network
Public Subnet
Security
Group
Virtual Network
Private Subnet
Security
Group
Route Table
Elastic Network
Interface
ACLs
Service Endpoints
Internet Gateway Customer Gateway
21
Network segregation by default
cba
Web
X X
Granularity of a host firewall with the manageability of a network firewall
22
How Amazon’s Network Works
https://www.youtube.com/watch?v=yZtKcZdsCJk
W
hiteboard
23
Fix the VPC
24
‣ Go into CloudFormation

‣ Launch the stack using the
template: 

‣ http://s3.amazonaws.com/
Securosis-CCSK/BlackHat/
Vpclab.template

‣ SSH to the public instance

‣ SSH to the private instance
Fix the VPC
25
26
27
28
29
VPC Peering
30
‣ Allocate a new Elastic IP

‣ Create a second VPC with public and
private subnets

‣ Use the VPC wizard

‣ Name it “website”

‣ Use a CIDR of 192.168.0.0/16

‣ Create /24 subnets

‣ Launch a default Amazon Linux in the
private subnet 

‣ With security group called “temp”
allowing port 22 from your IP
VPC Peering Lab
31
‣ Name the peering connection
“website-admin peer”

‣ Doesn’t matter which VPC is in
which place

‣ Accept the request

‣ No IAM needed since this is all in
your account

‣ Adjust your routing tables on each side
to support the peering connection

‣ You could use ACLs to get fancy, but
that will also probably break things
Peer the VPCs
32
Connect to your instance in the
Private “website” subnet from your
Admin jump box
Pro tip- you need to add the Security Group ID to the website
security group for the admin group using cut and paste.
33
Now terminate the instance.
Hopefully you weren’t emotionally
attached.
34
Elastic Load Balancers and Auto
Scale Groups
W
hiteboard
35
‣ Create a Load Balancer

‣ Name: CloudSecWebsite

‣ Pick the website VPC and the public
subnet

‣ Remap port 80 to port 4567

‣ Select the public subnet

‣ Create a new security group

‣ Name: Website ELB

‣ Port 80 wide open

‣ Health Check: TCP 4567
Lab: Auto Scale Group behind an ELB
36
‣ Create a Launch Configuration

‣ Use ami-b73efed7

‣ Assign the “Dev” role

‣ Assign a public IP address to every instance
(under the advanced tab)

‣ Security Group 

‣ Name “Website Server” 

‣ Port 4567 open from sg-[Website ELB]

‣ Create an auto scale group with min/max/desired of 1

‣ Name it “Website”

‣ Apply a tag “Environment” with value “Production”
and apply to new instances

‣ Choose your Website VPC and public subnet

‣ Receive traffic from your ELB (Advanced)
Lab: Auto Scale Group behind an ELB
37
38
Go to your ELB URL
39
Service Endpoints
W
hiteboard
40
‣ Directly route traffic from a private AWS network to an Amazon
service.

‣ Right now, only have S3, but more coming

‣ Without them, instances need public Internet access

‣ Also reduce costs since you aren’t routing to the Internet

‣ Managed by VPC networking and the mapping service, which
handles translation of the URL to connect to the AWS service

‣ Most services require Internet access (e.g. Dynamo, SQS)
Service Endpoints
41
‣ Create an S3 Service Endpoint

‣ In your Website VPC

‣ Go back to your web site ELB

‣ See the boom?
Service Endpoint Lab
W
hat’s
Going
On
42
‣ The service endpoint routes traffic
internally to S3

‣ Only works in the same region

‣ Our app pulls a URL from a
configuration file in S3

‣ S3 sees it as internal, not as normal
IP access

‣ Our bucket policy on the config file
only allows non-IP-based access

‣ If it’s inside your own account, you
can use an IAM role instead
What’s Going On
43
Monitoring and Logging
44
What’s different
Management Plane Velocity Distribution/Segregation
Account
Virtual Network
Subnet
Security
Group
Virtual Network
Subnet
Security
Group
Account
Virtual Network
Subnet
Security
Group
Virtual Network
Subnet
Security
Group
45
Management Plane Security Monitoring
Direct Proxy
46
47
Cascading Architecture
Dev Test Prod
Logs
Security Monitoring
SIEM
Project Accounts
Security Account
In Datacenter
48
‣ Filter logs down before you transfer over the Internet. All cloud
providers charge by the byte, and your goal is to manage costs
instead of just pushing everything into the SIEM

‣ Management plane logs will have less data than instances and
other sources, but it can still add up.

‣ We’ll cover filtering priorities in a bit.

‣ You need to correlate what accounts you have to what is being
logged. This varies by provider, but typically you compare billing and
project IDs to those in your logs.

‣ Project logs should be readable by project admins only within their
project storage.
Important Points
49
AWS Core Tools
CloudTrail CloudWatch Config
‣ Nearly all API calls
‣ Stored in S3
‣ Can push to CloudWatch
‣ S3 logs written every 5
minutes
‣ Can have up to a 15
minute delay
‣ JSON format
‣ Integrates with SNS to
notify when logs written
‣ 7 days visible in the
console
‣ Partial service coverage
with emphasis on EC2
and IAM.
‣ Tracks configuration
state over time and
what assets are affected
by what changes.
‣ Stored in S3
‣ Visualize in console
‣ Can enforce Config
Rules
‣ AWS’s native log service
‣ First job is monitoring for
performance, auto scaling,
etc.
‣ Can accept Log Streams
from other sources, like
CloudTrail
‣ Visible in console, stored
internally, export via API or to
S3
‣ Supports Events and Rules
‣ Native filtering for alarms to
SNS
‣ Can accept syslog or other
arbitrary streams
50
‣ Enable CloudTrail in all regions

‣ Send to a secure S3 bucket with
restrictive IAM rights

‣ Don’t worry about encrypting, but it’s
an option for highly-sensitive
environments.

‣ Stream to CloudWatch

‣ You’ll see why later

‣ Enable Config

‣ Turn on VPC flow logs (in the VPC
section of the console)
Lab: Initial Configuration
51
‣ Can be a tougher problem, and depends a ton on your specific
requirements

‣ Instances/virtual machines have shorter lifespans, and different
ones may share the same IP address and name throughout the
course of the day.

‣ Becomes critical to capture the actual instance identifier

‣ Quite likely a higher volume of data, so cost management is a bigger
issue

‣ Key issue is build your own or leverage your platform
Server and Application Logs
52
Cascading System Logs
53
‣ We will set up a central log server using
fluentd

‣ We will modify rsyslog to add the instance
ID to log messages and send them to the
central logger

‣ We will configure fluentd to filter for
security events and save those to S3

‣ This creates a skeleton log framework that
can scale to far larger and more complex
scenarios
Lab: Cascading System Logging
54
‣ Log into your Admin instance

‣ Install fluentd

‣ sudo curl -L https://toolbelt.treasuredata.com/
sh/install-redhat-td-agent2.sh | sh
‣ Alter the configuration file to save events to S3

‣ See the Cheat Sheet for the specific commands and template

‣ Open port 5140 from 0.0.0.0/0

‣ Start it
Set up your log server
55
‣ Launch a new instance, or use any other running instance

‣ Log in and…

‣ Pull the instance ID using the metadata service

‣ Yes, you can get it from the console, but this is how you would
need to get it to script things

‣ Edit rsyslog.conf to push external logs and insert the instance ID
into the message

‣ You could also modify the hostname instead

‣ There are a lot of options for this part of the problem

‣ sudo service rsyslog restart
Set up an instance to push logs
56
‣ A regular instance won’t create
enough log files to trigger the push to
S3

‣ From the cheat sheet, create a log
generator

‣ Create an empty file in your home
directory named "log_generator.rb"

‣ Paste in the content from the cheat
sheet

‣ ruby log_generator.rb
‣ Run the log generator and keep an
eye on your S3 bucket
Generate Some Logs
57
‣ Fluentd supports all sorts of filtering,
parsing, and other log flow

‣ We can use this to store local project logs,
while also forwarding on security-sensitive
logs

‣ Un-comment the simple filter in our
configuration file

‣ This will now only push messages from
our filter generator into S3

‣ Feel free to play with something more
complex
Now Filter the Messages
58
Filtering and Alerting
Filter to focus security for cascading logs, alert for security response
CIS Benchmarks for AWS
Convert for your provider of choice
‣ Unauthorized API calls
‣ Management console log in without
MFA
‣ Any IAM policy change
‣ CloudTrail configuration changes
‣ Management console authentication
failures
‣ Disabling or scheduling the deletion
of a KMS Customer Managed Key
(encryption key)
‣ Any use of the root account
‣ Any S3 bucket policy changes
‣ AWS Config configuration changes
‣ Security group changes
‣ Network Access Control List changes
‣ Network gateway changes
‣ VPC changes (e.g. subnets, routing
tables, service endpoints)
59
‣ CloudTrail -> CloudWatch

‣ Metrics Filters

‣ Events (Rules)

‣ By far currently the fastest option

‣ Can trigger Lambda functions

‣ Config

‣ Rules
AWS Options
60
Introduction to DevOps
61
The Problem
Threats
New Tools and
Applications
Technical Debt
62
The Problem
Cloud
+
DevOps
New Tools and
Applications
63
‣ Cloud is a new operational model.

‣ It requires a re-thinking of fundamental
architectures.

‣ DevOps is a new operational framework, highly
attuned to cloud.

‣ Both shatter existing security approaches.
Cloud and DevOps
64
Why DevOps?
65
Application Deployment
Develop Commit Test Deploy
66
Complexity Breeds Error
Develop Commit Test Deploy
Team
Env
Dev QA Test Ops
Dev Test Test Stage Prod
67
Environments, Requirements, and Configurations
Drift
Dev Prod
68
Cycle Times Matter
Pre-Alpha Alpha Beta Gold
Agile? Waterfall?
All the same…
69
‣ Configurations drift over time.

‣ The less automated, the more the drift.

‣ Manual intervention creates error, reduces standardization.

‣ Environments become de-synced.

‣ Different teams work in different environments.

‣ The longer the update cycle, the greater the chances for error.
The Dev and Ops Problem
No standards
=
More complexity
70
‣ DevOps is an operational framework that
increases standardization, agility, and
reliability.

‣ It relies heavily on virtualization, cloud,
and automation.

‣ The principles come direct from Denning
and Lean Manufacturing.
Enter DevOps
https://workingsmartercafe.files.wordpress.com/2012/09/kool-aid-man.jpeg
71
Development Pipelines and Continuous
Deployment
Source Code
GitCloudformation
Templates
Jenkins
Functional Tests
Chef Recipes
Chef Server
NonFunctional
Tests
Security Tests
Test Prod
Chef Server Chef Server
72
10 Deploys a Day?
Commit
73
‣ All environments, including supporting third-party applications, are
consistent.

‣ The deployment pipeline is automated, for code, configurations, and
toolsets.

‣ There is no drift.There are no human-induced errors.

‣ Faster deployment cycles reduce error and improve business agility.

‣ Version control and consistency support instant rollback.
Why DevOps Works
74
[Sec]DevOps
And Rugged DevOps
75
DevOps is a Security
Dream!
76
Trustable Security
Automation!
77
‣ DevOps provides a consistency and control impossible with
manual application deployments.

‣ Security can easily embed and automate.

‣ Security can steal DevOps techniques to apply to diverse workloads
and infrastructure requirements.
DevOps + Security = ♡
78
‣ Integrate security tests into the deployment pipeline

‣ Build resilient server configurations

‣ Embrace Stateless Security

‣ Automate with Code and APIs
Building Your Toolkit
79
Yes, you need to learn some new
skills, but you don’t need to become
a programmer.
80
‣ Add security to deployment pipelines and
automate testing.

‣ New tools are here, but we need more…

‣ Build a library of server hardening scrips
and inject into config management.

‣ Integrate directly into your cloud service for
alerting/monitoring.

‣ Create a library of automation code you
can mix and match for different security
needs.
Winning SecDevOps
81
Instance (Server/Host) Security
82
‣ Don’t use ones you can’t validate

‣ If you use shared, get the direct image
ID from the source

‣ Many “certified, pre-owned” available

‣ Clean before creating

‣ Swap space

‣ Temp files

‣ Embedded keys

‣ Other credentials
Image Fundamentals
83
‣ Three types

‣ Normal/long-running

‣ Immutable

‣ Automated config management

‣ Deployment type may change host security
controls requirements

‣ Use encryption to protect snapshots

‣ New management techniques needed

‣ Config management changes

‣ Vulnerability assessment changes

‣ Patch management changes
Instance Fundamentals
84
‣ Amazon Inspector

‣ Agent-based vulnerability assessment

‣ Pretty basic, but fully integrated

‣ We will use it later for security automation by triggering using SNS

‣ Setup

‣ Inspector is already running in your auto scale group instances

‣ See the ansible-baseline.yml file we review later for install details

‣ Assuming you tagged the instances, they are ready to be inspected

‣ Configure Inspector in the AWS Console

‣ Create an assessment target to match “Environment: Production”

‣ Create an assessment template that uses the “Common Vulnerabilities and
Exposures” rules package
Lab: Vulnerability Assessment
85
Cloud-Scale Configuration
Management
W
hiteboard
86
‣Instead of updating, you completely
replace infrastructure through
automation.

‣Can apply to a single server, up to an
entire application stack.

‣Incredibly resilient and secure. Think
“servers without logins”.
The Power of Immutable
Image from: http://tourismplacesworld.blogspot.com/2012/07/uluru.html
87
Lab: Building a Deployment Pipeline
+
88
Before we start, if you get stuck there is a slide at the end of this
section with suggestions to solve common problems
89
‣ One of the most popular code repositories

‣ GitHub is only one hosting option

‣ Works better for most DevOps orgs due to different flow options

‣ Self hosted keeps all the data, but lacks visualization and other popular features in
GitHub (public or private), Stash, Bitbucket, etc.

‣ Always use SSH/TLS options (no self signed certs please), keep repo and OS up to
date, and lock it down tight. It’s the keys to the code kingdom.

‣ Excellent audibility. Copy/store logs externally for audit.

‣ CodeCommit is AWS’s hosted Git

‣ Resilient storage on S3

‣ Can be fully private and integrate with IAM

‣ Can encrypt with KMS
Git and CodeCommit Security
90
‣ Start in AWS and create your first CodeCommit repository

‣ Create a new IAM user called “Jenkins” and leave the console on that
page

‣ Create an empty repository called WebApp[random]
‣ Repository names have to be unique, so figure something out
‣ Configure your public Admin instance with Git for access

‣ Double check it has the Dev IAM role assigned

‣ Follow the instructions at http://docs.aws.amazon.com/codecommit/
latest/userguide/setting-up-ssh-unixes.html
‣ git clone <ssh://your repository’s URL>
Lab Part 1: CodeCommit
91
‣ Copy the files from the cloudsec
directory in the class Box folder into the
directory you just cloned

‣ The URL will be on your cheat sheet

‣ Rename the folder cloudsec

‣ Push the files to your repository

‣ git commit -a
‣ git push
Lab Part 1: CodeCommit
92
‣ Connect to your public Admin instance (you should still be)

‣ Enter these commands (on your cheat sheet):

‣ sudo wget -O /etc/yum.repos.d/jenkins.repo http://
pkg.jenkins-ci.org/redhat/jenkins.repo
‣ sudo rpm --import http://pkg.jenkins-ci.org/redhat/
jenkins-ci.org.key
‣ sudo yum install jenkins
‣ sudo service jenkins start
‣ sudo chkconfig --add jenkins
‣ Open port 8080 in your security group from your current IP address
Lab Part 2: Jenkins
93
‣ http://<your instance ip>:8080

‣ Get the temporary admin password

‣ sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Lab Part 2: Jenkins
94
‣ Then create your admin user

‣ Pick a super easy username and password

‣ 1234 is an excellent option

‣ Jenkins can run slave nodes, but our entire lab will be on a single master
Lab: Install Baseline Jenkins Plugins
95
‣ Go to Jenkins > Manage Jenkins >
Manage Plugins and install the following
plugins:

‣ Hudson Post build task

‣ Hudson Ruby plugin

‣ Packer Plugin

‣ Post-Build Script Plugin

‣ Parameterized Trigger plugin

‣ Ansible plugin

‣ Environment Plugin
Lab: Add Plugins
96
‣ Go to Credentials
‣ Click on the Jenkins store > Global Credentials > Add Credentials

‣ The kind is “SSH username with private key”

‣ The username is the same you created for CodeCommit
(remember, it will look like an Access Key and you find it in your
AWS IAM console for that user under SSH Keys

‣ Enter the private key directly (cut and paste)
Lab: Add Credentials for Git
97
Paste the private key here
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAsizp0lOUX4YSjTMxxR
98
‣ We’ll start by pulling from Git and
saying Hello World

‣ Don’t worry, we’ll build this out
pretty quickly

‣ Create a new job

‣ Name it “Website”

‣ Choose a Freestyle Project
‣ Keep in mind, this class focuses
on security and we won’t be
covering the ins and outs of
Jenkins
Lab: Create Your First Jenkins Job
99
Lab: Configure to Pull From CodeCommit
Enter your CodeCommit ssh url
Select the credentials you
just configured
Jenkins live-updates so you
will know right away if it works
100
‣ We will trigger our build
on Source Code
Management changes
(Git)

‣ Poll every minute by
typing “* * * * *” 

‣ There’s a space
between each *

‣ Add Build Step
‣ Our build (for now) will
just “Hello World”
Lab: Set the Build Trigger and Hello World
101
‣ In large projects this isn’t
necessarily a good idea since
creating everything from scratch
can take a lot of time

‣ Ours is small

‣ We set a file with parameters that
needs to be cleaned after every
build

‣ You could also just swap the
file programatically if you want,
but this ensures it’s always
clean during our experiments
Lab: Clean Workspace Between Builds
subnet-1c5f3d78
102
‣ Click Enable Auto
Refresh on the job
screen (upper right)

‣ Click Build Now

‣ Click on the job number

‣ Click on Console
Output
‣ Or change the
readme.md in the
repository and watch
the build start
automatically
Lab: Save the Job then Test
103
‣ Packer builds images for multiple clouds/
platforms based on templates

‣ We will use it to build a new, custom AMI
when we make code or configuration
changes

‣ Packer can build for multiple
environments based on a single template

‣ e.g. AWS AMI, Vagrant, Docker

‣ Manage Jenkins > Global Tool Configuration
> Add packer

‣ Name it “default”

‣ Check “Install automatically”

‣ Choose the latest linux amd64 version

‣ Save
Lab: Configure Packer
104
‣ Packer will create a new AMI based
on an existing base

‣ While it can configure the image
itself, we will use Ansible instead
since it’s more powerful

‣ Our Packer template will install
Ansible locally on the instance, then
run Ansible to configure the instance
based on a Playbook

‣ Ansible runs in local mode

‣ The Packer template is pasted into
Jenkins but the Ansible playbook is
pulled in from Git

‣ All files in Git are pulled into the
job’s workspace
Lab: Configure Packer to Use Ansible
105
‣ Within the job, go to
Configure
‣ Add a Post Build Action
‣ Choose Packer, check
Packer Template Text
‣ Paste in the text from
the cheat sheet

‣ Also paste in the
Additional Parameters

‣ Save
Lab: Configure Packer to Use Ansible
106
‣ Jenkins polls CodeCommit every minute, and will trigger the build on a change

‣ Using SSH credentials

‣ In the real world, you would make these read only

‣ Jenkins runs on an instance with an IAM role, so all the tools will use those credentials

‣ The build triggers and echoes “Hello World” to the console. For our lab we aren’t compiling code, so
that’s the only build action.

‣ Then Packer:

‣ Launches a new instance

‣ Connects over SSH

‣ Installs Ansible

‣ Runs Ansible using the playbook

‣ Shuts down the instance

‣ Creates a new AMI based on the running instance

‣ Cleans itself up
How This Works
107
Run The Build
Console output with your new AMI
108
‣ Continuous Integration tools are designed
not only to build code, but to automatically
test it

‣ We can leverage this for security testing

‣ Security unit tests

‣ Code scanning/assessment

‣ SAST/DAST/RAST

‣ Configuration and environment testing

‣ Vulnerability assessment
Automated Security Testing
109
‣ Gauntlt automates security tests
with adapters included for
multiple tools

‣ Tests are defined as “Attacks”
using human readable
language

‣ It integrates extremely easily
with CI tools

‣ You know, like Jenkins

‣ Cucumber-compatible
Lab: Security Testing with Gauntlt and Nmap
110
‣ Create a security group “Nmap Test” and
open all traffic from your Jenkins security
group (copy and paste the sg-***** ID)

‣ Log into your Jenkins instance:

‣ sudo yum groupinstall
"Development Tools"
‣ sudo yum groupinstall
"Development Libraries"
‣ sudo yum install ruby-devel
‣ sudo yum install nmap
‣ Get your Jenkins API key
Lab: Prep and Install Gauntlt
Upper right
corner of
Jenkins UI
111
‣ Go back into your job’s configuration

‣ Add a Post-build action

‣ Choose Execute a set of scripts

‣ Add a Build Step 

‣ Choose Execute shell

‣ Paste in the text from the cheat sheet

‣ Don’t forget to replace the name and
password with your API token
credentials

‣ Substitute in an AWS host key, the
Nmap security group id, and a
subnet id (admin public is easiest)

‣ If you used a name other than
“Website” for the project, you need
to swap that into the wget url
Lab: Add the Post Build Script
112
‣ Tests to ensure:

‣ Port 22 is
closed

‣ Port 4567 is
open
The Gauntlt Attack File
@slow
Feature: simple nmap attack
Background:
Given "nmap" is installed
And the following environment variables:
| name | environment_variable_name |
| hostname | TEST_HOSTNAME |
And the following profile:
| name | value |
| ssh_port | 22 |
Scenario: Verify instance has SSH disabled
When I launch an "nmap" attack with:
"""
nmap <hostname>
"""
Then the output should not contain:
"""
22/tcp
"""
Scenario: Verify server is open on expected set of ports
When I launch an "nmap" attack with:
"""
nmap -p 4567 <hostname>
"""
Then the output should match:
"""
4567/tcps+open
"""
113
‣ Now fail your build by changing the Ansible Playbook to open up SSH on
port 22

‣ Comment out these lines (with #) in ansible-base.yml

‣ - name: disable ssh
‣ command: chkconfig off sshd
‣ command: rpm -e openssh-server
‣ Commit, then push, your changes into your repository

‣ git commit -a
‣ git push
‣ Watch your console log for the build that starts and see what happens
Lab: Fail the Build
114
Play Time
Change the Ansible
Playbook and Gauntlt
attack files to test out
different configurations
Try patching the build
and then seeing the
results change in AWS
Inspector
115
‣ We now have a golden image, it’s time to deploy
it into production

‣ This is the core of immutable infrastructure

‣ We will automatically deploy new images that
pass all automated testing via rolling update

‣ Despite what you read, not everyone pushes
every commit into production

‣ We will for demo purposes, but in a real
environment you may want deeper testing and
manual approvals

‣ The techniques we will show will work for
even manual deployments
Lab: From Build to Deploy
116
‣ Create a new CodeCommit repository in the AWS console

‣ Or command line if you know how

‣ Clone it to your Jenkins instance

‣ cd ~
‣ git clone <url>
‣ Add the rolling_update.rb script

‣ sudo vim rolling_update.rb
‣ i to enter insert mode

‣ Copy and paste in the text of the code

‣ <esc> then :x

‣ git add -A
‣ git push
‣ In the AWS console, set your ASG for a Min/Desired instance count of 5
Lab: Add Deploy Script to Git
117
‣ Name it “Rolling ASG Update”

‣ Under General check This build is parameterized
‣ Set two string parameters

‣ IMAGE_ID
‣ AUTOSCALE_GROUP
‣ Under Build add an Execute shell step

‣ gem install aws-sdk -N
‣ ruby rolling_update.rb -y $AUTOSCALE_GROUP
$IMAGE_ID
Lab: Create a Second Job
118
‣ Go back to your Website job

‣ Add a Post build action

‣ Trigger parameterized build on other
projects
‣ Enter “Rolling ASG Update” (it will
autocomplete)

‣ Add Parameters from properties file
‣ params.txt

‣ Add Predefined parameters

‣ AUTOSCALE_GROUP= Website
‣ (Or whatever you named your
ASG)
Lab: Trigger the Deploy Job After a Successful
Build
119
‣ Manually trigger a Website job

‣ Assuming it succeeds, it will then
trigger the Rolling ASG Update job

‣ Now try a real-world scenario

‣ Change Ansible to update
vulnerabilities detected by
Inspector

‣ Commit to Git, and watch the
build automatically start and roll
out

‣ Instance colors will change as you
have a mix of AMIs
Lab: Automatic Rolling Updates
120
‣ There are a bunch of settings you need to substitute
in the scripts (e.g. security group ID, subnet, etc.).
Make sure those are all correct.

‣ If your subnet isn’t set to provide a public IP address,
Gauntlt will fail based on how things are configured.
It’s an easy fix from VPC > subnets under Actions.

‣ If you manually changed the auto scale group
settings something may have gotten messed up. 

‣ Or if the script partially ran, settings may be in an
in-between state.

‣ In both cases, an easy fix is to swap back to the
original launch configuration, then detach/
terminate the instances currently in the group.

‣ Make sure your job is set to clean the workspace
before (or after) each run.
Problems? Potential Fixes
121
Software Defined Security
122
‣Attackers are automated, we are
mostly manual.

‣Our tools have been poor.

‣We lack trustable security
automation and thus need to rely
on a “Meat Cloud”

‣In cloud, APIs are mandatory. We
can write code to automate and
orchestrate, even across
products and services.
Software Defined Security
123
‣ Work with your devs to build a
library of building blocks

‣ Learn just enough to glue it together

‣ Build some core scrips

‣ Mix and match the blocks
Code without coding
124
‣Meet SecuritySquirrel, the first
warrior in the Rodent Army
(apologies to Netflix).

‣The following tools are written by
an analyst with a Ruby-for-
Dummies book.

‣Automated security workflows
spanning products and services.
Demo
125
Pull server
information (If you
have it)
1
Detect
Compromise
2
3 Quarantine
4 Image
5 Analyze
6 Recover
= Hours!
Each step is manual, and uses a different set of disconnected tools
Incident Response
126
1. Pull metadata
2. Quarantine
3. Swap control to
security team
4. Identify and image
all storage
5. Launch and
configure analysis
server
6. Can re-launch clean
server instantly
127
‣ Security normally relies on
scanning and checking
databases.

‣ With cloud we are completely
integrated into the
infrastructure and platforms.

‣ The cloud controllers have to see
everything to manage everything,
there is no Neo running around.

‣ Instead of scanning, we can
directly pull state.

‣ And then use it for security
Stateless Security
128
1 Scan the network
2 Scan again and again for all the parts you missed
3 Identify all the servers as best you can
4 Pull a config mgmt report
5 Manually compare results
Identify Unmanaged Servers (for the audit)
129
‣ Get list of all servers
from cloud controller
(can filter on tags/
OS/etc).
‣ Single API call
‣ Get list of all servers
from Chef
‣ Single API call
‣ Compare in code
130
‣ Key aspects:

‣ Authentication/authorization via Roles

‣ Initializing clients

‣ Understanding method and variable scope

‣ AWS SDK/JSON navigation

‣ Structs > hash > arrays 

‣ Hidden complexities (e.g. ENIs and security groups)

‣ Tips

‣ Waiters

‣ Managing API limits

‣ CLI vs. SDK (—query)
Code Walk Through
W
hiteboard
131
‣ We’ve provided a library of code to start

‣ Define a security problem

‣ Incident Response

‣ Finding security holes

‣ Enabling security settings

‣ Break into teams

‣ Start programming
Lab: Software Defined Security
132
‣ Cloud providers are creating hooks to trigger actions based on
events inside the cloud.

‣ We can use these for near-instant security reactions.
Event Driven Security
133
Self-Healing Infrastructure (yes, for real)
Change a security group
Event Recorded to CloudTrail Passed to CloudWatch Log Stream
Triggers an CloudWatch
Event
Lambda Function
analyzes and reverses
134
‣ Create a new Lambda function

‣ Paste in the provided code to revert security
group changes

‣ Alter it to trigger based on a conditional

‣ Create a new CloudWatch Rule

‣ Service Name: EC2

‣ Specific Operations:
AuthorizeSecurityGroupIngress

‣ Target your Lambda function

‣ Add an SNS notification if you want

‣ Test it

‣ Free time? Write/edit your own
Lab: Event Driven Security
135
Really… costs are minimal for our 2 days, but will add up if you leave things running.
Reminder: We are not responsible for your AWS bill if you forget to
delete things after class finishes.
136

Mais conteúdo relacionado

Mais procurados

DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016Chris Gates
 
Orchestraing the Blockchain Using Containers
Orchestraing the Blockchain Using ContainersOrchestraing the Blockchain Using Containers
Orchestraing the Blockchain Using ContainersAndrew Kennedy
 
AWS re:Invent 2016: Cyber Resiliency – surviving the breach (SAC321)
AWS re:Invent 2016: Cyber Resiliency – surviving the breach (SAC321)AWS re:Invent 2016: Cyber Resiliency – surviving the breach (SAC321)
AWS re:Invent 2016: Cyber Resiliency – surviving the breach (SAC321)Amazon Web Services
 
Advanced Security Best Practices Masterclass
Advanced Security Best Practices MasterclassAdvanced Security Best Practices Masterclass
Advanced Security Best Practices MasterclassAmazon Web Services
 
LASCON 2013 - AWS CLoud HSM
LASCON 2013 - AWS CLoud HSM LASCON 2013 - AWS CLoud HSM
LASCON 2013 - AWS CLoud HSM Oleg Gryb
 
Secure your web app presentation
Secure your web app presentationSecure your web app presentation
Secure your web app presentationFrans Lytzen
 
AWS Summit Sydney 2014 | Understanding AWS Security
AWS Summit Sydney 2014 | Understanding AWS SecurityAWS Summit Sydney 2014 | Understanding AWS Security
AWS Summit Sydney 2014 | Understanding AWS SecurityAmazon Web Services
 
Lessons Learned Deploying Modern Cloud Systems in Highly Regulated Environments
Lessons Learned Deploying Modern Cloud Systems in Highly Regulated EnvironmentsLessons Learned Deploying Modern Cloud Systems in Highly Regulated Environments
Lessons Learned Deploying Modern Cloud Systems in Highly Regulated EnvironmentsPuma Security, LLC
 
Keeping a Secret with HashiCorp Vault
Keeping a Secret with HashiCorp VaultKeeping a Secret with HashiCorp Vault
Keeping a Secret with HashiCorp VaultMitchell Pronschinske
 
New Products Overview: Use Cases and Demos
New Products Overview: Use Cases and DemosNew Products Overview: Use Cases and Demos
New Products Overview: Use Cases and DemosCaitlin Magat
 
DevSecOps: Let's Write Security Unit Tests
DevSecOps: Let's Write Security Unit TestsDevSecOps: Let's Write Security Unit Tests
DevSecOps: Let's Write Security Unit TestsPuma Security, LLC
 
Winning in the Dark: Defending Serverless Infrastructure
Winning in the Dark: Defending Serverless InfrastructureWinning in the Dark: Defending Serverless Infrastructure
Winning in the Dark: Defending Serverless InfrastructurePuma Security, LLC
 
Resilient Microservices with Spring Cloud
Resilient Microservices with Spring CloudResilient Microservices with Spring Cloud
Resilient Microservices with Spring CloudVMware Tanzu
 
Building Secure Apps in the Cloud
Building Secure Apps in the CloudBuilding Secure Apps in the Cloud
Building Secure Apps in the CloudAtlassian
 
Redefining cloud native debugging
Redefining cloud native debugging  Redefining cloud native debugging
Redefining cloud native debugging LibbySchulze
 
Alfredo Reino - Monitoring aws and azure
Alfredo Reino - Monitoring aws and azureAlfredo Reino - Monitoring aws and azure
Alfredo Reino - Monitoring aws and azureDevSecCon
 
Bulletproof & Xero Presentation - AWS Summit Auckland
Bulletproof  & Xero Presentation - AWS Summit AucklandBulletproof  & Xero Presentation - AWS Summit Auckland
Bulletproof & Xero Presentation - AWS Summit AucklandBulletproof
 
Real World Cloud Application Security
Real World Cloud Application SecurityReal World Cloud Application Security
Real World Cloud Application SecurityJason Chan
 
Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020Matt Raible
 

Mais procurados (20)

DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
 
AWS Security
AWS SecurityAWS Security
AWS Security
 
Orchestraing the Blockchain Using Containers
Orchestraing the Blockchain Using ContainersOrchestraing the Blockchain Using Containers
Orchestraing the Blockchain Using Containers
 
AWS re:Invent 2016: Cyber Resiliency – surviving the breach (SAC321)
AWS re:Invent 2016: Cyber Resiliency – surviving the breach (SAC321)AWS re:Invent 2016: Cyber Resiliency – surviving the breach (SAC321)
AWS re:Invent 2016: Cyber Resiliency – surviving the breach (SAC321)
 
Advanced Security Best Practices Masterclass
Advanced Security Best Practices MasterclassAdvanced Security Best Practices Masterclass
Advanced Security Best Practices Masterclass
 
LASCON 2013 - AWS CLoud HSM
LASCON 2013 - AWS CLoud HSM LASCON 2013 - AWS CLoud HSM
LASCON 2013 - AWS CLoud HSM
 
Secure your web app presentation
Secure your web app presentationSecure your web app presentation
Secure your web app presentation
 
AWS Summit Sydney 2014 | Understanding AWS Security
AWS Summit Sydney 2014 | Understanding AWS SecurityAWS Summit Sydney 2014 | Understanding AWS Security
AWS Summit Sydney 2014 | Understanding AWS Security
 
Lessons Learned Deploying Modern Cloud Systems in Highly Regulated Environments
Lessons Learned Deploying Modern Cloud Systems in Highly Regulated EnvironmentsLessons Learned Deploying Modern Cloud Systems in Highly Regulated Environments
Lessons Learned Deploying Modern Cloud Systems in Highly Regulated Environments
 
Keeping a Secret with HashiCorp Vault
Keeping a Secret with HashiCorp VaultKeeping a Secret with HashiCorp Vault
Keeping a Secret with HashiCorp Vault
 
New Products Overview: Use Cases and Demos
New Products Overview: Use Cases and DemosNew Products Overview: Use Cases and Demos
New Products Overview: Use Cases and Demos
 
DevSecOps: Let's Write Security Unit Tests
DevSecOps: Let's Write Security Unit TestsDevSecOps: Let's Write Security Unit Tests
DevSecOps: Let's Write Security Unit Tests
 
Winning in the Dark: Defending Serverless Infrastructure
Winning in the Dark: Defending Serverless InfrastructureWinning in the Dark: Defending Serverless Infrastructure
Winning in the Dark: Defending Serverless Infrastructure
 
Resilient Microservices with Spring Cloud
Resilient Microservices with Spring CloudResilient Microservices with Spring Cloud
Resilient Microservices with Spring Cloud
 
Building Secure Apps in the Cloud
Building Secure Apps in the CloudBuilding Secure Apps in the Cloud
Building Secure Apps in the Cloud
 
Redefining cloud native debugging
Redefining cloud native debugging  Redefining cloud native debugging
Redefining cloud native debugging
 
Alfredo Reino - Monitoring aws and azure
Alfredo Reino - Monitoring aws and azureAlfredo Reino - Monitoring aws and azure
Alfredo Reino - Monitoring aws and azure
 
Bulletproof & Xero Presentation - AWS Summit Auckland
Bulletproof  & Xero Presentation - AWS Summit AucklandBulletproof  & Xero Presentation - AWS Summit Auckland
Bulletproof & Xero Presentation - AWS Summit Auckland
 
Real World Cloud Application Security
Real World Cloud Application SecurityReal World Cloud Application Security
Real World Cloud Application Security
 
Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020
 

Semelhante a DEF CON 24 - Rich Mogull - pragmatic cloud security

Pragmatic Cloud Security Automation
Pragmatic Cloud Security AutomationPragmatic Cloud Security Automation
Pragmatic Cloud Security AutomationCloudVillage
 
Building Bulletproof Infrastructure on AWS
Building Bulletproof Infrastructure on AWSBuilding Bulletproof Infrastructure on AWS
Building Bulletproof Infrastructure on AWS2nd Watch
 
AWS VPC best practices 2016 by Bogdan Naydenov
AWS VPC best practices 2016 by Bogdan NaydenovAWS VPC best practices 2016 by Bogdan Naydenov
AWS VPC best practices 2016 by Bogdan NaydenovBogdan Naydenov
 
Amazon VPC Best Practices 2016
Amazon VPC Best Practices 2016Amazon VPC Best Practices 2016
Amazon VPC Best Practices 2016AWSBulgaria
 
Security and Advanced Automation in the Enterprise
Security and Advanced Automation in the EnterpriseSecurity and Advanced Automation in the Enterprise
Security and Advanced Automation in the EnterpriseAmazon Web Services
 
Digital Forensics and Incident Response in The Cloud
Digital Forensics and Incident Response in The CloudDigital Forensics and Incident Response in The Cloud
Digital Forensics and Incident Response in The CloudVelocidex Enterprises
 
004 - Logging in the Cloud -- hide01.ir.pptx
004 - Logging in the Cloud  --  hide01.ir.pptx004 - Logging in the Cloud  --  hide01.ir.pptx
004 - Logging in the Cloud -- hide01.ir.pptxnitinscribd
 
AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)
AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)
AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)Amazon Web Services
 
MuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual EventMuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual EventVikalp Bhalia
 
Developer Experience at the Guardian, Equal Experts Sept 2021
Developer Experience at the Guardian, Equal Experts Sept 2021Developer Experience at the Guardian, Equal Experts Sept 2021
Developer Experience at the Guardian, Equal Experts Sept 2021Akash Askoolum
 
Automated Governance of Your AWS Resources
Automated Governance of Your AWS ResourcesAutomated Governance of Your AWS Resources
Automated Governance of Your AWS ResourcesAmazon Web Services
 
Security Automation Simplified - BSides Austin 2019
Security Automation Simplified - BSides Austin 2019Security Automation Simplified - BSides Austin 2019
Security Automation Simplified - BSides Austin 2019Moses Schwartz
 
Infrastructure Security: Your Minimum Security Baseline
Infrastructure Security: Your Minimum Security BaselineInfrastructure Security: Your Minimum Security Baseline
Infrastructure Security: Your Minimum Security BaselineAmazon Web Services
 
How to Determine if You Are Well-Architected for Reliability
How to Determine if You Are Well-Architected for ReliabilityHow to Determine if You Are Well-Architected for Reliability
How to Determine if You Are Well-Architected for ReliabilityAmazon Web Services
 
Cisco + AWS Stronger Security & Greater AWS Adoption
Cisco + AWS Stronger Security & Greater AWS Adoption Cisco + AWS Stronger Security & Greater AWS Adoption
Cisco + AWS Stronger Security & Greater AWS Adoption Amazon Web Services
 
Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Velocidex Enterprises
 
Schlomo Schapiro - Why I like to use the proprietary Cloud services without f...
Schlomo Schapiro - Why I like to use the proprietary Cloud services without f...Schlomo Schapiro - Why I like to use the proprietary Cloud services without f...
Schlomo Schapiro - Why I like to use the proprietary Cloud services without f...Schlomo Schapiro
 
AWS re:Invent 2016: 5 Security Automation Improvements You Can Make by Using ...
AWS re:Invent 2016: 5 Security Automation Improvements You Can Make by Using ...AWS re:Invent 2016: 5 Security Automation Improvements You Can Make by Using ...
AWS re:Invent 2016: 5 Security Automation Improvements You Can Make by Using ...Amazon Web Services
 
Secure Configuration and Automation Overview
Secure Configuration and Automation OverviewSecure Configuration and Automation Overview
Secure Configuration and Automation OverviewAmazon Web Services
 
AWS Security Week: Infrastructure Security- Your Minimum Security Baseline
AWS Security Week: Infrastructure Security- Your Minimum Security BaselineAWS Security Week: Infrastructure Security- Your Minimum Security Baseline
AWS Security Week: Infrastructure Security- Your Minimum Security BaselineAmazon Web Services
 

Semelhante a DEF CON 24 - Rich Mogull - pragmatic cloud security (20)

Pragmatic Cloud Security Automation
Pragmatic Cloud Security AutomationPragmatic Cloud Security Automation
Pragmatic Cloud Security Automation
 
Building Bulletproof Infrastructure on AWS
Building Bulletproof Infrastructure on AWSBuilding Bulletproof Infrastructure on AWS
Building Bulletproof Infrastructure on AWS
 
AWS VPC best practices 2016 by Bogdan Naydenov
AWS VPC best practices 2016 by Bogdan NaydenovAWS VPC best practices 2016 by Bogdan Naydenov
AWS VPC best practices 2016 by Bogdan Naydenov
 
Amazon VPC Best Practices 2016
Amazon VPC Best Practices 2016Amazon VPC Best Practices 2016
Amazon VPC Best Practices 2016
 
Security and Advanced Automation in the Enterprise
Security and Advanced Automation in the EnterpriseSecurity and Advanced Automation in the Enterprise
Security and Advanced Automation in the Enterprise
 
Digital Forensics and Incident Response in The Cloud
Digital Forensics and Incident Response in The CloudDigital Forensics and Incident Response in The Cloud
Digital Forensics and Incident Response in The Cloud
 
004 - Logging in the Cloud -- hide01.ir.pptx
004 - Logging in the Cloud  --  hide01.ir.pptx004 - Logging in the Cloud  --  hide01.ir.pptx
004 - Logging in the Cloud -- hide01.ir.pptx
 
AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)
AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)
AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)
 
MuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual EventMuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual Event
 
Developer Experience at the Guardian, Equal Experts Sept 2021
Developer Experience at the Guardian, Equal Experts Sept 2021Developer Experience at the Guardian, Equal Experts Sept 2021
Developer Experience at the Guardian, Equal Experts Sept 2021
 
Automated Governance of Your AWS Resources
Automated Governance of Your AWS ResourcesAutomated Governance of Your AWS Resources
Automated Governance of Your AWS Resources
 
Security Automation Simplified - BSides Austin 2019
Security Automation Simplified - BSides Austin 2019Security Automation Simplified - BSides Austin 2019
Security Automation Simplified - BSides Austin 2019
 
Infrastructure Security: Your Minimum Security Baseline
Infrastructure Security: Your Minimum Security BaselineInfrastructure Security: Your Minimum Security Baseline
Infrastructure Security: Your Minimum Security Baseline
 
How to Determine if You Are Well-Architected for Reliability
How to Determine if You Are Well-Architected for ReliabilityHow to Determine if You Are Well-Architected for Reliability
How to Determine if You Are Well-Architected for Reliability
 
Cisco + AWS Stronger Security & Greater AWS Adoption
Cisco + AWS Stronger Security & Greater AWS Adoption Cisco + AWS Stronger Security & Greater AWS Adoption
Cisco + AWS Stronger Security & Greater AWS Adoption
 
Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3Digital Forensics and Incident Response in The Cloud Part 3
Digital Forensics and Incident Response in The Cloud Part 3
 
Schlomo Schapiro - Why I like to use the proprietary Cloud services without f...
Schlomo Schapiro - Why I like to use the proprietary Cloud services without f...Schlomo Schapiro - Why I like to use the proprietary Cloud services without f...
Schlomo Schapiro - Why I like to use the proprietary Cloud services without f...
 
AWS re:Invent 2016: 5 Security Automation Improvements You Can Make by Using ...
AWS re:Invent 2016: 5 Security Automation Improvements You Can Make by Using ...AWS re:Invent 2016: 5 Security Automation Improvements You Can Make by Using ...
AWS re:Invent 2016: 5 Security Automation Improvements You Can Make by Using ...
 
Secure Configuration and Automation Overview
Secure Configuration and Automation OverviewSecure Configuration and Automation Overview
Secure Configuration and Automation Overview
 
AWS Security Week: Infrastructure Security- Your Minimum Security Baseline
AWS Security Week: Infrastructure Security- Your Minimum Security BaselineAWS Security Week: Infrastructure Security- Your Minimum Security Baseline
AWS Security Week: Infrastructure Security- Your Minimum Security Baseline
 

Mais de Felipe Prado

DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryDEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryFelipe Prado
 
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...Felipe Prado
 
DEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsDEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsFelipe Prado
 
DEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionDEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionFelipe Prado
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101Felipe Prado
 
DEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentDEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentFelipe Prado
 
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareDEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareFelipe Prado
 
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...Felipe Prado
 
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationDEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationFelipe Prado
 
DEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceDEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceFelipe Prado
 
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionistDEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionistFelipe Prado
 
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksDEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksFelipe Prado
 
DEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsDEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsFelipe Prado
 
DEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchDEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchFelipe Prado
 
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...Felipe Prado
 
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksDEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksFelipe Prado
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationDEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationFelipe Prado
 
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncDEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncFelipe Prado
 
DEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesDEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesFelipe Prado
 
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsFelipe Prado
 

Mais de Felipe Prado (20)

DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryDEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
 
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
 
DEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsDEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got ants
 
DEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionDEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryption
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101
 
DEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentDEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a government
 
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareDEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
 
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
 
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationDEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
 
DEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceDEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interface
 
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionistDEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
 
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksDEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
 
DEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsDEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portals
 
DEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchDEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitch
 
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
 
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksDEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationDEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
 
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncDEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
 
DEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesDEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devices
 
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
 

Último

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

DEF CON 24 - Rich Mogull - pragmatic cloud security

  • 1. Pragmatic Cloud Security: Hands-On Turbocharged Edition Rich Mogull @rmogull rmogull@securosis.com 1 ‣ Four days of training… ‣ in four hours ‣ Nearly all labs ‣ Some of you won’t be able to keep up ‣ That’s okay, you have the materials to go through later ‣ Doesn’t mean you’re dumb, just that it’s outside your experience ‣ We probably won’t get through everything. This really is material taken from 4 days of training, slimmed down as best we can What to Expect 2
  • 2. Really… costs are minimal for our 4 hours, but will add up if you leave things running. Reminder: We are not responsible for your AWS bill if you forget to delete things after class finishes. 3 ‣ All labs are how it's done for real, these aren't merely academic exercises. ‣ Part 1: we will configure a production-quality account with multiple virtual networks and core security controls. ‣ Part 2: we will build a deployment pipeline, integrate it into our existing application stack, and code a variety of security automation controls. ‣ Most programming labs and examples are in Ruby, with some use of Python. ‣ We provide enough code that those of you with less experience can still participate. ‣ Nearly all labs are in Amazon Web Services ‣ AWS is 85% of the market and the most mature (for now) ‣ We will reference Azure and Google Compute Cloud, but all the labs are in AWS due to logistics as much as anything Labs 4
  • 3. There is minimal hand holding. We don't have slides for every step. 5 Architecting with Accounts W hiteboard 6
  • 4. W hiteboard Root Account Security 7 Important Lab Note All labs should be performed in the us-west-2 (Oregon) region unless otherwise specified 8
  • 5. ‣ Enable MFA ‣ Authy is free, easy, and on iOS and Android ‣ Disable Access Keys ‣ Create new IAM user with the “Administrator” managed policy attached ‣ Use that user for the remainder of class AWS Root Account Security Lab 9 Identity and Access Management 10
  • 6. ‣ Users ‣ An individual/account capable of logging into AWS ‣ Groups ‣ A collection of users ‣ Roles ‣ Temporary permissions other entities can assume ‣ Core to internal AWS services and federation ‣ Policies ‣ The core of IAM ‣ Managed and Inline options ‣ Identity Providers ‣ SAML support ‣ Console URL ‣ How IAM users can log into your account AWS IAM Primitives 11 ‣ Access/Secret Keys ‣ For API calls ‣ Uses Signature 4 HTTP request signing ‣ Username/Password ‣ MFA ‣ Host keys (Linux) ‣ Administrator Password (Windows) ‣ SSH keys (CodeCommit today, maybe more later) Credentials 12
  • 7. ‣ JSON, but a specific policy language ‣ Inline apply to a single entity ‣ Generally limit use ‣ Managed policy updates roll out to all linked entities ‣ Supports versioning ‣ Advanced capabilities for dynamic use ‣ Especially conditionals Policies 13 Creating Policies Policy Generator Hand-Editing 14
  • 9. ‣ Create a new role for EC2 Instances ‣ Name it “Dev” ‣ We need this later, do NOT use a different name ‣ Assign the PowerUserAccess role ‣ Launch an instance with the role assigned ‣ Log in ‣ From the command line, type: ‣ aws ec2 describe-instances ‣ aws iam list-users ‣ It work? Terminate Lab: Create an Instance Role 17 Using Conditionals (Demo) 18
  • 10. ‣ Write an IAM policy that restricts a user to only a single region ‣ Write an IAM policy that allows an administrator to manage their own MFA, and requires MFA to log into the console. Lab: IAM Policies with Conditionals Check the cheat sheet if you get stuck 19 Cloud Network Security 20
  • 11. AWS Network Primitives Account Virtual Network Public Subnet Security Group Virtual Network Private Subnet Security Group Route Table Elastic Network Interface ACLs Service Endpoints Internet Gateway Customer Gateway 21 Network segregation by default cba Web X X Granularity of a host firewall with the manageability of a network firewall 22
  • 12. How Amazon’s Network Works https://www.youtube.com/watch?v=yZtKcZdsCJk W hiteboard 23 Fix the VPC 24
  • 13. ‣ Go into CloudFormation ‣ Launch the stack using the template: ‣ http://s3.amazonaws.com/ Securosis-CCSK/BlackHat/ Vpclab.template ‣ SSH to the public instance ‣ SSH to the private instance Fix the VPC 25 26
  • 14. 27 28
  • 16. ‣ Allocate a new Elastic IP ‣ Create a second VPC with public and private subnets ‣ Use the VPC wizard ‣ Name it “website” ‣ Use a CIDR of 192.168.0.0/16 ‣ Create /24 subnets ‣ Launch a default Amazon Linux in the private subnet ‣ With security group called “temp” allowing port 22 from your IP VPC Peering Lab 31 ‣ Name the peering connection “website-admin peer” ‣ Doesn’t matter which VPC is in which place ‣ Accept the request ‣ No IAM needed since this is all in your account ‣ Adjust your routing tables on each side to support the peering connection ‣ You could use ACLs to get fancy, but that will also probably break things Peer the VPCs 32
  • 17. Connect to your instance in the Private “website” subnet from your Admin jump box Pro tip- you need to add the Security Group ID to the website security group for the admin group using cut and paste. 33 Now terminate the instance. Hopefully you weren’t emotionally attached. 34
  • 18. Elastic Load Balancers and Auto Scale Groups W hiteboard 35 ‣ Create a Load Balancer ‣ Name: CloudSecWebsite ‣ Pick the website VPC and the public subnet ‣ Remap port 80 to port 4567 ‣ Select the public subnet ‣ Create a new security group ‣ Name: Website ELB ‣ Port 80 wide open ‣ Health Check: TCP 4567 Lab: Auto Scale Group behind an ELB 36
  • 19. ‣ Create a Launch Configuration ‣ Use ami-b73efed7 ‣ Assign the “Dev” role ‣ Assign a public IP address to every instance (under the advanced tab) ‣ Security Group ‣ Name “Website Server” ‣ Port 4567 open from sg-[Website ELB] ‣ Create an auto scale group with min/max/desired of 1 ‣ Name it “Website” ‣ Apply a tag “Environment” with value “Production” and apply to new instances ‣ Choose your Website VPC and public subnet ‣ Receive traffic from your ELB (Advanced) Lab: Auto Scale Group behind an ELB 37 38
  • 20. Go to your ELB URL 39 Service Endpoints W hiteboard 40
  • 21. ‣ Directly route traffic from a private AWS network to an Amazon service. ‣ Right now, only have S3, but more coming ‣ Without them, instances need public Internet access ‣ Also reduce costs since you aren’t routing to the Internet ‣ Managed by VPC networking and the mapping service, which handles translation of the URL to connect to the AWS service ‣ Most services require Internet access (e.g. Dynamo, SQS) Service Endpoints 41 ‣ Create an S3 Service Endpoint ‣ In your Website VPC ‣ Go back to your web site ELB ‣ See the boom? Service Endpoint Lab W hat’s Going On 42
  • 22. ‣ The service endpoint routes traffic internally to S3 ‣ Only works in the same region ‣ Our app pulls a URL from a configuration file in S3 ‣ S3 sees it as internal, not as normal IP access ‣ Our bucket policy on the config file only allows non-IP-based access ‣ If it’s inside your own account, you can use an IAM role instead What’s Going On 43 Monitoring and Logging 44
  • 23. What’s different Management Plane Velocity Distribution/Segregation Account Virtual Network Subnet Security Group Virtual Network Subnet Security Group Account Virtual Network Subnet Security Group Virtual Network Subnet Security Group 45 Management Plane Security Monitoring Direct Proxy 46
  • 24. 47 Cascading Architecture Dev Test Prod Logs Security Monitoring SIEM Project Accounts Security Account In Datacenter 48
  • 25. ‣ Filter logs down before you transfer over the Internet. All cloud providers charge by the byte, and your goal is to manage costs instead of just pushing everything into the SIEM ‣ Management plane logs will have less data than instances and other sources, but it can still add up. ‣ We’ll cover filtering priorities in a bit. ‣ You need to correlate what accounts you have to what is being logged. This varies by provider, but typically you compare billing and project IDs to those in your logs. ‣ Project logs should be readable by project admins only within their project storage. Important Points 49 AWS Core Tools CloudTrail CloudWatch Config ‣ Nearly all API calls ‣ Stored in S3 ‣ Can push to CloudWatch ‣ S3 logs written every 5 minutes ‣ Can have up to a 15 minute delay ‣ JSON format ‣ Integrates with SNS to notify when logs written ‣ 7 days visible in the console ‣ Partial service coverage with emphasis on EC2 and IAM. ‣ Tracks configuration state over time and what assets are affected by what changes. ‣ Stored in S3 ‣ Visualize in console ‣ Can enforce Config Rules ‣ AWS’s native log service ‣ First job is monitoring for performance, auto scaling, etc. ‣ Can accept Log Streams from other sources, like CloudTrail ‣ Visible in console, stored internally, export via API or to S3 ‣ Supports Events and Rules ‣ Native filtering for alarms to SNS ‣ Can accept syslog or other arbitrary streams 50
  • 26. ‣ Enable CloudTrail in all regions ‣ Send to a secure S3 bucket with restrictive IAM rights ‣ Don’t worry about encrypting, but it’s an option for highly-sensitive environments. ‣ Stream to CloudWatch ‣ You’ll see why later ‣ Enable Config ‣ Turn on VPC flow logs (in the VPC section of the console) Lab: Initial Configuration 51 ‣ Can be a tougher problem, and depends a ton on your specific requirements ‣ Instances/virtual machines have shorter lifespans, and different ones may share the same IP address and name throughout the course of the day. ‣ Becomes critical to capture the actual instance identifier ‣ Quite likely a higher volume of data, so cost management is a bigger issue ‣ Key issue is build your own or leverage your platform Server and Application Logs 52
  • 27. Cascading System Logs 53 ‣ We will set up a central log server using fluentd ‣ We will modify rsyslog to add the instance ID to log messages and send them to the central logger ‣ We will configure fluentd to filter for security events and save those to S3 ‣ This creates a skeleton log framework that can scale to far larger and more complex scenarios Lab: Cascading System Logging 54
  • 28. ‣ Log into your Admin instance ‣ Install fluentd ‣ sudo curl -L https://toolbelt.treasuredata.com/ sh/install-redhat-td-agent2.sh | sh ‣ Alter the configuration file to save events to S3 ‣ See the Cheat Sheet for the specific commands and template ‣ Open port 5140 from 0.0.0.0/0 ‣ Start it Set up your log server 55 ‣ Launch a new instance, or use any other running instance ‣ Log in and… ‣ Pull the instance ID using the metadata service ‣ Yes, you can get it from the console, but this is how you would need to get it to script things ‣ Edit rsyslog.conf to push external logs and insert the instance ID into the message ‣ You could also modify the hostname instead ‣ There are a lot of options for this part of the problem ‣ sudo service rsyslog restart Set up an instance to push logs 56
  • 29. ‣ A regular instance won’t create enough log files to trigger the push to S3 ‣ From the cheat sheet, create a log generator ‣ Create an empty file in your home directory named "log_generator.rb" ‣ Paste in the content from the cheat sheet ‣ ruby log_generator.rb ‣ Run the log generator and keep an eye on your S3 bucket Generate Some Logs 57 ‣ Fluentd supports all sorts of filtering, parsing, and other log flow ‣ We can use this to store local project logs, while also forwarding on security-sensitive logs ‣ Un-comment the simple filter in our configuration file ‣ This will now only push messages from our filter generator into S3 ‣ Feel free to play with something more complex Now Filter the Messages 58
  • 30. Filtering and Alerting Filter to focus security for cascading logs, alert for security response CIS Benchmarks for AWS Convert for your provider of choice ‣ Unauthorized API calls ‣ Management console log in without MFA ‣ Any IAM policy change ‣ CloudTrail configuration changes ‣ Management console authentication failures ‣ Disabling or scheduling the deletion of a KMS Customer Managed Key (encryption key) ‣ Any use of the root account ‣ Any S3 bucket policy changes ‣ AWS Config configuration changes ‣ Security group changes ‣ Network Access Control List changes ‣ Network gateway changes ‣ VPC changes (e.g. subnets, routing tables, service endpoints) 59 ‣ CloudTrail -> CloudWatch ‣ Metrics Filters ‣ Events (Rules) ‣ By far currently the fastest option ‣ Can trigger Lambda functions ‣ Config ‣ Rules AWS Options 60
  • 31. Introduction to DevOps 61 The Problem Threats New Tools and Applications Technical Debt 62
  • 32. The Problem Cloud + DevOps New Tools and Applications 63 ‣ Cloud is a new operational model. ‣ It requires a re-thinking of fundamental architectures. ‣ DevOps is a new operational framework, highly attuned to cloud. ‣ Both shatter existing security approaches. Cloud and DevOps 64
  • 34. Complexity Breeds Error Develop Commit Test Deploy Team Env Dev QA Test Ops Dev Test Test Stage Prod 67 Environments, Requirements, and Configurations Drift Dev Prod 68
  • 35. Cycle Times Matter Pre-Alpha Alpha Beta Gold Agile? Waterfall? All the same… 69 ‣ Configurations drift over time. ‣ The less automated, the more the drift. ‣ Manual intervention creates error, reduces standardization. ‣ Environments become de-synced. ‣ Different teams work in different environments. ‣ The longer the update cycle, the greater the chances for error. The Dev and Ops Problem No standards = More complexity 70
  • 36. ‣ DevOps is an operational framework that increases standardization, agility, and reliability. ‣ It relies heavily on virtualization, cloud, and automation. ‣ The principles come direct from Denning and Lean Manufacturing. Enter DevOps https://workingsmartercafe.files.wordpress.com/2012/09/kool-aid-man.jpeg 71 Development Pipelines and Continuous Deployment Source Code GitCloudformation Templates Jenkins Functional Tests Chef Recipes Chef Server NonFunctional Tests Security Tests Test Prod Chef Server Chef Server 72
  • 37. 10 Deploys a Day? Commit 73 ‣ All environments, including supporting third-party applications, are consistent. ‣ The deployment pipeline is automated, for code, configurations, and toolsets. ‣ There is no drift.There are no human-induced errors. ‣ Faster deployment cycles reduce error and improve business agility. ‣ Version control and consistency support instant rollback. Why DevOps Works 74
  • 38. [Sec]DevOps And Rugged DevOps 75 DevOps is a Security Dream! 76
  • 39. Trustable Security Automation! 77 ‣ DevOps provides a consistency and control impossible with manual application deployments. ‣ Security can easily embed and automate. ‣ Security can steal DevOps techniques to apply to diverse workloads and infrastructure requirements. DevOps + Security = ♡ 78
  • 40. ‣ Integrate security tests into the deployment pipeline ‣ Build resilient server configurations ‣ Embrace Stateless Security ‣ Automate with Code and APIs Building Your Toolkit 79 Yes, you need to learn some new skills, but you don’t need to become a programmer. 80
  • 41. ‣ Add security to deployment pipelines and automate testing. ‣ New tools are here, but we need more… ‣ Build a library of server hardening scrips and inject into config management. ‣ Integrate directly into your cloud service for alerting/monitoring. ‣ Create a library of automation code you can mix and match for different security needs. Winning SecDevOps 81 Instance (Server/Host) Security 82
  • 42. ‣ Don’t use ones you can’t validate ‣ If you use shared, get the direct image ID from the source ‣ Many “certified, pre-owned” available ‣ Clean before creating ‣ Swap space ‣ Temp files ‣ Embedded keys ‣ Other credentials Image Fundamentals 83 ‣ Three types ‣ Normal/long-running ‣ Immutable ‣ Automated config management ‣ Deployment type may change host security controls requirements ‣ Use encryption to protect snapshots ‣ New management techniques needed ‣ Config management changes ‣ Vulnerability assessment changes ‣ Patch management changes Instance Fundamentals 84
  • 43. ‣ Amazon Inspector ‣ Agent-based vulnerability assessment ‣ Pretty basic, but fully integrated ‣ We will use it later for security automation by triggering using SNS ‣ Setup ‣ Inspector is already running in your auto scale group instances ‣ See the ansible-baseline.yml file we review later for install details ‣ Assuming you tagged the instances, they are ready to be inspected ‣ Configure Inspector in the AWS Console ‣ Create an assessment target to match “Environment: Production” ‣ Create an assessment template that uses the “Common Vulnerabilities and Exposures” rules package Lab: Vulnerability Assessment 85 Cloud-Scale Configuration Management W hiteboard 86
  • 44. ‣Instead of updating, you completely replace infrastructure through automation. ‣Can apply to a single server, up to an entire application stack. ‣Incredibly resilient and secure. Think “servers without logins”. The Power of Immutable Image from: http://tourismplacesworld.blogspot.com/2012/07/uluru.html 87 Lab: Building a Deployment Pipeline + 88
  • 45. Before we start, if you get stuck there is a slide at the end of this section with suggestions to solve common problems 89 ‣ One of the most popular code repositories ‣ GitHub is only one hosting option ‣ Works better for most DevOps orgs due to different flow options ‣ Self hosted keeps all the data, but lacks visualization and other popular features in GitHub (public or private), Stash, Bitbucket, etc. ‣ Always use SSH/TLS options (no self signed certs please), keep repo and OS up to date, and lock it down tight. It’s the keys to the code kingdom. ‣ Excellent audibility. Copy/store logs externally for audit. ‣ CodeCommit is AWS’s hosted Git ‣ Resilient storage on S3 ‣ Can be fully private and integrate with IAM ‣ Can encrypt with KMS Git and CodeCommit Security 90
  • 46. ‣ Start in AWS and create your first CodeCommit repository ‣ Create a new IAM user called “Jenkins” and leave the console on that page ‣ Create an empty repository called WebApp[random] ‣ Repository names have to be unique, so figure something out ‣ Configure your public Admin instance with Git for access ‣ Double check it has the Dev IAM role assigned ‣ Follow the instructions at http://docs.aws.amazon.com/codecommit/ latest/userguide/setting-up-ssh-unixes.html ‣ git clone <ssh://your repository’s URL> Lab Part 1: CodeCommit 91 ‣ Copy the files from the cloudsec directory in the class Box folder into the directory you just cloned ‣ The URL will be on your cheat sheet ‣ Rename the folder cloudsec ‣ Push the files to your repository ‣ git commit -a ‣ git push Lab Part 1: CodeCommit 92
  • 47. ‣ Connect to your public Admin instance (you should still be) ‣ Enter these commands (on your cheat sheet): ‣ sudo wget -O /etc/yum.repos.d/jenkins.repo http:// pkg.jenkins-ci.org/redhat/jenkins.repo ‣ sudo rpm --import http://pkg.jenkins-ci.org/redhat/ jenkins-ci.org.key ‣ sudo yum install jenkins ‣ sudo service jenkins start ‣ sudo chkconfig --add jenkins ‣ Open port 8080 in your security group from your current IP address Lab Part 2: Jenkins 93 ‣ http://<your instance ip>:8080 ‣ Get the temporary admin password ‣ sudo cat /var/lib/jenkins/secrets/initialAdminPassword Lab Part 2: Jenkins 94
  • 48. ‣ Then create your admin user ‣ Pick a super easy username and password ‣ 1234 is an excellent option ‣ Jenkins can run slave nodes, but our entire lab will be on a single master Lab: Install Baseline Jenkins Plugins 95 ‣ Go to Jenkins > Manage Jenkins > Manage Plugins and install the following plugins: ‣ Hudson Post build task ‣ Hudson Ruby plugin ‣ Packer Plugin ‣ Post-Build Script Plugin ‣ Parameterized Trigger plugin ‣ Ansible plugin ‣ Environment Plugin Lab: Add Plugins 96
  • 49. ‣ Go to Credentials ‣ Click on the Jenkins store > Global Credentials > Add Credentials ‣ The kind is “SSH username with private key” ‣ The username is the same you created for CodeCommit (remember, it will look like an Access Key and you find it in your AWS IAM console for that user under SSH Keys ‣ Enter the private key directly (cut and paste) Lab: Add Credentials for Git 97 Paste the private key here -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAsizp0lOUX4YSjTMxxR 98
  • 50. ‣ We’ll start by pulling from Git and saying Hello World ‣ Don’t worry, we’ll build this out pretty quickly ‣ Create a new job ‣ Name it “Website” ‣ Choose a Freestyle Project ‣ Keep in mind, this class focuses on security and we won’t be covering the ins and outs of Jenkins Lab: Create Your First Jenkins Job 99 Lab: Configure to Pull From CodeCommit Enter your CodeCommit ssh url Select the credentials you just configured Jenkins live-updates so you will know right away if it works 100
  • 51. ‣ We will trigger our build on Source Code Management changes (Git) ‣ Poll every minute by typing “* * * * *” ‣ There’s a space between each * ‣ Add Build Step ‣ Our build (for now) will just “Hello World” Lab: Set the Build Trigger and Hello World 101 ‣ In large projects this isn’t necessarily a good idea since creating everything from scratch can take a lot of time ‣ Ours is small ‣ We set a file with parameters that needs to be cleaned after every build ‣ You could also just swap the file programatically if you want, but this ensures it’s always clean during our experiments Lab: Clean Workspace Between Builds subnet-1c5f3d78 102
  • 52. ‣ Click Enable Auto Refresh on the job screen (upper right) ‣ Click Build Now ‣ Click on the job number ‣ Click on Console Output ‣ Or change the readme.md in the repository and watch the build start automatically Lab: Save the Job then Test 103 ‣ Packer builds images for multiple clouds/ platforms based on templates ‣ We will use it to build a new, custom AMI when we make code or configuration changes ‣ Packer can build for multiple environments based on a single template ‣ e.g. AWS AMI, Vagrant, Docker ‣ Manage Jenkins > Global Tool Configuration > Add packer ‣ Name it “default” ‣ Check “Install automatically” ‣ Choose the latest linux amd64 version ‣ Save Lab: Configure Packer 104
  • 53. ‣ Packer will create a new AMI based on an existing base ‣ While it can configure the image itself, we will use Ansible instead since it’s more powerful ‣ Our Packer template will install Ansible locally on the instance, then run Ansible to configure the instance based on a Playbook ‣ Ansible runs in local mode ‣ The Packer template is pasted into Jenkins but the Ansible playbook is pulled in from Git ‣ All files in Git are pulled into the job’s workspace Lab: Configure Packer to Use Ansible 105 ‣ Within the job, go to Configure ‣ Add a Post Build Action ‣ Choose Packer, check Packer Template Text ‣ Paste in the text from the cheat sheet ‣ Also paste in the Additional Parameters ‣ Save Lab: Configure Packer to Use Ansible 106
  • 54. ‣ Jenkins polls CodeCommit every minute, and will trigger the build on a change ‣ Using SSH credentials ‣ In the real world, you would make these read only ‣ Jenkins runs on an instance with an IAM role, so all the tools will use those credentials ‣ The build triggers and echoes “Hello World” to the console. For our lab we aren’t compiling code, so that’s the only build action. ‣ Then Packer: ‣ Launches a new instance ‣ Connects over SSH ‣ Installs Ansible ‣ Runs Ansible using the playbook ‣ Shuts down the instance ‣ Creates a new AMI based on the running instance ‣ Cleans itself up How This Works 107 Run The Build Console output with your new AMI 108
  • 55. ‣ Continuous Integration tools are designed not only to build code, but to automatically test it ‣ We can leverage this for security testing ‣ Security unit tests ‣ Code scanning/assessment ‣ SAST/DAST/RAST ‣ Configuration and environment testing ‣ Vulnerability assessment Automated Security Testing 109 ‣ Gauntlt automates security tests with adapters included for multiple tools ‣ Tests are defined as “Attacks” using human readable language ‣ It integrates extremely easily with CI tools ‣ You know, like Jenkins ‣ Cucumber-compatible Lab: Security Testing with Gauntlt and Nmap 110
  • 56. ‣ Create a security group “Nmap Test” and open all traffic from your Jenkins security group (copy and paste the sg-***** ID) ‣ Log into your Jenkins instance: ‣ sudo yum groupinstall "Development Tools" ‣ sudo yum groupinstall "Development Libraries" ‣ sudo yum install ruby-devel ‣ sudo yum install nmap ‣ Get your Jenkins API key Lab: Prep and Install Gauntlt Upper right corner of Jenkins UI 111 ‣ Go back into your job’s configuration ‣ Add a Post-build action ‣ Choose Execute a set of scripts ‣ Add a Build Step ‣ Choose Execute shell ‣ Paste in the text from the cheat sheet ‣ Don’t forget to replace the name and password with your API token credentials ‣ Substitute in an AWS host key, the Nmap security group id, and a subnet id (admin public is easiest) ‣ If you used a name other than “Website” for the project, you need to swap that into the wget url Lab: Add the Post Build Script 112
  • 57. ‣ Tests to ensure: ‣ Port 22 is closed ‣ Port 4567 is open The Gauntlt Attack File @slow Feature: simple nmap attack Background: Given "nmap" is installed And the following environment variables: | name | environment_variable_name | | hostname | TEST_HOSTNAME | And the following profile: | name | value | | ssh_port | 22 | Scenario: Verify instance has SSH disabled When I launch an "nmap" attack with: """ nmap <hostname> """ Then the output should not contain: """ 22/tcp """ Scenario: Verify server is open on expected set of ports When I launch an "nmap" attack with: """ nmap -p 4567 <hostname> """ Then the output should match: """ 4567/tcps+open """ 113 ‣ Now fail your build by changing the Ansible Playbook to open up SSH on port 22 ‣ Comment out these lines (with #) in ansible-base.yml ‣ - name: disable ssh ‣ command: chkconfig off sshd ‣ command: rpm -e openssh-server ‣ Commit, then push, your changes into your repository ‣ git commit -a ‣ git push ‣ Watch your console log for the build that starts and see what happens Lab: Fail the Build 114
  • 58. Play Time Change the Ansible Playbook and Gauntlt attack files to test out different configurations Try patching the build and then seeing the results change in AWS Inspector 115 ‣ We now have a golden image, it’s time to deploy it into production ‣ This is the core of immutable infrastructure ‣ We will automatically deploy new images that pass all automated testing via rolling update ‣ Despite what you read, not everyone pushes every commit into production ‣ We will for demo purposes, but in a real environment you may want deeper testing and manual approvals ‣ The techniques we will show will work for even manual deployments Lab: From Build to Deploy 116
  • 59. ‣ Create a new CodeCommit repository in the AWS console ‣ Or command line if you know how ‣ Clone it to your Jenkins instance ‣ cd ~ ‣ git clone <url> ‣ Add the rolling_update.rb script ‣ sudo vim rolling_update.rb ‣ i to enter insert mode ‣ Copy and paste in the text of the code ‣ <esc> then :x ‣ git add -A ‣ git push ‣ In the AWS console, set your ASG for a Min/Desired instance count of 5 Lab: Add Deploy Script to Git 117 ‣ Name it “Rolling ASG Update” ‣ Under General check This build is parameterized ‣ Set two string parameters ‣ IMAGE_ID ‣ AUTOSCALE_GROUP ‣ Under Build add an Execute shell step ‣ gem install aws-sdk -N ‣ ruby rolling_update.rb -y $AUTOSCALE_GROUP $IMAGE_ID Lab: Create a Second Job 118
  • 60. ‣ Go back to your Website job ‣ Add a Post build action ‣ Trigger parameterized build on other projects ‣ Enter “Rolling ASG Update” (it will autocomplete) ‣ Add Parameters from properties file ‣ params.txt ‣ Add Predefined parameters ‣ AUTOSCALE_GROUP= Website ‣ (Or whatever you named your ASG) Lab: Trigger the Deploy Job After a Successful Build 119 ‣ Manually trigger a Website job ‣ Assuming it succeeds, it will then trigger the Rolling ASG Update job ‣ Now try a real-world scenario ‣ Change Ansible to update vulnerabilities detected by Inspector ‣ Commit to Git, and watch the build automatically start and roll out ‣ Instance colors will change as you have a mix of AMIs Lab: Automatic Rolling Updates 120
  • 61. ‣ There are a bunch of settings you need to substitute in the scripts (e.g. security group ID, subnet, etc.). Make sure those are all correct. ‣ If your subnet isn’t set to provide a public IP address, Gauntlt will fail based on how things are configured. It’s an easy fix from VPC > subnets under Actions. ‣ If you manually changed the auto scale group settings something may have gotten messed up. ‣ Or if the script partially ran, settings may be in an in-between state. ‣ In both cases, an easy fix is to swap back to the original launch configuration, then detach/ terminate the instances currently in the group. ‣ Make sure your job is set to clean the workspace before (or after) each run. Problems? Potential Fixes 121 Software Defined Security 122
  • 62. ‣Attackers are automated, we are mostly manual. ‣Our tools have been poor. ‣We lack trustable security automation and thus need to rely on a “Meat Cloud” ‣In cloud, APIs are mandatory. We can write code to automate and orchestrate, even across products and services. Software Defined Security 123 ‣ Work with your devs to build a library of building blocks ‣ Learn just enough to glue it together ‣ Build some core scrips ‣ Mix and match the blocks Code without coding 124
  • 63. ‣Meet SecuritySquirrel, the first warrior in the Rodent Army (apologies to Netflix). ‣The following tools are written by an analyst with a Ruby-for- Dummies book. ‣Automated security workflows spanning products and services. Demo 125 Pull server information (If you have it) 1 Detect Compromise 2 3 Quarantine 4 Image 5 Analyze 6 Recover = Hours! Each step is manual, and uses a different set of disconnected tools Incident Response 126
  • 64. 1. Pull metadata 2. Quarantine 3. Swap control to security team 4. Identify and image all storage 5. Launch and configure analysis server 6. Can re-launch clean server instantly 127 ‣ Security normally relies on scanning and checking databases. ‣ With cloud we are completely integrated into the infrastructure and platforms. ‣ The cloud controllers have to see everything to manage everything, there is no Neo running around. ‣ Instead of scanning, we can directly pull state. ‣ And then use it for security Stateless Security 128
  • 65. 1 Scan the network 2 Scan again and again for all the parts you missed 3 Identify all the servers as best you can 4 Pull a config mgmt report 5 Manually compare results Identify Unmanaged Servers (for the audit) 129 ‣ Get list of all servers from cloud controller (can filter on tags/ OS/etc). ‣ Single API call ‣ Get list of all servers from Chef ‣ Single API call ‣ Compare in code 130
  • 66. ‣ Key aspects: ‣ Authentication/authorization via Roles ‣ Initializing clients ‣ Understanding method and variable scope ‣ AWS SDK/JSON navigation ‣ Structs > hash > arrays ‣ Hidden complexities (e.g. ENIs and security groups) ‣ Tips ‣ Waiters ‣ Managing API limits ‣ CLI vs. SDK (—query) Code Walk Through W hiteboard 131 ‣ We’ve provided a library of code to start ‣ Define a security problem ‣ Incident Response ‣ Finding security holes ‣ Enabling security settings ‣ Break into teams ‣ Start programming Lab: Software Defined Security 132
  • 67. ‣ Cloud providers are creating hooks to trigger actions based on events inside the cloud. ‣ We can use these for near-instant security reactions. Event Driven Security 133 Self-Healing Infrastructure (yes, for real) Change a security group Event Recorded to CloudTrail Passed to CloudWatch Log Stream Triggers an CloudWatch Event Lambda Function analyzes and reverses 134
  • 68. ‣ Create a new Lambda function ‣ Paste in the provided code to revert security group changes ‣ Alter it to trigger based on a conditional ‣ Create a new CloudWatch Rule ‣ Service Name: EC2 ‣ Specific Operations: AuthorizeSecurityGroupIngress ‣ Target your Lambda function ‣ Add an SNS notification if you want ‣ Test it ‣ Free time? Write/edit your own Lab: Event Driven Security 135 Really… costs are minimal for our 2 days, but will add up if you leave things running. Reminder: We are not responsible for your AWS bill if you forget to delete things after class finishes. 136