Skip to content

Commit ce6c64e

Browse files
committed
Mitigate ssh-keysign-pwn exploits
See https://seclists.org/oss-sec/2026/q2/529 for details. Disabling PTRACE_ATTACH for non-admins by settings the tunable kernel.yama.ptrace_scope=2 blocks known exploits.
1 parent 90864ec commit ce6c64e

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

ansible/mitigations.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,32 @@
2323
ansible.builtin.command:
2424
cmd: echo 3 > /proc/sys/vm/drop_caches
2525
changed_when: true
26+
27+
- name: Apply ssh-keysign-pwn mitigation
28+
hosts: mitigate_ssh_keysign_pwn
29+
become: true
30+
gather_facts: false
31+
tasks:
32+
# See https://docs.kernel.org/admin-guide/LSM/Yama.html for explanation
33+
- name: Apply ssh-keysign-pwn mitigation to live system
34+
ansible.builtin.command: sysctl kernel.yama.ptrace_scope=2
35+
changed_when: true
36+
- name: Get current ptrace_scope value
37+
ansible.builtin.slurp:
38+
src: /proc/sys/kernel/yama/ptrace_scope
39+
check_mode: false
40+
changed_when: false
41+
register: ptrace_scope
42+
- name: Show ptrace_scope after fix
43+
ansible.builtin.debug:
44+
msg: "/proc/sys/kernel/yama/ptrace_scope={{ ptrace_scope.content|b64decode }}"
45+
- name: Prepare sysctl.d file to apply mitigation upon reboot
46+
ansible.builtin.copy:
47+
dest: /etc/sysctl.d/99-prevent-ptrace_scope.conf
48+
content: |
49+
# this is a mitigation for ssh-keysign-pwn
50+
# See https://seclists.org/oss-sec/2026/q2/529 for the announcement
51+
kernel.yama.ptrace_scope=2
52+
owner: root
53+
group: root
54+
mode: "0644"

environments/common/inventory/groups

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,4 @@ doca
247247

248248
## Vulnerability mitigation groups
249249
[mitigate_dirtyfrag]
250+
[mitigate_ssh_keysign_pwn]

environments/site/inventory/groups

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,5 @@ compute
220220
## Vulnerability mitigation groups
221221
[mitigate_dirtyfrag:children]
222222
builder
223+
[mitigate_ssh_keysign_pwn:children]
224+
builder

0 commit comments

Comments
 (0)