I am on ubuntu 20.04 focal, and I have discord installed. While discord is active, I get loads of messages in dmesg from it.
[ 1242.218055] audit: type=1400 audit(1626585289.753:15781): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.208904] kauditd_printk_skb: 109 callbacks suppressed
[ 1252.208907] audit: type=1400 audit(1626585299.754:15891): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.208928] audit: type=1400 audit(1626585299.754:15892): apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/1221/cmdline" pid=2211 comm="Discord" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 1252.208962] audit: type=1400 audit(1626585299.754:15893): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.209060] audit: type=1400 audit(1626585299.754:15894): apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/1241/cmdline" pid=2211 comm="Discord" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 1252.209067] audit: type=1400 audit(1626585299.754:15895): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.209084] audit: type=1400 audit(1626585299.754:15896): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.209193] audit: type=1400 audit(1626585299.754:15897): apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/1375/cmdline" pid=2211 comm="Discord" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 1252.209200] audit: type=1400 audit(1626585299.754:15898): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
[ 1252.209207] audit: type=1400 audit(1626585299.754:15899): apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/1451/cmdline" pid=2211 comm="Discord" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 1252.209212] audit: type=1400 audit(1626585299.754:15900): apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
basically it makes getting any other information out of dmesg difficult. Im pretty sure its logging elsewhere as well.
$journalctl -f
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
Jul 18 01:21:04 ab audit[2211]: AVC apparmor="DENIED" operation="ptrace" profile="snap.discord.discord" pid=2211 comm="Discord" requested_mask="read" denied_mask="read" peer="unconfined"
so then I looked at apparmor /var/lib/snapd/apparmor/profiles/snap.discord.discord
, figuring i could deny ptrace, but this is already set-up.
I'm not sure why discord is trying to access ptrace, but I'm happy to not grant it any additional permissions. I would like the excessive logging to stop though. when discord is active, I might get dozens of requests logged per second. That has to be making a huge log file somewhere.
How can I stop discord from flooding my logs?