SlideShare a Scribd company logo
Puppet on Windows
Ensuring you make the right first steps in
managing your Windows configuration
Nicolas Corrarello
Senior Technical Solutions Engineer | Puppet
sgtpepper @ irc.freenode.net
2
Agenda
• Introduction
• The Puppet RAL
• Windows Specific Resources (and interfaces!)
• Modules
• Profiles and Roles
• So where did my configuration go? (Data Separation)
• Ten first things…
• An example role
Puppetconf2016 Puppet on Windows
sgtpepper @ irc.freenode.net
Puppet on Windows 5
6
The Puppet RAL
That’s Resource Abstraction Layer
7
The Puppet RAL
8
service { 'wuauserv':
ensure => 'running',
enable => 'true',
}
sgtpepper @ irc.freenode.net
Windows specific resources
9
Extending the Puppet RAL: Windows specific
10sgtpepper @ irc.freenode.net
Interfaces…
Managing a Windows system is super easy.
Managing thousands of Windows systems…
11
Unix/Linux Windows
Text files, generally under /etc
Win32 API
Registry
Text Files (Generally INI)
(Power)Shell
GUI
WinRM
Proprietary / Binary Files
sgtpepper @ irc.freenode.net
And not all interfaces perform alike…
12Puppet on Windows
Modules
13
Modeling configuration: The BGInfo example
Requirements
● Package needs to be installed
● Configuration files created
● Run at login
● Loads of system info
How is this not a module, right?
14sgtpepper @ irc.freenode.net
package { 'bginfo':
ensure => installed,
provider => 'chocolatey',
}
file { $bgipath:
ensure => file,
source => $bgifile,
require => Package['bginfo'],
}
if $setonstart {
file { 'C:ProgramDataMicrosoftWindowsStart MenuProgramsStartUpbginfo.bat':
ensure => file,
content => template('bginfo/bginfo.bat.erb'),
}
}
What BGInfo needs…
15
Package: Thanks Chocolatey,
no need for complex MSIs
Configuration File: Ok static is
not ideal, but you know, MVP
Startup Script: Templated so
it works on all systems
sgtpepper @ irc.freenode.net
Raw?
16sgtpepper @ irc.freenode.net
Medium rare?
17sgtpepper @ irc.freenode.net
Assumptions
18
Requirements
● Package pre-requirements
● Firewall rules
● ESC
● Required values
● Things for which you don’t have defaults
● Sane defaults
● Are you breaking something else?
● Are you going outside what your module
is supposed to do
ASSUMPTION
THE MOTHER
OF ALL BAD THINGS
sgtpepper @ irc.freenode.net
19
Profiles & Roles
20
21
technology-specific wrapper classes
business-specific wrapper classes
sgtpepper @ irc.freenode.net
22
“One final note before we move on – the terms ‘Roles’
and ‘Profiles’ are ENTIRELY ARBITRARY. They’re not
magic reserve words in Puppet, and you can call them
whatever [..] you want. It’s also been pointed out that
Craig MIGHT have misnamed them (a ROLE should be
a model for an individual piece of tech, and a PROFILE
should probably be a group of roles)…”
Gary Larizza
Feb 17th, 2014
Extracted from www.garylarizza.com
sgtpepper @ irc.freenode.net
Profile module
Kind of good… not that reusable Better
Technology related classes that get applied to one or more nodes. One per
manifest, with the right naming convention.
23
class profile::windows::baseline {
class { 'domain_membership':
domain => 'CONTOSO',
username => 'domainadmin',
password => 'd0n0tst3alth1s.',
join_options => '3',
}
class { 'bginfo':
setonstart => true,
addtrustedsite => true,
}
}
class profile::windows::baseline {
include domain_membership
include bginfo
}
sgtpepper @ irc.freenode.net
Where did my configuration go?
Enter Hiera
24
Hiera: Lightweight Pluggable Hierarchical Database
Hierarchical storage of data, based on
facts
● Different kind of data structures, from
key / value to array
● Multiple backends (Default, YAML files)
Separate your code from your data, as you know…
when you write any kind of software!
25sgtpepper @ irc.freenode.net
Sensitive data?
26
---
plain-property: You can see me
encrypted-property: >
ENC[PKCS7,Y22exl+OvjDe+drmik2XEeD3VQtl1uZJXFFF2NnrMXDWx0csyqLB/2NOWefv
NBTZfOlPvMlAesyr4bUY4I5XeVbVk38XKxeriH69EFAD4CahIZlC8lkE/uDh
jJGQfh052eonkungHIcuGKY/5sEbbZl/qufjAtp/ufor15VBJtsXt17tXP4y
l5ZP119Fwq8xiREGOL0lVvFYJz2hZc1ppPCNG5lwuLnTekXN/OazNYpf4CMd
/HjZFXwcXRtTlzewJLc+/gox2IfByQRhsI/AgogRfYQKocZgFb/DOZoXR7wm
IZGeunzwhqfmEtGiqpvJJQ5wVRdzJVpTnANBA5qxeA==]
If you want to learn more about just how to work with sensitive data, see
“Nice and Secure: Good OpSec Hygiene with Puppet” at 3.45 PM
sgtpepper @ irc.freenode.net
Roles
27
● Roles only include profiles
● Every node is classified with one role
● Roles can use inheritance
● A slightly different role is another role
class role::windows::ecommerceweb {
include profile::windows::baseline
include profile::windows::dmzhost
include profile::windows::iis
include profile::windows::webapp
}
sgtpepper @ irc.freenode.net
Ten first things…
An example profile
28
An example profile, 10 first things
● Windows Firewall
● Filesystem ACLs
● Windows Time
● Monitoring Agent
● Registry Keys
What are the 10 first things you configure on a Windows system?
29
● Domain Membership
● BGInfo
● Antivirus
● Logon message
● Local Administrator
sgtpepper @ irc.freenode.net
Domain Membership
● Not a Puppet Supported Module
● Widely used
● Authored by Tom Linkin
● Use Hiera for data separation
Module trlinkin/domain_membership
30
class { 'domain_membership':
domain => 'puppet.example',
username => 'joinmember',
password => 'sUp3r_s3cR3t!',
join_options => '3',
}
sgtpepper @ irc.freenode.net
BGInfo
● Not a Puppet Supported Module
● Not widely used
● Authored by yours truly
Module ncorrare/bginfo
31
include bginfo
sgtpepper @ irc.freenode.net
Antivirus… Which?
● If you have an MSI, use the package
type, part of the core Puppet functionality
● Chocolatey packaging allows versioning!
● Do you need to configure something?
Model around it
Do you require to model configuration? Is it a centralised solution?
32
package { 'clamwin':
ensure => present,
provider => chocolatey,
}
sgtpepper @ irc.freenode.net
Logon Message
● Supported module
● Sets the registry keys
● Supports templates!
Module puppetlabs/motd
33
class { 'motd':
content => “Hello World!”,
}
sgtpepper @ irc.freenode.net
LocalAdministrator
● Both are
supported
● DSC support more
Windows Specific
attributes
User resource / DSC User resource provided by the puppetlabs/dsc module
34
dsc_user { 'localadmin':
dsc_username => 'localadmin',
dsc_description => 'Local Administrator user',
dsc_ensure => present,
dsc_password => {
'user' => 'localadmin',
'password' => 'very.secret'
},
dsc_passwordneverexpires => false,
dsc_disabled => true,
}
user { 'localadmin':
ensure => present,
password => 'very.secret',
}
sgtpepper @ irc.freenode.net
Windows Firewall
● Supported
● Manage by exception
DSC xFirewall resource provided by puppetlabs/dsc
35
dsc_xfirewall { 'Allow WinRM':
dsc_name => "$name Allow WinRM",
dsc_ensure => 'present',
dsc_direction => 'Inbound',
dsc_localport => '5985',
dsc_protocol => 'TCP',
dsc_action => 'Allow',
}
sgtpepper @ irc.freenode.net
FilesystemACLs
● Supported
● Set full ACLs
ACL resource provided by puppetlabs/acl
36
acl { 'c:/tempperms':
permissions => [
{ identity => 'Administrator', rights => ['full'] },
{ identity => 'Users', rights => ['read','execute'] }
],
}
sgtpepper @ irc.freenode.net
Windows Time Configuration
Registry Keys, Commands, Settings, Active Directory… or ncorrare/windowstime
37
class { 'windowstime':
servers => { 'pool.ntp.org' => '0x01',
'time.windows.com' => '0x01',
}
}
● Modeling registry keys and
services
● Or BYORK (Bring your own
registry key)
sgtpepper @ irc.freenode.net
MonitoringAgent… Which?
● If you have an MSI, use the package type, part of the
core Puppet functionality
● Chocolatey packaging allows versioning!
● Do you need to configure something? Model around it
● SCOM? Check https://technet.microsoft.com/en-us/
system-center-docs/om/manage/install-agent-using-
the-command-line
Do you require to model configuration? Is it a centralised solution?
38
package { 'SCOM':
ensure => present,
source => ‘MoMAgent.msi’,
}
sgtpepper @ irc.freenode.net
Registry Keys
registry_key / registry_value resources provided by the puppetlabs/registry
module
39
registry_key { 'HKLMSystemCurrentControlSetServicesPuppet':
ensure => present,
}
sgtpepper @ irc.freenode.net
An example role
Who wants cake?
40
An example role, FourthCoffee
What do I need to make this work?
● Baseline Profile
● IIS Profile
● FourthCoffee Profile
41sgtpepper @ irc.freenode.net
Steal this code!
● https://github.com/ncorrare/puppetconf2016-control
● Slides will be posted shortly
● Talk to a Linux sysad, you probably have more in common than you think!
Try it, break it, play with it, share it (just not on production)
42sgtpepper @ irc.freenode.net
Questions
43
Questions
Puppetconf2016 Puppet on Windows

More Related Content

What's hot (20)

PDF
Think Like a Hacker - Database Attack Vectors
Mark Ginnebaugh
 
PPTX
Owasp Indy Q2 2012 Advanced SQLi
owaspindy
 
PDF
Raúl Siles - Browser Exploitation for Fun and Profit Revolutions [RootedCON 2...
RootedCON
 
PPTX
mimikatz @ rmll
Benjamin Delpy
 
PDF
Libertyvasion2010
Jonathan Wage
 
PDF
Core Java Programming Language (JSE) : Chapter XII - Threads
WebStackAcademy
 
PPTX
Thotcon0x9 Presentation: Climb the infosec skill tree by revisiting past CVEs
Sandra Escandor-O'Keefe
 
PDF
Malware RADA
Conferencias FIST
 
PDF
Defcon CTF quals
snyff
 
PDF
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Rob Fuller
 
PDF
NSC #2 - D2 02 - Benjamin Delpy - Mimikatz
NoSuchCon
 
PDF
44 con slides
geeksec80
 
PPTX
BSides MCR 2016: From CSV to CMD to qwerty
Jerome Smith
 
PPTX
Горизонтальные перемещения в инфраструктуре Windows
Positive Hack Days
 
PPTX
Эксплуатируем неэксплуатируемые уязвимости SAP
Positive Hack Days
 
PDF
Everything you wanted to know about Stack Traces and Heap Dumps
Andrei Pangin
 
PPTX
SYN507: Reducing desktop infrastructure management overhead using “old school...
Denis Gundarev
 
PDF
Di and Dagger
K. Matthew Dupree
 
PPTX
Shytikov on NTLM Authentication
shytikov
 
PDF
Writing malware while the blue team is staring at you
Rob Fuller
 
Think Like a Hacker - Database Attack Vectors
Mark Ginnebaugh
 
Owasp Indy Q2 2012 Advanced SQLi
owaspindy
 
Raúl Siles - Browser Exploitation for Fun and Profit Revolutions [RootedCON 2...
RootedCON
 
mimikatz @ rmll
Benjamin Delpy
 
Libertyvasion2010
Jonathan Wage
 
Core Java Programming Language (JSE) : Chapter XII - Threads
WebStackAcademy
 
Thotcon0x9 Presentation: Climb the infosec skill tree by revisiting past CVEs
Sandra Escandor-O'Keefe
 
Malware RADA
Conferencias FIST
 
Defcon CTF quals
snyff
 
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Rob Fuller
 
NSC #2 - D2 02 - Benjamin Delpy - Mimikatz
NoSuchCon
 
44 con slides
geeksec80
 
BSides MCR 2016: From CSV to CMD to qwerty
Jerome Smith
 
Горизонтальные перемещения в инфраструктуре Windows
Positive Hack Days
 
Эксплуатируем неэксплуатируемые уязвимости SAP
Positive Hack Days
 
Everything you wanted to know about Stack Traces and Heap Dumps
Andrei Pangin
 
SYN507: Reducing desktop infrastructure management overhead using “old school...
Denis Gundarev
 
Di and Dagger
K. Matthew Dupree
 
Shytikov on NTLM Authentication
shytikov
 
Writing malware while the blue team is staring at you
Rob Fuller
 

Viewers also liked (13)

PPTX
Chef Hack Day Denver
Chef
 
PDF
Ansible for the Impatient Devops
Rick. Bahague
 
PDF
Infrastructure as Code for Beginners
David Völkel
 
PPTX
Building Windows Images with Packer
Matt Wrock
 
PPTX
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Puppet
 
PPTX
Compliance as Code: Velocity with Security - Fraser Pollock, Chef
Alert Logic
 
PDF
Usecase examples of Packer
Hiroshi SHIBATA
 
PDF
The Dark Side of PowerShell by George Dobrea
EC-Council
 
PPTX
Lateral Movement with PowerShell
kieranjacobsen
 
PDF
Infrastructure as Code
Robert Greiner
 
PPTX
Mastering DevOps With Oracle
Kelly Goetsch
 
PDF
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
enpit GmbH & Co. KG
 
ZIP
WebLogic Administration und Deployment mit WLST
enpit GmbH & Co. KG
 
Chef Hack Day Denver
Chef
 
Ansible for the Impatient Devops
Rick. Bahague
 
Infrastructure as Code for Beginners
David Völkel
 
Building Windows Images with Packer
Matt Wrock
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Puppet
 
Compliance as Code: Velocity with Security - Fraser Pollock, Chef
Alert Logic
 
Usecase examples of Packer
Hiroshi SHIBATA
 
The Dark Side of PowerShell by George Dobrea
EC-Council
 
Lateral Movement with PowerShell
kieranjacobsen
 
Infrastructure as Code
Robert Greiner
 
Mastering DevOps With Oracle
Kelly Goetsch
 
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
enpit GmbH & Co. KG
 
WebLogic Administration und Deployment mit WLST
enpit GmbH & Co. KG
 
Ad

Similar to Puppetconf2016 Puppet on Windows (20)

PDF
V mware
dvmug1
 
PDF
Puppet Primer, Robbie Jerrom, Solution Architect VMware
subtitle
 
PDF
Intro to-puppet
F.L. Jonathan Araña Cruz
 
PDF
Puppet - The IT automation software
agenedy
 
PDF
Webinar - Manage user, groups, packages in windows using puppet
OlinData
 
PPTX
Puppet for Developers
sagarhere4u
 
PPTX
Puppet_training
Afroz Hussain
 
PDF
Modules of the twenties
Puppet
 
PDF
Puppet: From 0 to 100 in 30 minutes
Alessandro Franceschi
 
PDF
Puppet Camp Berlin 2015: Nigel Kersten | Puppet Keynote
NETWAYS
 
PDF
Puppet Camp Berlin 2015: Puppet Keynote
Puppet
 
PDF
PuppetConf 2016: A Tale of Two Hierarchies: Group Policy & Puppet – Matt Ston...
Puppet
 
PDF
From SaltStack to Puppet and beyond...
Yury Bushmelev
 
PDF
Managing Windows Systems with Puppet - PuppetConf 2013
Puppet
 
PDF
Puppet Camp Melbourne 2014: Puppet and a DevOps Journey (Beginner)
Puppet
 
PDF
SCM Puppet: from an intro to the scaling
Stanislav Osipov
 
PPTX
Puppet
John Coggeshall
 
PDF
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
Puppet
 
PPT
State of Puppet 2013 - Puppet Camp DC
Puppet
 
ODP
Puppet slides for intelligrape
Sharad Aggarwal
 
V mware
dvmug1
 
Puppet Primer, Robbie Jerrom, Solution Architect VMware
subtitle
 
Intro to-puppet
F.L. Jonathan Araña Cruz
 
Puppet - The IT automation software
agenedy
 
Webinar - Manage user, groups, packages in windows using puppet
OlinData
 
Puppet for Developers
sagarhere4u
 
Puppet_training
Afroz Hussain
 
Modules of the twenties
Puppet
 
Puppet: From 0 to 100 in 30 minutes
Alessandro Franceschi
 
Puppet Camp Berlin 2015: Nigel Kersten | Puppet Keynote
NETWAYS
 
Puppet Camp Berlin 2015: Puppet Keynote
Puppet
 
PuppetConf 2016: A Tale of Two Hierarchies: Group Policy & Puppet – Matt Ston...
Puppet
 
From SaltStack to Puppet and beyond...
Yury Bushmelev
 
Managing Windows Systems with Puppet - PuppetConf 2013
Puppet
 
Puppet Camp Melbourne 2014: Puppet and a DevOps Journey (Beginner)
Puppet
 
SCM Puppet: from an intro to the scaling
Stanislav Osipov
 
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
Puppet
 
State of Puppet 2013 - Puppet Camp DC
Puppet
 
Puppet slides for intelligrape
Sharad Aggarwal
 
Ad

Recently uploaded (20)

PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PPTX
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
PPTX
MiniTool Partition Wizard Crack 12.8 + Serial Key Download Latest [2025]
filmoracrack9001
 
PPTX
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
PDF
Show Which Projects Support Your Strategy and Deliver Results with OnePlan df
OnePlan Solutions
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
Simplify React app login with asgardeo-sdk
vaibhav289687
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PDF
Introduction to Apache Iceberg™ & Tableflow
Alluxio, Inc.
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Build a Custom Agent for Agentic Testing.pptx
klpathrudu
 
PDF
10 Salesforce Consulting Companies in Sydney.pdf
DianApps Technologies
 
PDF
Code and No-Code Journeys: The Maintenance Shortcut
Applitools
 
PPTX
BB FlashBack Pro 5.61.0.4843 With Crack Free Download
cracked shares
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
PDF
NSF Converter Simplified: From Complexity to Clarity
Johnsena Crook
 
PDF
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
MiniTool Partition Wizard Crack 12.8 + Serial Key Download Latest [2025]
filmoracrack9001
 
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
Show Which Projects Support Your Strategy and Deliver Results with OnePlan df
OnePlan Solutions
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Simplify React app login with asgardeo-sdk
vaibhav289687
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
Introduction to Apache Iceberg™ & Tableflow
Alluxio, Inc.
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Build a Custom Agent for Agentic Testing.pptx
klpathrudu
 
10 Salesforce Consulting Companies in Sydney.pdf
DianApps Technologies
 
Code and No-Code Journeys: The Maintenance Shortcut
Applitools
 
BB FlashBack Pro 5.61.0.4843 With Crack Free Download
cracked shares
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
NSF Converter Simplified: From Complexity to Clarity
Johnsena Crook
 
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 

Puppetconf2016 Puppet on Windows

  • 1. Puppet on Windows Ensuring you make the right first steps in managing your Windows configuration Nicolas Corrarello Senior Technical Solutions Engineer | Puppet sgtpepper @ irc.freenode.net
  • 2. 2 Agenda • Introduction • The Puppet RAL • Windows Specific Resources (and interfaces!) • Modules • Profiles and Roles • So where did my configuration go? (Data Separation) • Ten first things… • An example role
  • 6. 6
  • 7. The Puppet RAL That’s Resource Abstraction Layer 7
  • 8. The Puppet RAL 8 service { 'wuauserv': ensure => 'running', enable => 'true', } sgtpepper @ irc.freenode.net
  • 10. Extending the Puppet RAL: Windows specific 10sgtpepper @ irc.freenode.net
  • 11. Interfaces… Managing a Windows system is super easy. Managing thousands of Windows systems… 11 Unix/Linux Windows Text files, generally under /etc Win32 API Registry Text Files (Generally INI) (Power)Shell GUI WinRM Proprietary / Binary Files sgtpepper @ irc.freenode.net
  • 12. And not all interfaces perform alike… 12Puppet on Windows
  • 14. Modeling configuration: The BGInfo example Requirements ● Package needs to be installed ● Configuration files created ● Run at login ● Loads of system info How is this not a module, right? 14sgtpepper @ irc.freenode.net
  • 15. package { 'bginfo': ensure => installed, provider => 'chocolatey', } file { $bgipath: ensure => file, source => $bgifile, require => Package['bginfo'], } if $setonstart { file { 'C:ProgramDataMicrosoftWindowsStart MenuProgramsStartUpbginfo.bat': ensure => file, content => template('bginfo/bginfo.bat.erb'), } } What BGInfo needs… 15 Package: Thanks Chocolatey, no need for complex MSIs Configuration File: Ok static is not ideal, but you know, MVP Startup Script: Templated so it works on all systems sgtpepper @ irc.freenode.net
  • 17. Medium rare? 17sgtpepper @ irc.freenode.net
  • 18. Assumptions 18 Requirements ● Package pre-requirements ● Firewall rules ● ESC ● Required values ● Things for which you don’t have defaults ● Sane defaults ● Are you breaking something else? ● Are you going outside what your module is supposed to do ASSUMPTION THE MOTHER OF ALL BAD THINGS sgtpepper @ irc.freenode.net
  • 19. 19
  • 21. 21 technology-specific wrapper classes business-specific wrapper classes sgtpepper @ irc.freenode.net
  • 22. 22 “One final note before we move on – the terms ‘Roles’ and ‘Profiles’ are ENTIRELY ARBITRARY. They’re not magic reserve words in Puppet, and you can call them whatever [..] you want. It’s also been pointed out that Craig MIGHT have misnamed them (a ROLE should be a model for an individual piece of tech, and a PROFILE should probably be a group of roles)…” Gary Larizza Feb 17th, 2014 Extracted from www.garylarizza.com sgtpepper @ irc.freenode.net
  • 23. Profile module Kind of good… not that reusable Better Technology related classes that get applied to one or more nodes. One per manifest, with the right naming convention. 23 class profile::windows::baseline { class { 'domain_membership': domain => 'CONTOSO', username => 'domainadmin', password => 'd0n0tst3alth1s.', join_options => '3', } class { 'bginfo': setonstart => true, addtrustedsite => true, } } class profile::windows::baseline { include domain_membership include bginfo } sgtpepper @ irc.freenode.net
  • 24. Where did my configuration go? Enter Hiera 24
  • 25. Hiera: Lightweight Pluggable Hierarchical Database Hierarchical storage of data, based on facts ● Different kind of data structures, from key / value to array ● Multiple backends (Default, YAML files) Separate your code from your data, as you know… when you write any kind of software! 25sgtpepper @ irc.freenode.net
  • 26. Sensitive data? 26 --- plain-property: You can see me encrypted-property: > ENC[PKCS7,Y22exl+OvjDe+drmik2XEeD3VQtl1uZJXFFF2NnrMXDWx0csyqLB/2NOWefv NBTZfOlPvMlAesyr4bUY4I5XeVbVk38XKxeriH69EFAD4CahIZlC8lkE/uDh jJGQfh052eonkungHIcuGKY/5sEbbZl/qufjAtp/ufor15VBJtsXt17tXP4y l5ZP119Fwq8xiREGOL0lVvFYJz2hZc1ppPCNG5lwuLnTekXN/OazNYpf4CMd /HjZFXwcXRtTlzewJLc+/gox2IfByQRhsI/AgogRfYQKocZgFb/DOZoXR7wm IZGeunzwhqfmEtGiqpvJJQ5wVRdzJVpTnANBA5qxeA==] If you want to learn more about just how to work with sensitive data, see “Nice and Secure: Good OpSec Hygiene with Puppet” at 3.45 PM sgtpepper @ irc.freenode.net
  • 27. Roles 27 ● Roles only include profiles ● Every node is classified with one role ● Roles can use inheritance ● A slightly different role is another role class role::windows::ecommerceweb { include profile::windows::baseline include profile::windows::dmzhost include profile::windows::iis include profile::windows::webapp } sgtpepper @ irc.freenode.net
  • 28. Ten first things… An example profile 28
  • 29. An example profile, 10 first things ● Windows Firewall ● Filesystem ACLs ● Windows Time ● Monitoring Agent ● Registry Keys What are the 10 first things you configure on a Windows system? 29 ● Domain Membership ● BGInfo ● Antivirus ● Logon message ● Local Administrator sgtpepper @ irc.freenode.net
  • 30. Domain Membership ● Not a Puppet Supported Module ● Widely used ● Authored by Tom Linkin ● Use Hiera for data separation Module trlinkin/domain_membership 30 class { 'domain_membership': domain => 'puppet.example', username => 'joinmember', password => 'sUp3r_s3cR3t!', join_options => '3', } sgtpepper @ irc.freenode.net
  • 31. BGInfo ● Not a Puppet Supported Module ● Not widely used ● Authored by yours truly Module ncorrare/bginfo 31 include bginfo sgtpepper @ irc.freenode.net
  • 32. Antivirus… Which? ● If you have an MSI, use the package type, part of the core Puppet functionality ● Chocolatey packaging allows versioning! ● Do you need to configure something? Model around it Do you require to model configuration? Is it a centralised solution? 32 package { 'clamwin': ensure => present, provider => chocolatey, } sgtpepper @ irc.freenode.net
  • 33. Logon Message ● Supported module ● Sets the registry keys ● Supports templates! Module puppetlabs/motd 33 class { 'motd': content => “Hello World!”, } sgtpepper @ irc.freenode.net
  • 34. LocalAdministrator ● Both are supported ● DSC support more Windows Specific attributes User resource / DSC User resource provided by the puppetlabs/dsc module 34 dsc_user { 'localadmin': dsc_username => 'localadmin', dsc_description => 'Local Administrator user', dsc_ensure => present, dsc_password => { 'user' => 'localadmin', 'password' => 'very.secret' }, dsc_passwordneverexpires => false, dsc_disabled => true, } user { 'localadmin': ensure => present, password => 'very.secret', } sgtpepper @ irc.freenode.net
  • 35. Windows Firewall ● Supported ● Manage by exception DSC xFirewall resource provided by puppetlabs/dsc 35 dsc_xfirewall { 'Allow WinRM': dsc_name => "$name Allow WinRM", dsc_ensure => 'present', dsc_direction => 'Inbound', dsc_localport => '5985', dsc_protocol => 'TCP', dsc_action => 'Allow', } sgtpepper @ irc.freenode.net
  • 36. FilesystemACLs ● Supported ● Set full ACLs ACL resource provided by puppetlabs/acl 36 acl { 'c:/tempperms': permissions => [ { identity => 'Administrator', rights => ['full'] }, { identity => 'Users', rights => ['read','execute'] } ], } sgtpepper @ irc.freenode.net
  • 37. Windows Time Configuration Registry Keys, Commands, Settings, Active Directory… or ncorrare/windowstime 37 class { 'windowstime': servers => { 'pool.ntp.org' => '0x01', 'time.windows.com' => '0x01', } } ● Modeling registry keys and services ● Or BYORK (Bring your own registry key) sgtpepper @ irc.freenode.net
  • 38. MonitoringAgent… Which? ● If you have an MSI, use the package type, part of the core Puppet functionality ● Chocolatey packaging allows versioning! ● Do you need to configure something? Model around it ● SCOM? Check https://technet.microsoft.com/en-us/ system-center-docs/om/manage/install-agent-using- the-command-line Do you require to model configuration? Is it a centralised solution? 38 package { 'SCOM': ensure => present, source => ‘MoMAgent.msi’, } sgtpepper @ irc.freenode.net
  • 39. Registry Keys registry_key / registry_value resources provided by the puppetlabs/registry module 39 registry_key { 'HKLMSystemCurrentControlSetServicesPuppet': ensure => present, } sgtpepper @ irc.freenode.net
  • 40. An example role Who wants cake? 40
  • 41. An example role, FourthCoffee What do I need to make this work? ● Baseline Profile ● IIS Profile ● FourthCoffee Profile 41sgtpepper @ irc.freenode.net
  • 42. Steal this code! ● https://github.com/ncorrare/puppetconf2016-control ● Slides will be posted shortly ● Talk to a Linux sysad, you probably have more in common than you think! Try it, break it, play with it, share it (just not on production) 42sgtpepper @ irc.freenode.net