Allow more permissive ptrace.

This is a temporary measure, and should be reverted when no
longer needed.  Currently needed for:
  https://lists.launchpad.net/openstack/msg13381.html

Change-Id: Ic7d01f939532bb69ea6d647688d4e9fcb8bbdfde
This commit is contained in:
James E. Blair 2012-06-20 09:28:53 -07:00
parent c94321355a
commit ca7638301a
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# This file is managed by puppet.
#
# The PTRACE system is used for debugging. With it, a single user process
# can attach to any other dumpable process owned by the same user. In the
# case of malicious software, it is possible to use PTRACE to access
# credentials that exist in memory (re-using existing SSH connections,
# extracting GPG agent information, etc).
#
# A PTRACE scope of "0" is the more permissive mode. A scope of "1" limits
# PTRACE only to direct child processes (e.g. "gdb name-of-program" and
# "strace -f name-of-program" work, but gdb's "attach" and "strace -fp $PID"
# do not). The PTRACE scope is ignored when a user has CAP_SYS_PTRACE, so
# "sudo strace -fp $PID" will work as before. For more details see:
# https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace
#
# For applications launching crash handlers that need PTRACE, exceptions can
# be registered by the debugee by declaring in the segfault handler
# specifically which process will be using PTRACE on the debugee:
# prctl(PR_SET_PTRACER, debugger_pid, 0, 0, 0);
#
# In general, PTRACE is not needed for the average running Ubuntu system.
# To that end, the default is to set the PTRACE scope to "1". This value
# may not be appropriate for developers or servers with only admin accounts.
kernel.yama.ptrace_scope = 0

View File

@ -178,4 +178,20 @@ class jenkins_slave($ssh_key, $sudo = false, $bare = false, $user = true) {
"puppet:///modules/jenkins_slave/slave_scripts",
],
}
# Temporary for debugging glance launch problem
# https://lists.launchpad.net/openstack/msg13381.html
file { '/etc/sysctl.d/10-ptrace.conf':
ensure => present,
source => "puppet:///modules/jenkins_slave/10-ptrace.conf",
owner => 'root',
group => 'root',
mode => 444,
}
exec { "ptrace sysctl":
subscribe => File['/etc/sysctl.d/10-ptrace.conf'],
refreshonly => true,
command => "/sbin/sysctl -p /etc/sysctl.d/10-ptrace.conf",
}
}