diff --git a/modules/vulnerabilities/unix/http/apache_couchdb/manifests/configure.pp b/modules/vulnerabilities/unix/http/apache_couchdb/manifests/configure.pp index 60d4d80ab..866e6fe4b 100644 --- a/modules/vulnerabilities/unix/http/apache_couchdb/manifests/configure.pp +++ b/modules/vulnerabilities/unix/http/apache_couchdb/manifests/configure.pp @@ -4,8 +4,8 @@ class apache_couchdb::configure { $user = $secgen_parameters['leaked_username'][0] $password = $secgen_parameters['leaked_password'][0] $jsondb = 'sampledata' ##TODO secgen - $strings_to_leak = $secgen_parameters['strings_to_leak'][0] - $leaked_filenames = $secgen_parameters['leaked_filenames'][0] + $strings_to_leak = $secgen_parameters['strings_to_leak'] + $leaked_filenames = $secgen_parameters['leaked_filenames'] $user_home = "/home/${user}" Exec { path => ['/bin', '/usr/bin', '/usr/local/bin', '/sbin', '/usr/sbin'] } diff --git a/modules/vulnerabilities/unix/http/apache_couchdb/manifests/couchdb.pp b/modules/vulnerabilities/unix/http/apache_couchdb/manifests/couchdb.pp index 9989b767d..5801cbd62 100644 --- a/modules/vulnerabilities/unix/http/apache_couchdb/manifests/couchdb.pp +++ b/modules/vulnerabilities/unix/http/apache_couchdb/manifests/couchdb.pp @@ -11,9 +11,10 @@ class apache_couchdb::couchdb { Exec { path => ['/bin', '/usr/bin', '/usr/local/bin', '/sbin', '/usr/sbin'] } #create user #create system user - user { $username : - ensure => present, - shell => '/bin/bash', + user { $username: + ensure => present, + shell => '/bin/bash', + password => pw_hash($password, 'SHA-512', 'mysalt'), } #set folder permissions -> exec { 'chown-couchdb': @@ -24,11 +25,10 @@ class apache_couchdb::couchdb { command => "chmod -R 770 ${docroot}", logoutput => true } - #configuration file -> file { "${docroot}/etc/local.ini" : - ensure => file, - content => template('apache_couchdb/local.ini.erb'), + ensure => file, + content => template('apache_couchdb/local.ini.erb'), } # add vm.args files -> file { "${docroot}/etc/vm.args": @@ -43,11 +43,13 @@ class apache_couchdb::couchdb { logoutput => true, notify => Exec['wait-apache-couchdb'], } + exec { 'wait-apache-couchdb': command => 'sleep 4', logoutput => true, notify => Exec['chown-uri-file'], } + exec { 'chown-uri-file': command => "chown -R ${username}:${username} /var/run/couchdb/", logoutput => true, @@ -57,3 +59,4 @@ class apache_couchdb::couchdb { logoutput => true, } } + diff --git a/modules/vulnerabilities/unix/http/apache_couchdb/manifests/install.pp b/modules/vulnerabilities/unix/http/apache_couchdb/manifests/install.pp index ea805a9c7..298088377 100644 --- a/modules/vulnerabilities/unix/http/apache_couchdb/manifests/install.pp +++ b/modules/vulnerabilities/unix/http/apache_couchdb/manifests/install.pp @@ -21,12 +21,12 @@ class apache_couchdb::install { source => "puppet:///modules/apache_couchdb/${packagename}.deb", } -> file { "/usr/bin/${responsefile}" : - ensure => file, - content => template("apache_couchdb/${responsefile}.erb"), + ensure => file, + content => template("apache_couchdb/${responsefile}.erb"), } -> file { "/usr/bin/${jsondb}.json" : - ensure => file, - content => template("apache_couchdb/${jsondb}.erb"), + ensure => file, + content => template("apache_couchdb/${jsondb}.erb"), } #install couch db from deb file -> package {'couchdb-install': diff --git a/scenarios/examples/vulnerability_examples/apache_couchdb.xml b/scenarios/examples/vulnerability_examples/apache_couchdb.xml new file mode 100644 index 000000000..16ba23b10 --- /dev/null +++ b/scenarios/examples/vulnerability_examples/apache_couchdb.xml @@ -0,0 +1,16 @@ + + + + + + couchdb + + + + + + + + \ No newline at end of file