Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplus/manifests/sudo.pp

Issue 29339079: Issue 3587 - Remove module users (Closed)
Patch Set: Created March 29, 2016, 8:58 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/adblockplus/files/sudoers/puppet ('k') | modules/adblockplus/manifests/user.pp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplus/manifests/sudo.pp
diff --git a/modules/adblockplus/manifests/sudo.pp b/modules/adblockplus/manifests/sudo.pp
new file mode 100644
index 0000000000000000000000000000000000000000..ca2a44573439d9febe24f5843c9fe4b28cdf9dd9
--- /dev/null
+++ b/modules/adblockplus/manifests/sudo.pp
@@ -0,0 +1,44 @@
+# == Class: adblockplus::sudo
+#
+# Mixin class to ensure super-user privileges can only be acquired through
+# the sudo(8) system daemon.
+#
+# === Parameters:
+#
+# [*ensure*]
+# Whether associated resources are meant to be 'present' or 'absent'.
+#
+# === Examples:
+#
+# class {'adblockplus::sudo':
+# ensure => 'present',
+# }
+#
+class adblockplus::sudo (
+ $ensure = 'present',
+) {
+
+ # https://forge.puppetlabs.com/puppetlabs/stdlib
+ include stdlib
+
+ # Obligatory despite the package being included with all environments
+ ensure_packages(['sudo'])
+
+ # User root must not be able to login via password
+ ensure_resource('user', 'root', {'password' => '*'})
+
+ # The root account must not be accessible directly via SSH
+ file {'/root/.ssh/authorized_keys':
+ ensure => 'absent',
+ }
+
+ # Prerequisite for the accompanying kick.py and run.py scripts
+ file {'/etc/sudoers.d/puppet':
+ ensure => $ensure,
+ group => 'root',
+ mode => 0440,
+ owner => 'root',
+ require => Package['sudo'],
+ source => 'puppet:///modules/adblockplus/sudoers/puppet'
+ }
+}
« no previous file with comments | « modules/adblockplus/files/sudoers/puppet ('k') | modules/adblockplus/manifests/user.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld