SlideShare ist ein Scribd-Unternehmen logo
1 von 23
TDD for IaaC
the future trend
Dnipro, 28th feb 2018 Gianfranco Panico
проĐČіт
I am Gianfranco
Dreaming of a world with more and better
automation:
- spreading DevOps mentality
- educating to correct InfraDev approach
Why Testing IaaC

 and why we aren’t already doing it!
1
“
“Confidence in code
without tests
is false confidence”.
Buddha
Typical IaaC
caveats
The 200 paradigm
Stack deployments in the Cloud
are mostly requests to undergo
some provisioning actions. HTTP
status 200 means ‘copy’ not
‘done’.
Cloud provider changes
AWS keeps “improving” their
offer – adding instance types,
increasing the length of some IDs,
changing SSL certs for services –
every second day.
Collaboration
I ansible this box here, you
terraform that DB instance there,
works fine, right?
Delays & Dependancies
That forgotten firewall rule that
won’t let you download the
Docker image from your registry.
Timeouts
Lambdas timeout happily. Cross
region transfers – guess what? –
do timeout too!
Some operations with infras are
inherently long, and don’t give
much sign of progression.
Works
 too much
The resource is deployed, the
service is up, the port is open.
And all other 65534 ports are –
as well!
Infra as a Code
means
applying SDLC methods and
tooling to Infrastructure
Development
TDD teachings
Let’s learn from our beloved Devs
2
TDD loop
1. THINK of an expected behaviour
2. WRITE a test that fails
3. WRITE code to pass the test
4. REFACTOR
5. GOTO 1.
1. THINK of an expected behaviour
2. WRITE a test that fails
3. WRITE code to pass the test
4. REFACTOR
5. GOTO 1.
var strong = isStrongPassword('password string');
describe('isPasswordStrong', function() {
it('should give negative result for empty string', function() {
var password = '';
var result = isPasswordStrong(password);
expect(result).to.be.false;
});
});
function isPasswordStrong(password) {
if(!password) {
return false;
}
}
unit
integration
Oh Not Yet Another Test Pyramid
acceptance
Do our CD scripts work?
Are instances up?
Am I missing some best
coding practice?
Is code style “decent” enough?
Can they connect
to the DB/ELB
?
Is Bastion Host up and connectable?
How’s the security of VPCs?
Am I actually solving the right problem?
slow
expensive
Test types for Infra
Unit
◇ No code is actually
run
◇ Check internal
consistency
◇ Check format/style
◇ Check intrinsic
language constructs
Integration
◇ Code is run
◇ Systems are
provisioned
◇ The result is
validated
◇ E2E / functional
testing goes here
Security
◇ On already deployed
infra
◇ Scans for “excesses”
◇ Respondance to
hardening
standards
◇ Infra-compliance
The tools?
Are here.
*specLinter
Unit testing
IaaC
Formatter
Ruby
terraform
puppet
rubocop
YAML
ansible_spec
foodcritic
align-yaml
HCL
tf fmt
chef
ansible
chefspec
tflint
terraform-spec
tf plan
ansible-lint
tf validate
rubocop & foodcritic
validate, fmt & tflint
chefspec
Functional
Integration
testing IaaC
Ruby
terraform
puppet
YAML HCL
chef
ansible
ServerSpec
tf plan
ansible --check
AWSpec
kitchenCI
ansible Terraform
kitchen-terraform provisioner
(on Vagrant)
YAML HCL
Ruby
puppetchef
$ kitchen converge
ServerSpec
InSpec
Acceptance
Security
testing IaaC
Ruby
puppet
nmap
chef
InSpec
gauntlt
Se
BDD-security
Owasp zed
attack proxy
Computing the sha384sum digest of the deployable
package
$ sha512sum app123.war > app123.sig
and then having Jenkins verify the checksum at deploy
stage
$ sha512sum –c app123.sig app123.war 2>&1 |
grep OK
app_v123.war: OK
Trustable artifact
to guarantee that each and every deployable component had been built through
automation, and as such, has been tested fully before being promoted to production.
Compliance
Compliance
IaaC
AWS
Config
AWS
Lambda
CloudTrail
CloudWatch
signed-artifact
deployment
What to do next
spread the voice
develop &
share tools
build best
practices
Thanks!
Any questions?
Credits: PPT template by SlidesCarnival

Weitere Àhnliche Inhalte

Was ist angesagt?

DevSecOps Training Bootcamp - A Practical DevSecOps Course
DevSecOps Training Bootcamp - A Practical DevSecOps CourseDevSecOps Training Bootcamp - A Practical DevSecOps Course
DevSecOps Training Bootcamp - A Practical DevSecOps Course
Tonex
 

Was ist angesagt? (20)

DevSecOps : an Introduction
DevSecOps : an IntroductionDevSecOps : an Introduction
DevSecOps : an Introduction
 
DevSecOps: essential tooling to enable continuous security 2019-09-16
DevSecOps: essential tooling to enable continuous security 2019-09-16DevSecOps: essential tooling to enable continuous security 2019-09-16
DevSecOps: essential tooling to enable continuous security 2019-09-16
 
Clean architecture with Python
Clean architecture with PythonClean architecture with Python
Clean architecture with Python
 
DevSecOps Singapore introduction
DevSecOps Singapore introductionDevSecOps Singapore introduction
DevSecOps Singapore introduction
 
Integrate Security into DevOps - SecDevOps
Integrate Security into DevOps - SecDevOpsIntegrate Security into DevOps - SecDevOps
Integrate Security into DevOps - SecDevOps
 
DevSecOps | DevOps Sec
DevSecOps | DevOps SecDevSecOps | DevOps Sec
DevSecOps | DevOps Sec
 
DevSecops: Defined, tools, characteristics, tools, frameworks, benefits and c...
DevSecops: Defined, tools, characteristics, tools, frameworks, benefits and c...DevSecops: Defined, tools, characteristics, tools, frameworks, benefits and c...
DevSecops: Defined, tools, characteristics, tools, frameworks, benefits and c...
 
DevSecOps Training Bootcamp - A Practical DevSecOps Course
DevSecOps Training Bootcamp - A Practical DevSecOps CourseDevSecOps Training Bootcamp - A Practical DevSecOps Course
DevSecOps Training Bootcamp - A Practical DevSecOps Course
 
ABN AMRO DevSecOps Journey
ABN AMRO DevSecOps JourneyABN AMRO DevSecOps Journey
ABN AMRO DevSecOps Journey
 
Benefits of DevSecOps
Benefits of DevSecOpsBenefits of DevSecOps
Benefits of DevSecOps
 
Zero to Ninety in Securing DevOps
Zero to Ninety in Securing DevOpsZero to Ninety in Securing DevOps
Zero to Ninety in Securing DevOps
 
Dev week cloud world conf2021
Dev week cloud world conf2021Dev week cloud world conf2021
Dev week cloud world conf2021
 
DevSecOps, The Good, Bad, and Ugly
DevSecOps, The Good, Bad, and UglyDevSecOps, The Good, Bad, and Ugly
DevSecOps, The Good, Bad, and Ugly
 
Introduction to DevSecOps
Introduction to DevSecOpsIntroduction to DevSecOps
Introduction to DevSecOps
 
Security Patterns for Microservice Architectures - London Java Community 2020
Security Patterns for Microservice Architectures - London Java Community 2020Security Patterns for Microservice Architectures - London Java Community 2020
Security Patterns for Microservice Architectures - London Java Community 2020
 
PIACERE - DevSecOps Automated
PIACERE - DevSecOps AutomatedPIACERE - DevSecOps Automated
PIACERE - DevSecOps Automated
 
DevSecOps Beginners Guide : How to secure process in DevOps with OpenSource
DevSecOps Beginners Guide : How to secure process in DevOps with OpenSourceDevSecOps Beginners Guide : How to secure process in DevOps with OpenSource
DevSecOps Beginners Guide : How to secure process in DevOps with OpenSource
 
Code review - networkshop44
Code review - networkshop44Code review - networkshop44
Code review - networkshop44
 
DevSecOps: What Why and How : Blackhat 2019
DevSecOps: What Why and How : Blackhat 2019DevSecOps: What Why and How : Blackhat 2019
DevSecOps: What Why and How : Blackhat 2019
 
A journey from dev ops to devsecops
A journey from dev ops to devsecopsA journey from dev ops to devsecops
A journey from dev ops to devsecops
 

Ähnlich wie Test driven development for infrastructure as-a-code, the future trend_Gianfranco Panico

How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....
Mike Harris
 
Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!
Joel Farris
 

Ähnlich wie Test driven development for infrastructure as-a-code, the future trend_Gianfranco Panico (20)

Testability for developers – Fighting a mess by making it testable
Testability for developers – Fighting a mess by making it testableTestability for developers – Fighting a mess by making it testable
Testability for developers – Fighting a mess by making it testable
 
Java Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
Java Hurdling: Obstacles and Techniques in Java Client Penetration-TestingJava Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
Java Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
 
Search for Vulnerabilities Using Static Code Analysis
Search for Vulnerabilities Using Static Code AnalysisSearch for Vulnerabilities Using Static Code Analysis
Search for Vulnerabilities Using Static Code Analysis
 
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
 
DevOps - Boldly Go for Distro
DevOps - Boldly Go for DistroDevOps - Boldly Go for Distro
DevOps - Boldly Go for Distro
 
Deliver Faster with BDD/TDD - Designing Automated Tests That Don't Suck
Deliver Faster with BDD/TDD - Designing Automated Tests That Don't SuckDeliver Faster with BDD/TDD - Designing Automated Tests That Don't Suck
Deliver Faster with BDD/TDD - Designing Automated Tests That Don't Suck
 
We're going on a bug hunt! Experts Talk Manchester 2018
We're going on a bug hunt! Experts Talk Manchester 2018We're going on a bug hunt! Experts Talk Manchester 2018
We're going on a bug hunt! Experts Talk Manchester 2018
 
ExpertTalks Manchester September 2018
ExpertTalks Manchester September 2018ExpertTalks Manchester September 2018
ExpertTalks Manchester September 2018
 
Code Quality Practice and Tools
Code Quality Practice and ToolsCode Quality Practice and Tools
Code Quality Practice and Tools
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
 
StHack 2014 - Jerome "@funoverip" Nokin Turning your managed av into my botnet
StHack 2014 - Jerome "@funoverip" Nokin  Turning your managed av into my botnetStHack 2014 - Jerome "@funoverip" Nokin  Turning your managed av into my botnet
StHack 2014 - Jerome "@funoverip" Nokin Turning your managed av into my botnet
 
Getting Started With Testing
Getting Started With TestingGetting Started With Testing
Getting Started With Testing
 
АНДРІЙ йУМАДА «To Cover Uncoverable» Online WDDay 2022 js
АНДРІЙ йУМАДА «To Cover Uncoverable» Online WDDay 2022 jsАНДРІЙ йУМАДА «To Cover Uncoverable» Online WDDay 2022 js
АНДРІЙ йУМАДА «To Cover Uncoverable» Online WDDay 2022 js
 
Atlassian - Software For Every Team
Atlassian - Software For Every TeamAtlassian - Software For Every Team
Atlassian - Software For Every Team
 
The "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsThe "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/Ops
 
Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)
 
How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ Tokopedia
 
Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!
 

Mehr von Katherine Golovinova

Mehr von Katherine Golovinova (20)

Contract-based Testing Approach as a Tool for Shift Lef
Contract-based Testing Approach as a Tool for Shift LefContract-based Testing Approach as a Tool for Shift Lef
Contract-based Testing Approach as a Tool for Shift Lef
 
Speed up application testing with azure container instances
Speed up application testing with azure container instancesSpeed up application testing with azure container instances
Speed up application testing with azure container instances
 
Analyzing application activities with KSQL and Elasticsearch
Analyzing application activities with KSQL and ElasticsearchAnalyzing application activities with KSQL and Elasticsearch
Analyzing application activities with KSQL and Elasticsearch
 
Testing Big Data solutions fast and furiously
Testing Big Data solutions fast and furiouslyTesting Big Data solutions fast and furiously
Testing Big Data solutions fast and furiously
 
"Fast & Fail in real life of DevTestSecOps"
"Fast & Fail in real life of DevTestSecOps""Fast & Fail in real life of DevTestSecOps"
"Fast & Fail in real life of DevTestSecOps"
 
Geodistributed databases - what, how, and why?
Geodistributed databases - what, how, and why?Geodistributed databases - what, how, and why?
Geodistributed databases - what, how, and why?
 
COSMOS DB - geodistributed database for anyone
COSMOS DB - geodistributed database for anyoneCOSMOS DB - geodistributed database for anyone
COSMOS DB - geodistributed database for anyone
 
Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?
 
Azure Functions - the evolution of microservices platform or marketing gibber...
Azure Functions - the evolution of microservices platform or marketing gibber...Azure Functions - the evolution of microservices platform or marketing gibber...
Azure Functions - the evolution of microservices platform or marketing gibber...
 
Gatling and Page Object: a way to performance testing
Gatling and Page Object: a way to performance testingGatling and Page Object: a way to performance testing
Gatling and Page Object: a way to performance testing
 
Automation of Security scanning easy or cheese
Automation of Security scanning easy or cheeseAutomation of Security scanning easy or cheese
Automation of Security scanning easy or cheese
 
Gradle plugins for Test Automation
Gradle plugins for Test AutomationGradle plugins for Test Automation
Gradle plugins for Test Automation
 
Automation world under the DevTestSecOps umbrella
Automation world under the DevTestSecOps umbrellaAutomation world under the DevTestSecOps umbrella
Automation world under the DevTestSecOps umbrella
 
"Disaster Recovery in Azure" by Viktor Kocherha
"Disaster Recovery in Azure" by Viktor Kocherha"Disaster Recovery in Azure" by Viktor Kocherha
"Disaster Recovery in Azure" by Viktor Kocherha
 
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin
 
"Modern CI/CD" by Dmytro Batiievskyi
"Modern CI/CD" by Dmytro Batiievskyi"Modern CI/CD" by Dmytro Batiievskyi
"Modern CI/CD" by Dmytro Batiievskyi
 
EPAM DevOps community meetup: Building CI/CD for microservice architecture
EPAM DevOps community meetup: Building CI/CD for microservice architectureEPAM DevOps community meetup: Building CI/CD for microservice architecture
EPAM DevOps community meetup: Building CI/CD for microservice architecture
 
EPAM DevOps community meetup: Designing bare metal Kubernetes clusters
EPAM DevOps community meetup: Designing bare metal Kubernetes clustersEPAM DevOps community meetup: Designing bare metal Kubernetes clusters
EPAM DevOps community meetup: Designing bare metal Kubernetes clusters
 
Hosting Microservices in Microsoft Azure
Hosting Microservices in Microsoft AzureHosting Microservices in Microsoft Azure
Hosting Microservices in Microsoft Azure
 
Infrastructure as Code for Azure: ARM or Terraform?
Infrastructure as Code for Azure: ARM or Terraform?Infrastructure as Code for Azure: ARM or Terraform?
Infrastructure as Code for Azure: ARM or Terraform?
 

KĂŒrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

KĂŒrzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Test driven development for infrastructure as-a-code, the future trend_Gianfranco Panico

Hinweis der Redaktion

  1. Always think to a failing situation first. Model a failing test. Rework that.