SlideShare a Scribd company logo
Configuration
Management with
Cfengine
Steven Kreuzer
NYC BSD Users Group
July 2008
Configuration Management
 Configuration management facilities
provide efficient solutions to complex
problems. For example:
How do I manage configuration files?
How do I know maintenance tasks, such as,
backups are completed at the right times in
the right places?
How do I ensure that important system files
are properly protected against unauthorized
access and modification?
Host life cycle
What is Cfengine?
“Cfengine … is an
autonomous agent and a
middle to high level policy
language and agent for
building expert systems to
administrate and configure
large computer networks.”
http://www.cfengine.org/
What to do with a tool like this…
 Ensure that files altered by package
managers are correctly tailored and
adjusted to perform in your environment.
 Verify that processes are (or aren’t)
running.
 Monitor disk usage and provide warning
when file-systems are full
 Search and identify file changes to
maintain system security or for locating
human error.
Components
 cfagent - interprets policy and implements
in a convergent manner
 cfexecd – is a scheduler and wrapper,
sends you email.
 cfservd - server daemon for remote copy
and execution
 cfrun - trivial helper app that polls hosts
and tells them to run cfagent
Additional components
 cfenvd - state monitor, collects statistics
for anomaly detection
 cfkey - generates public-private key pairs
(once) on a host
Commonly Used Terms…
 Host – Server of any kind
 Classes – Group of hosts sharing a
common policy (www_servers,
db_servers, freebsd7_servers,
openbsd41_servers)
 Policy – The description of a configuration
 Configuration – The state of files,
processes, system resources on a host
Getting started
 Installing
On FreeBSD (and possibly OpenBSD)
 pkg_add –r cfengine
 cd /usr/ports/sysutils/cfengine && make install
From Source
 tar zxf cfegnine-${VERSION}.tar.gz
 cd cfengine-${VERSION}
 ./configure
 make install
Getting it running on one host
 Things to think about
Writing a policy / configuration
Getting trusted communication working
 Autonomy: Always have a local copy of
policy to minimize dependencies
Each host has /var/cfegine
bin, inputs, outputs, state
 Ultimately let Cfengine configure itself
Testing on a single host
$ vi /var/cfengine/inputs/cfagent.conf
control:
actionsequence = ( shellcommands )
shellcommands:
“/bin/echo Hello, World!”
$ /usr/local/sbin/cfagent –f ./cfagent.conf
cfengine:erdinger:/bin/echo Hello: Hello, World!
Quick setup for multiple hosts
 Decide policy: cfagent.conf
 Distribute policy: cfservd.conf
 Setup clients to install themselves:
update.conf
 Suppose 192.168.1.0/24 network
cfservd.conf
control:
domain = ( lab.exit2shell.com )
MaxConnections = ( 50 )
AllowConnectionsFrom = ( 192.168.1.0/24 )
TrustKeysFrom = ( 192.168.1.0/24 )
admit:
/var/cfengine/inputs 192.168.*
/var/cfengine/ppkeys/localhost.pub 192.168.*
cfagent.conf
control:
domain = ( lab.exit2shell.com )
schedule = ( Min10_15 Min30_35 Min50_55 )
ChecksumUpdates = ( on )
import:
any::
cf.groups
cf.site
freebsd::
cf.freebsd
update.conf
control:
actionsequence = ( copy tidy )
domain = ( lab.exit2shell.com )
policyhost = ( erdinger )
master_cfinput = ( /var/cfengine/inputs )
workdir = ( /var/cfengine )
SplayTime = ( 10 ) # minutes
copy:
$(master_cfinput) dest=$(workdir)/inputs
r=inf mode=700 type=checksum
include=cf.* include=*.conf
exclude=*.lst exclude=*.bak exclude=.* exclude=*~ exclude=#*
server=$(policyhost)
trustkey=true
tidy:
$(workdir)/outputs pattern=* age=7
cf.groups
groups:
web_servers = ( www0 www1 www2)
db_servers = ( db0 db1 db2 )
cf.site (part 1)
control:
actionsequence = ( files tidy editfiles )
editfilesize = ( 0 )
any::
tmpdir = ( /tmp )
freebsd|openbsd::
shadowfile = ( /etc/master.passwd )
shadowpermissions = ( 600 ) filegroup = ( wheel )
crondir = ( /var/cron/tabs )
linux::
shadowfile = ( /etc/shadow )
shadowpermissions = ( 400 ) filegroup = ( root )
crondir = ( /var/spool/cron )
cf.site (part 2)
files:
any::
${shadowfile}
mode=$(shadowpermissions)
owner=root group=$(filegroup)
action=fixall
/etc/passwd
mode=644 owner=root
group=$(filegroup) action=fixall
cf.site (part 3)
tidy:
any::
$(tmpdir) pattern=* age=7
recurse=inf rmdirs=sub
/var/tmp pattern=* age=7
recurse=inf rmdirs=sub
editfiles:
any::
{ /etc/services
AppendIfNoSuchLine "cfengine 5308/tcp“
AppendIfNoSuchLine "cfengine 5308/udp“
}
cf.freebsd (part 1)
control:
ActionSequence = ( packages editfiles)
DefaultPkgMgr = ( freebsd)
FreeBSDInstallCommand =
( "/usr/sbin/pkg_add
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/
packages-7-stable/All/%s" )
FreeBSDRemoveCommand =
("/usr/sbin/pkg_delete %s" )
cf.freebsd (part 2)
packages:
freebsd.any::
pdksh-5.2.14p2_2.tbz action=install
sudo-1.6.9.15_1.tbz action=install
vim-lite-7.1.293_1.tbz action=install
freebsd.web_servers::
apache-2.0.63.tbz action=install
memcached-1.2.5.tbz action=install
p5-DBD-Pg-2.6.4.tbz action=install
mod_perl2-2.0.3_3,3.tbz action=install
varnish-1.1.2.tbz action=install
freebsd.db_servers::
postgresql-client-8.3.1.tbz action=install
postgresql-server-8.3.1.tbz action=install
cf.freebsd (part 3)
editfiles:
freebsd.any::
{ /etc/rc.conf
Backup "false"
AppendIfNoSuchLine "sshd_enable="YES"“
}
freebsd.web_servers::
{ /etc/rc.conf
Backup "false“
AppendIfNoSuchLine "apache2_enable="YES“”
}
Special Thanks
 Mark Burgess
 Wrote Cfengine
 Borrowed heavily from his talks
 http://www.cs.virginia.edu/sigbed/archives/2006-04/Marc.pdf
 http://www.cfengine.org/AutonomicCfengine.pdf
 Jeremy Mates
 Borrowed some slides from his talk
 http://sial.org/talks/kickstart-cfengine/
Questions

More Related Content

What's hot

Docker & CoreOS at Utah Gophers
Docker & CoreOS at Utah GophersDocker & CoreOS at Utah Gophers
Docker & CoreOS at Utah Gophers
Josh Braegger
 
Terminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partITerminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partI
Kedar Bhandari
 
Ansible with-junos
Ansible with-junosAnsible with-junos
Ansible with-junos
Akhmad Zaimi
 
Containers: What are they, Really?
Containers: What are they, Really?Containers: What are they, Really?
Containers: What are they, Really?
Sneha Inguva
 
Configuration Management in Ansible
Configuration Management in Ansible Configuration Management in Ansible
Configuration Management in Ansible
Bangladesh Network Operators Group
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
Stephane Manciot
 
An example Hadoop Install
An example Hadoop InstallAn example Hadoop Install
An example Hadoop Install
Mike Frampton
 
Docker e postgresql
Docker e postgresqlDocker e postgresql
Docker e postgresql
Fernando Ike
 
A journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service managementA journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service management
Lubomir Rintel
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
lutter
 
Running hadoop on ubuntu linux
Running hadoop on ubuntu linuxRunning hadoop on ubuntu linux
Running hadoop on ubuntu linux
TRCK
 
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونیاسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
Mohammad Reza Kamalifard
 
Clase4 (consola linux)
Clase4 (consola linux)Clase4 (consola linux)
Clase4 (consola linux)
Miguel Eduardo Luces
 
Steam Learn: Composer
Steam Learn: ComposerSteam Learn: Composer
Steam Learn: Composer
inovia
 
Clojure + MongoDB on Heroku
Clojure + MongoDB on HerokuClojure + MongoDB on Heroku
Clojure + MongoDB on Heroku
Naoyuki Kakuda
 
Bash Scripting Workshop
Bash Scripting WorkshopBash Scripting Workshop
Bash Scripting Workshop
Ahmed Magdy Ezzeldin, MSc.
 
37562259 top-consuming-process
37562259 top-consuming-process37562259 top-consuming-process
37562259 top-consuming-process
skumner
 
Summit demystifying systemd1
Summit demystifying systemd1Summit demystifying systemd1
Summit demystifying systemd1
Susant Sahani
 
Mac OS X Lion で作る WordPress local 環境
Mac OS X Lion で作る WordPress local 環境Mac OS X Lion で作る WordPress local 環境
Mac OS X Lion で作る WordPress local 環境
Yuriko IKEDA
 
100+ run commands for windows
100+ run commands for windows 100+ run commands for windows
100+ run commands for windows
Anand Garg
 

What's hot (20)

Docker & CoreOS at Utah Gophers
Docker & CoreOS at Utah GophersDocker & CoreOS at Utah Gophers
Docker & CoreOS at Utah Gophers
 
Terminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partITerminal basic-commands(Unix) -partI
Terminal basic-commands(Unix) -partI
 
Ansible with-junos
Ansible with-junosAnsible with-junos
Ansible with-junos
 
Containers: What are they, Really?
Containers: What are they, Really?Containers: What are they, Really?
Containers: What are they, Really?
 
Configuration Management in Ansible
Configuration Management in Ansible Configuration Management in Ansible
Configuration Management in Ansible
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
 
An example Hadoop Install
An example Hadoop InstallAn example Hadoop Install
An example Hadoop Install
 
Docker e postgresql
Docker e postgresqlDocker e postgresql
Docker e postgresql
 
A journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service managementA journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service management
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
 
Running hadoop on ubuntu linux
Running hadoop on ubuntu linuxRunning hadoop on ubuntu linux
Running hadoop on ubuntu linux
 
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونیاسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
اسلاید سوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
 
Clase4 (consola linux)
Clase4 (consola linux)Clase4 (consola linux)
Clase4 (consola linux)
 
Steam Learn: Composer
Steam Learn: ComposerSteam Learn: Composer
Steam Learn: Composer
 
Clojure + MongoDB on Heroku
Clojure + MongoDB on HerokuClojure + MongoDB on Heroku
Clojure + MongoDB on Heroku
 
Bash Scripting Workshop
Bash Scripting WorkshopBash Scripting Workshop
Bash Scripting Workshop
 
37562259 top-consuming-process
37562259 top-consuming-process37562259 top-consuming-process
37562259 top-consuming-process
 
Summit demystifying systemd1
Summit demystifying systemd1Summit demystifying systemd1
Summit demystifying systemd1
 
Mac OS X Lion で作る WordPress local 環境
Mac OS X Lion で作る WordPress local 環境Mac OS X Lion で作る WordPress local 環境
Mac OS X Lion で作る WordPress local 環境
 
100+ run commands for windows
100+ run commands for windows 100+ run commands for windows
100+ run commands for windows
 

Viewers also liked

Interim review
Interim reviewInterim review
Interim review
Sinuo Guo
 
2 12-2015 - Cassandra Day LA - Using DataStax Enterprise and Actor Systems fo...
2 12-2015 - Cassandra Day LA - Using DataStax Enterprise and Actor Systems fo...2 12-2015 - Cassandra Day LA - Using DataStax Enterprise and Actor Systems fo...
2 12-2015 - Cassandra Day LA - Using DataStax Enterprise and Actor Systems fo...
petabridge
 
Fotos graciosas 33657
Fotos graciosas 33657Fotos graciosas 33657
Fotos graciosas 33657
hikurigio
 
Production Readiness Strategies in an Automated World
Production Readiness Strategies in an Automated WorldProduction Readiness Strategies in an Automated World
Production Readiness Strategies in an Automated World
Sean Chittenden
 
Portfel.in.ua 32 bio_8_serebryakov
Portfel.in.ua 32 bio_8_serebryakovPortfel.in.ua 32 bio_8_serebryakov
Portfel.in.ua 32 bio_8_serebryakov
portfel
 
PostgreSQL on ZFS Lightning Talk
PostgreSQL on ZFS Lightning TalkPostgreSQL on ZFS Lightning Talk
PostgreSQL on ZFS Lightning Talk
Sean Chittenden
 
Modern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSDModern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSD
Sean Chittenden
 
Hashicorp @ JUST EAT - Part 2
Hashicorp @ JUST EAT - Part 2Hashicorp @ JUST EAT - Part 2
Hashicorp @ JUST EAT - Part 2
Andrew Brown
 
new ifnet(9) KPI for FreeBSD network stack
new ifnet(9) KPI for FreeBSD network stacknew ifnet(9) KPI for FreeBSD network stack
new ifnet(9) KPI for FreeBSD network stack
Gleb Smirnoff
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleCreating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at Scale
Sean Chittenden
 
SysAdm: Simplifying FreeBSD Administration
SysAdm: Simplifying FreeBSD AdministrationSysAdm: Simplifying FreeBSD Administration
SysAdm: Simplifying FreeBSD Administration
Ken Moore
 
ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...
ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...
ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...
DynamicInfraDays
 
Splunk for Online Services Event featuring Groupon
Splunk for Online Services Event featuring GrouponSplunk for Online Services Event featuring Groupon
Splunk for Online Services Event featuring Groupon
Splunk
 
Periodo de entreguerras
Periodo de entreguerrasPeriodo de entreguerras
Periodo de entreguerras
Maria Portarrieu
 
PostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulPostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consul
Sean Chittenden
 
Vault - Secret and Key Management
Vault - Secret and Key ManagementVault - Secret and Key Management
Vault - Secret and Key Management
Anthony Ikeda
 
Denial of Service Mitigation Tactics in FreeBSD
Denial of Service Mitigation Tactics in FreeBSDDenial of Service Mitigation Tactics in FreeBSD
Denial of Service Mitigation Tactics in FreeBSD
Steven Kreuzer
 
etcd based PostgreSQL HA Cluster
etcd based PostgreSQL HA Clusteretcd based PostgreSQL HA Cluster
etcd based PostgreSQL HA Cluster
winsletts
 
Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL Secrets
Derek Downey
 
FreeBSD: Dev to Prod
FreeBSD: Dev to ProdFreeBSD: Dev to Prod
FreeBSD: Dev to Prod
Sean Chittenden
 

Viewers also liked (20)

Interim review
Interim reviewInterim review
Interim review
 
2 12-2015 - Cassandra Day LA - Using DataStax Enterprise and Actor Systems fo...
2 12-2015 - Cassandra Day LA - Using DataStax Enterprise and Actor Systems fo...2 12-2015 - Cassandra Day LA - Using DataStax Enterprise and Actor Systems fo...
2 12-2015 - Cassandra Day LA - Using DataStax Enterprise and Actor Systems fo...
 
Fotos graciosas 33657
Fotos graciosas 33657Fotos graciosas 33657
Fotos graciosas 33657
 
Production Readiness Strategies in an Automated World
Production Readiness Strategies in an Automated WorldProduction Readiness Strategies in an Automated World
Production Readiness Strategies in an Automated World
 
Portfel.in.ua 32 bio_8_serebryakov
Portfel.in.ua 32 bio_8_serebryakovPortfel.in.ua 32 bio_8_serebryakov
Portfel.in.ua 32 bio_8_serebryakov
 
PostgreSQL on ZFS Lightning Talk
PostgreSQL on ZFS Lightning TalkPostgreSQL on ZFS Lightning Talk
PostgreSQL on ZFS Lightning Talk
 
Modern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSDModern tooling to assist with developing applications on FreeBSD
Modern tooling to assist with developing applications on FreeBSD
 
Hashicorp @ JUST EAT - Part 2
Hashicorp @ JUST EAT - Part 2Hashicorp @ JUST EAT - Part 2
Hashicorp @ JUST EAT - Part 2
 
new ifnet(9) KPI for FreeBSD network stack
new ifnet(9) KPI for FreeBSD network stacknew ifnet(9) KPI for FreeBSD network stack
new ifnet(9) KPI for FreeBSD network stack
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleCreating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at Scale
 
SysAdm: Simplifying FreeBSD Administration
SysAdm: Simplifying FreeBSD AdministrationSysAdm: Simplifying FreeBSD Administration
SysAdm: Simplifying FreeBSD Administration
 
ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...
ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...
ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...
 
Splunk for Online Services Event featuring Groupon
Splunk for Online Services Event featuring GrouponSplunk for Online Services Event featuring Groupon
Splunk for Online Services Event featuring Groupon
 
Periodo de entreguerras
Periodo de entreguerrasPeriodo de entreguerras
Periodo de entreguerras
 
PostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulPostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consul
 
Vault - Secret and Key Management
Vault - Secret and Key ManagementVault - Secret and Key Management
Vault - Secret and Key Management
 
Denial of Service Mitigation Tactics in FreeBSD
Denial of Service Mitigation Tactics in FreeBSDDenial of Service Mitigation Tactics in FreeBSD
Denial of Service Mitigation Tactics in FreeBSD
 
etcd based PostgreSQL HA Cluster
etcd based PostgreSQL HA Clusteretcd based PostgreSQL HA Cluster
etcd based PostgreSQL HA Cluster
 
Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL Secrets
 
FreeBSD: Dev to Prod
FreeBSD: Dev to ProdFreeBSD: Dev to Prod
FreeBSD: Dev to Prod
 

Similar to Configuration Management with Cfengine

Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
Dr. C.V. Suresh Babu
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
Ata Rehman
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
Alessandro Franceschi
 
One click deployment
One click deploymentOne click deployment
One click deployment
Alex Su
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
Ian Barber
 
Cfengine 2 Overview
Cfengine 2 OverviewCfengine 2 Overview
Cfengine 2 Overview
Scott Lackey
 
Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...
Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...
Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...
Michael Lee
 
Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...
Henning Sprang
 
Ch23 system administration
Ch23 system administration Ch23 system administration
Ch23 system administration
Raja Waseem Akhtar
 
Dev ops
Dev opsDev ops
Dev ops
Tom Hall
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
Muhammad Qazi
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
Ankit Desai
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and How
Sneha Inguva
 
Belvedere
BelvedereBelvedere
Belvedere
Colin Panisset
 
Introduction to JumpStart
Introduction to JumpStartIntroduction to JumpStart
Introduction to JumpStart
Scott McDermott
 
Security Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsSecurity Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and Results
Igor Beliaiev
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
garrett honeycutt
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
mukul bhardwaj
 
Linux basic for CADD biologist
Linux basic for CADD biologistLinux basic for CADD biologist
Linux basic for CADD biologist
Ajay Murali
 

Similar to Configuration Management with Cfengine (20)

Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
 
One click deployment
One click deploymentOne click deployment
One click deployment
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
Cfengine 2 Overview
Cfengine 2 OverviewCfengine 2 Overview
Cfengine 2 Overview
 
Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...
Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...
Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...
 
Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...
 
Ch23 system administration
Ch23 system administration Ch23 system administration
Ch23 system administration
 
Dev ops
Dev opsDev ops
Dev ops
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and How
 
Belvedere
BelvedereBelvedere
Belvedere
 
Introduction to JumpStart
Introduction to JumpStartIntroduction to JumpStart
Introduction to JumpStart
 
Security Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsSecurity Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and Results
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux basic for CADD biologist
Linux basic for CADD biologistLinux basic for CADD biologist
Linux basic for CADD biologist
 

Recently uploaded

PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
Sease
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
christinelarrosa
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
Vadym Kazulkin
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
DianaGray10
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
UiPathCommunity
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
zjhamm304
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
Fwdays
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 

Recently uploaded (20)

PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 

Configuration Management with Cfengine

  • 2. Configuration Management  Configuration management facilities provide efficient solutions to complex problems. For example: How do I manage configuration files? How do I know maintenance tasks, such as, backups are completed at the right times in the right places? How do I ensure that important system files are properly protected against unauthorized access and modification?
  • 4. What is Cfengine? “Cfengine … is an autonomous agent and a middle to high level policy language and agent for building expert systems to administrate and configure large computer networks.” http://www.cfengine.org/
  • 5. What to do with a tool like this…  Ensure that files altered by package managers are correctly tailored and adjusted to perform in your environment.  Verify that processes are (or aren’t) running.  Monitor disk usage and provide warning when file-systems are full  Search and identify file changes to maintain system security or for locating human error.
  • 6. Components  cfagent - interprets policy and implements in a convergent manner  cfexecd – is a scheduler and wrapper, sends you email.  cfservd - server daemon for remote copy and execution  cfrun - trivial helper app that polls hosts and tells them to run cfagent
  • 7. Additional components  cfenvd - state monitor, collects statistics for anomaly detection  cfkey - generates public-private key pairs (once) on a host
  • 8. Commonly Used Terms…  Host – Server of any kind  Classes – Group of hosts sharing a common policy (www_servers, db_servers, freebsd7_servers, openbsd41_servers)  Policy – The description of a configuration  Configuration – The state of files, processes, system resources on a host
  • 9. Getting started  Installing On FreeBSD (and possibly OpenBSD)  pkg_add –r cfengine  cd /usr/ports/sysutils/cfengine && make install From Source  tar zxf cfegnine-${VERSION}.tar.gz  cd cfengine-${VERSION}  ./configure  make install
  • 10. Getting it running on one host  Things to think about Writing a policy / configuration Getting trusted communication working  Autonomy: Always have a local copy of policy to minimize dependencies Each host has /var/cfegine bin, inputs, outputs, state  Ultimately let Cfengine configure itself
  • 11. Testing on a single host $ vi /var/cfengine/inputs/cfagent.conf control: actionsequence = ( shellcommands ) shellcommands: “/bin/echo Hello, World!” $ /usr/local/sbin/cfagent –f ./cfagent.conf cfengine:erdinger:/bin/echo Hello: Hello, World!
  • 12. Quick setup for multiple hosts  Decide policy: cfagent.conf  Distribute policy: cfservd.conf  Setup clients to install themselves: update.conf  Suppose 192.168.1.0/24 network
  • 13. cfservd.conf control: domain = ( lab.exit2shell.com ) MaxConnections = ( 50 ) AllowConnectionsFrom = ( 192.168.1.0/24 ) TrustKeysFrom = ( 192.168.1.0/24 ) admit: /var/cfengine/inputs 192.168.* /var/cfengine/ppkeys/localhost.pub 192.168.*
  • 14. cfagent.conf control: domain = ( lab.exit2shell.com ) schedule = ( Min10_15 Min30_35 Min50_55 ) ChecksumUpdates = ( on ) import: any:: cf.groups cf.site freebsd:: cf.freebsd
  • 15. update.conf control: actionsequence = ( copy tidy ) domain = ( lab.exit2shell.com ) policyhost = ( erdinger ) master_cfinput = ( /var/cfengine/inputs ) workdir = ( /var/cfengine ) SplayTime = ( 10 ) # minutes copy: $(master_cfinput) dest=$(workdir)/inputs r=inf mode=700 type=checksum include=cf.* include=*.conf exclude=*.lst exclude=*.bak exclude=.* exclude=*~ exclude=#* server=$(policyhost) trustkey=true tidy: $(workdir)/outputs pattern=* age=7
  • 16. cf.groups groups: web_servers = ( www0 www1 www2) db_servers = ( db0 db1 db2 )
  • 17. cf.site (part 1) control: actionsequence = ( files tidy editfiles ) editfilesize = ( 0 ) any:: tmpdir = ( /tmp ) freebsd|openbsd:: shadowfile = ( /etc/master.passwd ) shadowpermissions = ( 600 ) filegroup = ( wheel ) crondir = ( /var/cron/tabs ) linux:: shadowfile = ( /etc/shadow ) shadowpermissions = ( 400 ) filegroup = ( root ) crondir = ( /var/spool/cron )
  • 18. cf.site (part 2) files: any:: ${shadowfile} mode=$(shadowpermissions) owner=root group=$(filegroup) action=fixall /etc/passwd mode=644 owner=root group=$(filegroup) action=fixall
  • 19. cf.site (part 3) tidy: any:: $(tmpdir) pattern=* age=7 recurse=inf rmdirs=sub /var/tmp pattern=* age=7 recurse=inf rmdirs=sub editfiles: any:: { /etc/services AppendIfNoSuchLine "cfengine 5308/tcp“ AppendIfNoSuchLine "cfengine 5308/udp“ }
  • 20. cf.freebsd (part 1) control: ActionSequence = ( packages editfiles) DefaultPkgMgr = ( freebsd) FreeBSDInstallCommand = ( "/usr/sbin/pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/ packages-7-stable/All/%s" ) FreeBSDRemoveCommand = ("/usr/sbin/pkg_delete %s" )
  • 21. cf.freebsd (part 2) packages: freebsd.any:: pdksh-5.2.14p2_2.tbz action=install sudo-1.6.9.15_1.tbz action=install vim-lite-7.1.293_1.tbz action=install freebsd.web_servers:: apache-2.0.63.tbz action=install memcached-1.2.5.tbz action=install p5-DBD-Pg-2.6.4.tbz action=install mod_perl2-2.0.3_3,3.tbz action=install varnish-1.1.2.tbz action=install freebsd.db_servers:: postgresql-client-8.3.1.tbz action=install postgresql-server-8.3.1.tbz action=install
  • 22. cf.freebsd (part 3) editfiles: freebsd.any:: { /etc/rc.conf Backup "false" AppendIfNoSuchLine "sshd_enable="YES"“ } freebsd.web_servers:: { /etc/rc.conf Backup "false“ AppendIfNoSuchLine "apache2_enable="YES“” }
  • 23. Special Thanks  Mark Burgess  Wrote Cfengine  Borrowed heavily from his talks  http://www.cs.virginia.edu/sigbed/archives/2006-04/Marc.pdf  http://www.cfengine.org/AutonomicCfengine.pdf  Jeremy Mates  Borrowed some slides from his talk  http://sial.org/talks/kickstart-cfengine/