awe@columba $ apt install apache2 awe@columba $ apt install apache2 - - PowerPoint PPT Presentation

awe columba apt install apache2 awe columba apt install
SMART_READER_LITE
LIVE PREVIEW

awe@columba $ apt install apache2 awe@columba $ apt install apache2 - - PowerPoint PPT Presentation

TORTOISE : IMPERATIVE SYSTEM CONFIGURATION REPAIR Aaron Weiss, Arjun Guha, Yuriy Brun Northeastern University and University of Massachusetts awe@columba $ apt install apache2 awe@columba $ apt install apache2 awe@columba $ vim


slide-1
SLIDE 1

TORTOISE: IMPERATIVE SYSTEM

CONFIGURATION REPAIR

Aaron Weiss, Arjun Guha, Yuriy Brun

Northeastern University and University of Massachusetts

slide-2
SLIDE 2
slide-3
SLIDE 3

awe@columba $ apt install apache2

slide-4
SLIDE 4

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default

slide-5
SLIDE 5

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2

slide-6
SLIDE 6

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2

slide-7
SLIDE 7

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ iptables -dport ssh -j DROP awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2

slide-8
SLIDE 8

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2

slide-9
SLIDE 9

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e awe@columba $ apt-get install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2

slide-10
SLIDE 10 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e awe@columba $ apt-get install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2
slide-11
SLIDE 11 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e awe@columba $ apt-get install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2 awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ sudo systemctl restart apache2
slide-12
SLIDE 12
slide-13
SLIDE 13

CONFIGURATION MANAGEMENT TOOLS

slide-14
SLIDE 14

package {"apache2": ensure => present } service {"apache2": ensure => running } define website($title, $root) { file {"/etc/apache2/sites-enabled/$title.conf": content => "<VirtualHost $title:80> DocumentRoot /var/sites/$root </VirtualHost>" } file {"/var/sites/$root": ensure => directory, source => "puppet://sites/$root",

  • wner => "root",

mode => 0700, recurse => "remote"} } website {"aaronweiss.us": root => "aaronweiss" } website {"pdgn.co": root => "pdgn" }

slide-15
SLIDE 15

package {"apache2": ensure => present } service {"apache2": ensure => running } define website($title, $root) { file {"/etc/apache2/sites-enabled/$title.conf": content => "<VirtualHost $title:80> DocumentRoot /var/sites/$root </VirtualHost>" } file {"/var/sites/$root": ensure => directory, source => "puppet://sites/$root",

  • wner => "root",

mode => 0700, recurse => "remote"} } website {"aaronweiss.us": root => "aaronweiss" } website {"pdgn.co": root => "pdgn" } define website($title, $root) {

slide-16
SLIDE 16

CONFIGURATION MANAGEMENT ISN’T PERFECT

slide-17
SLIDE 17

package {"apache2": ensure => present } service {"apache2": ensure => running } define website($title, $root) { file {"/etc/apache2/sites-enabled/$title.conf": content => "<VirtualHost $title:80> DocumentRoot /var/sites/$root </VirtualHost>" } file {"/var/sites/$root": ensure => directory, source => "puppet://sites/$root",

  • wner => "root",

mode => 0700, recurse => "remote" } } website {"aaronweiss.us": root => "aaronweiss" } website {"pdgn.co": root => "pdgn" }

slide-18
SLIDE 18

package {"apache2": ensure => present } service {"apache2": ensure => running } define website($title, $root) { file {"/etc/apache2/sites-enabled/$title.conf": content => "<VirtualHost $title:80> DocumentRoot /var/sites/$root </VirtualHost>" } file {"/var/sites/$root": ensure => directory, source => "puppet://sites/$root",

  • wner => "root",

mode => 0700, recurse => "remote" } } website {"aaronweiss.us": root => "aaronweiss" } website {"pdgn.co": root => "pdgn" }

slide-19
SLIDE 19

package {"apache2": ensure => present } service {"apache2": ensure => running } define website($title, $root) { file {"/etc/apache2/sites-enabled/$title.conf": content => "<VirtualHost $title:80> DocumentRoot /var/sites/$root </VirtualHost>" } file {"/var/sites/$root": ensure => directory, source => "puppet://sites/$root",

  • wner => "root",

mode => 0700, recurse => "remote" } } website {"aaronweiss.us": root => "aaronweiss" } website {"pdgn.co": root => "pdgn" }

slide-20
SLIDE 20

package {"apache2": ensure => present } service {"apache2": ensure => running } define website($title, $root) { file {"/etc/apache2/sites-enabled/$title.conf": content => "<VirtualHost $title:80> DocumentRoot /var/sites/$root </VirtualHost>" } file {"/var/sites/$root": ensure => directory, source => "puppet://sites/$root",

  • wner => "root",

mode => 0700, recurse => "remote" } } website {"aaronweiss.us": root => "aaronweiss" } website {"pdgn.co": root => "pdgn" }

awe@columba $ tail /var/log/apache2/error.log … (13) permission denied …

slide-21
SLIDE 21

package {"apache2": ensure => present } service {"apache2": ensure => running } define website($title, $root) { file {"/etc/apache2/sites-enabled/$title.conf": content => "<VirtualHost $title:80> DocumentRoot /var/sites/$root </VirtualHost>" } file {"/var/sites/$root": ensure => directory, source => "puppet://sites/$root",

  • wner => "root",

mode => 0700, recurse => "remote" } } website {"aaronweiss.us": root => "aaronweiss" } website {"pdgn.co": root => "pdgn" }

awe@columba $ tail /var/log/apache2/error.log … (13) permission denied … awe@columba $ stat /var/sites/columba 16777220 89178209 -rwx------ 1 root staff 0 0 … 4096 0 0 index.html

slide-22
SLIDE 22

package {"apache2": ensure => present } service {"apache2": ensure => running } define website($title, $root) { file {"/etc/apache2/sites-enabled/$title.conf": content => "<VirtualHost $title:80> DocumentRoot /var/sites/$root </VirtualHost>" } file {"/var/sites/$root": ensure => directory, source => "puppet://sites/$root",

  • wner => "root",

mode => 0700, recurse => "remote" } } website {"aaronweiss.us": root => "aaronweiss" } website {"pdgn.co": root => "pdgn" }

awe@columba $ tail /var/log/apache2/error.log … (13) permission denied … awe@columba $ stat /var/sites/columba 16777220 89178209 -rwx------ 1 root staff 0 0 … 4096 0 0 index.html awe@columba $ chmod 755 /var/sites/columba

slide-23
SLIDE 23

New York Stock Exchange: "a software update went out [...] it returned an error. [...] There was clearly a difference in the configuration going into production [from the test environment]"

slide-24
SLIDE 24

GitLab backup failure: “When we went to look for […] backups we found out they were not

  • there. […] The backup procedure was using

pg_dump 9.2, while our database is running PostgreSQL 9.6. […] The difference is the result

  • f how our Omnibus package works.”

New York Stock Exchange: "a software update went out [...] it returned an error. [...] There was clearly a difference in the configuration going into production [from the test environment]"

slide-25
SLIDE 25

GitLab backup failure: “When we went to look for […] backups we found out they were not

  • there. […] The backup procedure was using

pg_dump 9.2, while our database is running PostgreSQL 9.6. […] The difference is the result

  • f how our Omnibus package works.”

New York Stock Exchange: "a software update went out [...] it returned an error. [...] There was clearly a difference in the configuration going into production [from the test environment]" Facebook: "Facebook was down or unreachable for many of you for approximately 2.5 hours. [...] An automated system for verifying configuration values ended up causing much more damage than it fixed."

slide-26
SLIDE 26

GitLab backup failure: “When we went to look for […] backups we found out they were not

  • there. […] The backup procedure was using

pg_dump 9.2, while our database is running PostgreSQL 9.6. […] The difference is the result

  • f how our Omnibus package works.”

New York Stock Exchange: "a software update went out [...] it returned an error. [...] There was clearly a difference in the configuration going into production [from the test environment]" Facebook: "Facebook was down or unreachable for many of you for approximately 2.5 hours. [...] An automated system for verifying configuration values ended up causing much more damage than it fixed."

slide-27
SLIDE 27

WHY DO CONFIGURATION ERRORS HAPPEN?

slide-28
SLIDE 28

CONFIGURATION TOOLS ARE STILL NEW

slide-29
SLIDE 29

UNLIKE THE SHELL…

slide-30
SLIDE 30

CONFIGURATION AND TESTING ARE TOO SEPARATED

slide-31
SLIDE 31

Configuration

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart

Testing

slide-32
SLIDE 32

CONVENTIONAL PROGRAM REPAIR?

slide-33
SLIDE 33

CONVENTIONAL PROGRAM REPAIR?

➤ Test-based repair ➤ GenProg (Le Goues et al. TSE 2012) ➤ SemFix (Nguyen et al. ICSE 2013) ➤ Angelix (Mechtaev et al. ICSE 2016) ➤ Staged Program Repair (Long and Rinard. FSE 2015)

slide-34
SLIDE 34

CONVENTIONAL PROGRAM REPAIR?

➤ Test-based repair ➤ GenProg (Le Goues et al. TSE 2012) ➤ SemFix (Nguyen et al. ICSE 2013) ➤ Angelix (Mechtaev et al. ICSE 2016) ➤ Staged Program Repair (Long and Rinard. FSE 2015) ➤ Specification-based repair ➤ EML and MPy (Singh et al. PLDI 2013) ➤ Specification Repair with Alloy (Gopinath et al. TACAS

2011)

slide-35
SLIDE 35

WHY NOT USE THE SHELL DIRECTLY?

slide-36
SLIDE 36

WHY NOT USE THE SHELL DIRECTLY?

Configuration drift!

slide-37
SLIDE 37

SHELL-BASED CONFIGURATION REPAIR?

slide-38
SLIDE 38

IMPERATIVE CONFIGURATION REPAIR

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart

Live Programming for Configuration Management

slide-39
SLIDE 39

IMPERATIVE CONFIGURATION REPAIR

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-40
SLIDE 40

IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest!

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-41
SLIDE 41

IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest!

➤ Consistent: All changes made via the shell are preserved

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-42
SLIDE 42

IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest!

➤ Consistent: All changes made via the shell are preserved ➤ Maintainable: Structure and abstraction is preserved

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-43
SLIDE 43

IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest!

➤ Consistent: All changes made via the shell are preserved ➤ Maintainable: Structure and abstraction is preserved ➤ Ranked: Multiple possible repairs are ranked

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-44
SLIDE 44

IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest!

➤ Consistent: All changes made via the shell are preserved ➤ Maintainable: Structure and abstraction is preserved ➤ Ranked: Multiple possible repairs are ranked ➤ Unrestricted: Works with all existing shells

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-45
SLIDE 45

TORTOISE: AN ICR PROTOTYPE

slide-46
SLIDE 46

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-47
SLIDE 47

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-48
SLIDE 48

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart

synth

slide-49
SLIDE 49

FILE SYSTEMS, NOT COMMANDS

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-50
SLIDE 50

FILE SYSTEMS, NOT COMMANDS

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart

awe@columba $ pat install nvim zsh: command not found: pat

slide-51
SLIDE 51

BEHIND THE SCENES

∆P Puppet z3

slide-52
SLIDE 52

BEHIND THE SCENES

∆P Puppet z3

➤ Compile manifest into ∆P specification ➤ Imperative language + filesystem ops ➤ Let bindings with z3-updatable values


slide-53
SLIDE 53

BEHIND THE SCENES

∆P Puppet

Shell Commands

z3

➤ Compile manifest into ∆P specification ➤ Imperative language + filesystem ops ➤ Let bindings with z3-updatable values
 ➤ Convert shell commands into ∆P assertions ➤ Use ptrace to collect affected paths, and

check their final state at synthesis time

➤ Changes via the shell mean these

assertions are false

➤ z3 will repair the manifest to make them

true

slide-54
SLIDE 54

MODELING PUPPET

slide-55
SLIDE 55

MODELING PUPPET

slide-56
SLIDE 56

∆P: A MODEL OF FILE SYSTEM EFFECTS

slide-57
SLIDE 57

COMPILING A SIMPLE EXAMPLE TO ∆P define rootdir($name) { file {"/$name": ensure => directory } } rootdir { name => “foo” }

slide-58
SLIDE 58

COMPILING A SIMPLE EXAMPLE TO ∆P define rootdir($name) { file {"/$name": ensure => directory } } rootdir { name => “foo” }

rlet name = "foo" from str; rlet ensure = "directory" from str; if (ensure == "directory") { mkdir("/" + name) } else if ... { ... } ...

slide-59
SLIDE 59

COMPILING A SIMPLE EXAMPLE TO ∆P define rootdir($name) { file {"/$name": ensure => directory } } rootdir { name => “foo” }

rlet name = "foo" from str; rlet ensure = "directory" from str; if (ensure == "directory") { mkdir("/" + name) } else if ... { ... } ...

l1 l2

slide-60
SLIDE 60

∆P

Resource

∆P ∆P ∆P ∆P

RESOURCE GRAPHS AND ∆P

Resource Resource Resource Resource

slide-61
SLIDE 61

∆P

Resource

∆P ∆P ∆P ∆P

RESOURCE GRAPHS AND ∆P

Resource Resource Resource Resource

slide-62
SLIDE 62

∆P

Resource

∆P ∆P ∆P ∆P

RESOURCE GRAPHS AND ∆P

Resource Resource Resource Resource

slide-63
SLIDE 63

∆P

Resource

∆P ∆P ∆P ∆P

RESOURCE GRAPHS AND ∆P

Resource Resource Resource Resource

∆P

slide-64
SLIDE 64

FROM ∆P TO SMT

∆P

slide-65
SLIDE 65

FROM ∆P TO SMT

∆P

slide-66
SLIDE 66

FROM ∆P TO SMT

∆P Symbolic File System

slide-67
SLIDE 67

FROM ∆P TO SMT

∆P Symbolic File System

ɸ

slide-68
SLIDE 68

FROM ∆P TO SMT

∆P Symbolic File System

ɸ( )

slide-69
SLIDE 69

FROM ∆P TO SMT

∆P Symbolic File System

ɸ( )

fsin,

slide-70
SLIDE 70

FROM ∆P TO SMT

∆P Symbolic File System

ɸ( )

fsin, fsout,

slide-71
SLIDE 71

FROM ∆P TO SMT

∆P Symbolic File System

ɸ( )

fsin, fsout, x

slide-72
SLIDE 72

FORMULAE GET VERY LARGE

slide-73
SLIDE 73

MULTIPLE REPAIRS AND REPAIR RANKING define rootdir($name) { file {"/$name": ensure => directory } } rootdir { name => “foo” }

slide-74
SLIDE 74

MULTIPLE REPAIRS AND REPAIR RANKING define rootdir($name) { file {"/$name": ensure => directory } } rootdir { name => “foo” }

awe@columba $ mv /foo /bar

slide-75
SLIDE 75

MULTIPLE REPAIRS AND REPAIR RANKING define rootdir($name) { file {"/$name": ensure => directory } } rootdir { name => “foo” } rootdir { name => "bar" }

awe@columba $ mv /foo /bar

slide-76
SLIDE 76

MULTIPLE REPAIRS AND REPAIR RANKING define rootdir($name) { file {"/$name": ensure => directory } } rootdir { name => “foo” } file {"/bar":

awe@columba $ mv /foo /bar

slide-77
SLIDE 77

MULTIPLE REPAIRS AND REPAIR RANKING define rootdir($name) { file {"/$name": ensure => directory } } rootdir { name => “foo” } file {"/bar":

  • 1. rootdir { name => "foo" } BECOMES rootdir { name => "bar" }
  • 2. file {"/$name": BECOMES file {"/bar":

awe@columba $ mv /foo /bar

slide-78
SLIDE 78

THE REPAIR SCENARIO EXPERIMENT

slide-79
SLIDE 79

THE REPAIR SCENARIO EXPERIMENT

define amavis::config($spamchecker='true', ...) { amavis { spamassassin => $spamchecker } file {'/etc/amavis/conf.d/50-user': ensure => present, content => ... } file {'/etc/amavis/conf.d/15-content_filter_mode': ensure => present, content => ... } } define amavis($spamassassin='true') { package {'amavisd-new': ensure => present, alias => 'amavis' } if $spamassassin == 'true' { package {'spamassassin': ensure => present } } } amavis::config { spamchecker => 'false' }

slide-80
SLIDE 80

THE REPAIR SCENARIO EXPERIMENT

define amavis::config($spamchecker='true', ...) { amavis { spamassassin => $spamchecker } file {'/etc/amavis/conf.d/50-user': ensure => present, content => ... } file {'/etc/amavis/conf.d/15-content_filter_mode': ensure => present, content => ... } } define amavis($spamassassin='true') { package {'amavisd-new': ensure => present, alias => 'amavis' } if $spamassassin == 'true' { package {'spamassassin': ensure => present } } } amavis::config { spamchecker => 'false' }

awe@columba $ sudo apt install spamassassin

slide-81
SLIDE 81

THE REPAIR SCENARIO EXPERIMENT

define amavis::config($spamchecker='true', ...) { amavis { spamassassin => $spamchecker } file {'/etc/amavis/conf.d/50-user': ensure => present, content => ... } file {'/etc/amavis/conf.d/15-content_filter_mode': ensure => present, content => ... } } define amavis($spamassassin='true') { package {'amavisd-new': ensure => present, alias => 'amavis' } if $spamassassin == 'true' { package {'spamassassin': ensure => present } } } amavis::config { spamchecker => 'false' }

awe@columba $ sudo apt install spamassassin awe@columba $ synth

slide-82
SLIDE 82

THE REPAIR SCENARIO EXPERIMENT

define amavis::config($spamchecker='true', ...) { amavis { spamassassin => $spamchecker } file {'/etc/amavis/conf.d/50-user': ensure => present, content => ... } file {'/etc/amavis/conf.d/15-content_filter_mode': ensure => present, content => ... } } define amavis($spamassassin='true') { package {'amavisd-new': ensure => present, alias => 'amavis' } if $spamassassin == 'true' { package {'spamassassin': ensure => present } } } amavis::config { spamchecker => 'false' }

awe@columba $ sudo apt install spamassassin awe@columba $ synth

1. 2. 3. spamchecker => 'false' REMOVED spamchecker => 'false' BECOMES spamchecker => 'true' $spamassassin == 'true' BECOMES 'false' == 'true'

slide-83
SLIDE 83

THE REPAIR SCENARIO EXPERIMENT

define amavis::config($spamchecker='true', ...) { amavis { spamassassin => $spamchecker } file {'/etc/amavis/conf.d/50-user': ensure => present, content => ... } file {'/etc/amavis/conf.d/15-content_filter_mode': ensure => present, content => ... } } define amavis($spamassassin='true') { package {'amavisd-new': ensure => present, alias => 'amavis' } if $spamassassin == 'true' { package {'spamassassin': ensure => present } } } amavis::config { spamchecker => 'false' }

awe@columba $ sudo apt install spamassassin awe@columba $ synth

1. 2. 3. spamchecker => 'false' REMOVED spamchecker => 'false' BECOMES spamchecker => 'true' $spamassassin == 'true' BECOMES 'false' == 'true'

slide-84
SLIDE 84

THE REPAIR SCENARIO EXPERIMENT

define amavis::config($spamchecker='true', ...) { amavis { spamassassin => $spamchecker } file {'/etc/amavis/conf.d/50-user': ensure => present, content => ... } file {'/etc/amavis/conf.d/15-content_filter_mode': ensure => present, content => ... } } define amavis($spamassassin='true') { package {'amavisd-new': ensure => present, alias => 'amavis' } if $spamassassin == 'true' { package {'spamassassin': ensure => present } } } amavis::config { spamchecker => 'false' }

awe@columba $ sudo apt install spamassassin awe@columba $ synth

1. 2. 3. spamchecker => 'false' REMOVED spamchecker => 'false' BECOMES spamchecker => 'true' $spamassassin == 'true' BECOMES 'false' == 'true'

Pick best repair: 2

slide-85
SLIDE 85

EVALUATING TORTOISE

Benchmark # of resources # of repair scenarios Tortoise runtime (s) Average repair rank

amavis 6 1 0.025 1.00 bind 6 3 0.021 1.60 clamav 6 2 0.023 3.50 hosting 19 1 0.026 1.00 irc 18 1 0.292 1.00 jpa 10 1 0.021 1.00 logstash 14 6 0.048 1.00 monit 7 4 0.025 1.00 nginx 9 4 0.027 1.00 ntp 4 3 0.018 1.33 powerdns 5 7 0.039 1.43 rsyslog 7 4 0.129 1.25 xinetd 4 5 1.970 1.20

Total 115 42 Benchmarks from Shambaugh, Weiss, and Guha (PLDI 2016)

slide-86
SLIDE 86

EVALUATING TORTOISE

Benchmark # of resources # of repair scenarios Tortoise runtime (s) Average repair rank

amavis 6 1 0.025 1.00 bind 6 3 0.021 1.60 clamav 6 2 0.023 3.50 hosting 19 1 0.026 1.00 irc 18 1 0.292 1.00 jpa 10 1 0.021 1.00 logstash 14 6 0.048 1.00 monit 7 4 0.025 1.00 nginx 9 4 0.027 1.00 ntp 4 3 0.018 1.33 powerdns 5 7 0.039 1.43 rsyslog 7 4 0.129 1.25 xinetd 4 5 1.970 1.20

Total 115 42

Average Runtime: 0.2 seconds Average Rank: 1.31

Benchmarks from Shambaugh, Weiss, and Guha (PLDI 2016)

slide-87
SLIDE 87

TORTOISE SCALABILITY

500 1000 1500 5 10 15

Updates Time (ms)

100 200 50 100 150 200 250

Resources Time (ms)

Scaling Manifest Size Scaling Update Size

slide-88
SLIDE 88

SUMMARY: IMPERATIVE CONFIGURATION REPAIR

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-89
SLIDE 89

SUMMARY: IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest!

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-90
SLIDE 90

SUMMARY: IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest! ➤ Consistent: All changes made via the shell are preserved

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-91
SLIDE 91

SUMMARY: IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest! ➤ Consistent: All changes made via the shell are preserved ➤ Maintainable: Structure and abstraction is preserved

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-92
SLIDE 92

SUMMARY: IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest! ➤ Consistent: All changes made via the shell are preserved ➤ Maintainable: Structure and abstraction is preserved ➤ Ranked: Multiple possible repairs are ranked

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-93
SLIDE 93

SUMMARY: IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest! ➤ Consistent: All changes made via the shell are preserved ➤ Maintainable: Structure and abstraction is preserved ➤ Ranked: Multiple possible repairs are ranked ➤ Unrestricted: Works with all existing shells

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-94
SLIDE 94

SUMMARY: IMPERATIVE CONFIGURATION REPAIR

➤ Propagates changes made via the shell back to the original manifest! ➤ Consistent: All changes made via the shell are preserved ➤ Maintainable: Structure and abstraction is preserved ➤ Ranked: Multiple possible repairs are ranked ➤ Unrestricted: Works with all existing shells

Live Programming for Configuration Management

awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart awe@columba $ iptables -dport ssh -j DROP awe@columba $ mount backup.local:/backup /mnt/backup awe@columba $ crontab -e

awe@columba $ apt install apache2 awe@columba $ vim /etc/apache2/sites-enabled/default awe@columba $ service apache2 restart
slide-95
SLIDE 95

TESTING AND VERIFYING PROPERTIES OF SYSTEM CONFIGURATIONS

➤ Configuration Management Tools (Infrastructure as Code) ➤ Rehearsal (Shambaugh, Weiss, and Guha. PLDI 2016) ➤ Citac (Hanappi et al. OOPSLA 2016) ➤ Idempotency for Chef (Hummer et al. Middleware 2013) ➤ Application-Specific Configurations ➤ ConfValley (Huang et al. EuroSys 2015) ➤ PCheck (Xu et al. OSDI 2016) ➤ Specific Configurations via Analysis ➤ ConfSuggester (Zhang and Ernst. ICSE 2014) ➤ Autobash (Su et al. SOSP 2007)