Merged in oherrala/puppet/oherrala-sudo (pull request #51)
sudo: Add fake version. You know why. :)
This commit is contained in:
commit
2cb2a2e051
2 changed files with 38 additions and 0 deletions
24
sudo/files/fakesudo
Normal file
24
sudo/files/fakesudo
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
trap report SIGINT SIGTERM
|
||||||
|
|
||||||
|
function askpw {
|
||||||
|
read -s -p "Password:" password
|
||||||
|
password=""
|
||||||
|
echo ""
|
||||||
|
echo "Sorry, try again."
|
||||||
|
}
|
||||||
|
|
||||||
|
function report {
|
||||||
|
stty echo # Fix echo if ^C during password prompt
|
||||||
|
( whoami ; date ) | mailx -s "Someone sudo'ed (`id -un`, ${SSH_CONNECTION})" root
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function main {
|
||||||
|
for try in 1 2 3; do askpw; done
|
||||||
|
echo "sudo: 3 incorrect password attempts"
|
||||||
|
report
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
|
@ -37,6 +37,20 @@ class sudo {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Install fake sudo
|
||||||
|
#
|
||||||
|
class sudo::fake {
|
||||||
|
|
||||||
|
file { "/usr/bin/sudo":
|
||||||
|
ensure => present,
|
||||||
|
mode => 0555,
|
||||||
|
owner => "root",
|
||||||
|
group => "root",
|
||||||
|
source => "puppet:///modules/sudo/fakesudo",
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
# Add sudoer.
|
# Add sudoer.
|
||||||
#
|
#
|
||||||
# === Parameters
|
# === Parameters
|
||||||
|
|
Loading…
Add table
Reference in a new issue