How to permit ptrace (for strace, gdb, etc.) as root?

Hi.
This is due to the sudo seccomp filter. Remove/comment lines

Defaults log_subcmds
Defaults log_format=json

in /etc/sudoers using sudo visudo in Linux shell.

I plan to create a ticket in Jira to update /etc/sudo.conf because such log_subcmds usage is not recommended:

## Uncomment to disable intercept and log_subcmds for debuggers and
## tracers.  Otherwise, anything that uses ptrace(2) will be unable
## to run under sudo if intercept_type is set to "trace".
# Defaults!DEBUGGERS !intercept, !log_subcmds
##
## Uncomment to disable intercept and log_subcmds for package managers.
## Some package scripts run a huge number of commands, which is made
## slower by these options and also can clutter up the logs.
# Defaults!PKGMAN !intercept, !log_subcmds

#Otherwise, anything that uses ptrace(2) will be unable to run under sudo if intercept_type is set to "trace".
1 Like