News for hackers. Stuff that matters.
Re:Sudo: Remove “This incident will be reported.” from user ... by jamal-kumar on Saturday April 29, 2023 @12:45PM (#35754583)
For those wondering where the reports go, under systemd-based linux distributions ideally you can get them with this:

    sudo journalctl /bin/sudo
Historically speaking however the sysadmin with access to the 'mail' command would be able to run that and see mail delivered to root@localhost for these reports. I think at least OpenBSD still does things this way [1], but they moved away from sudo YEARS ago now [2]

[1] https://man.openbsd.org/security.8

[2] https://man.openbsd.org/doas

Re:Sudo: Remove “This incident will be reported.” from user ... by dingledork69 on Saturday April 29, 2023 @12:58PM (#35754706)
Or you set up your system so mail for root gets redirected to an smtp server with an actual inbox read by actual people
Re:Sudo: Remove “This incident will be reported.” from user ... by jamal-kumar on Saturday April 29, 2023 @01:07PM (#35754794)
Yeah, I kind of lament them removing this warning if I'm going to be honest. It feels like something such as that should be more common best practice.

Of course decent log collection/monitoring should also be able to catch authlog stuff and alert accordingly and I'm sure most organizations rely on solutions like that instead of letting things get lost in email

Re:Sudo: Remove “This incident will be reported.” from user ... by stefncb on Saturday April 29, 2023 @01:12PM (#35754856)
It's only removed if sudo doesn't send mail. It still warns if it's relevant.
Re:Sudo: Remove “This incident will be reported.” from user ... by electroly on Saturday April 29, 2023 @01:23PM (#35754975)
This is a pretty short diff and it clearly does NOT do that, unless you're saying they went back later in another commit to add this. They removed the message in all situations. The string "This incident will be reported" has been removed from the source code; it could not possibly print that message now.
Re:Sudo: Remove “This incident will be reported.” from user ... by simse on Saturday April 29, 2023 @01:34PM (#35755099)
Re:Sudo: Remove “This incident will be reported.” from user ... by bo0tzz on Saturday April 29, 2023 @01:35PM (#35755119)
This is correct, and was added back a few weeks later in https://github.com/sudo-project/sudo/commit/9757d29a24ac1872...
Re:Sudo: Remove “This incident will be reported.” from user ... by freedomben on Saturday April 29, 2023 @01:30PM (#35755040)
Is there more to the change than the linked commit? Because if not, looking at the code change I don't see how you could possibly be correct. There is no additional logic/branching that could be checking whether sudo sends mail or not, just a string change.
Re:Sudo: Remove “This incident will be reported.” from user ... by TaylorAlexander on Saturday April 29, 2023 @02:22PM (#35755615)
It was added back in a later commit but only prints if the mail is configured.
Re:Sudo: Remove “This incident will be reported.” from user ... by freedomben on Saturday April 29, 2023 @03:42PM (#35756390)
Nice, thanks that's very useful info
Re:Sudo: Remove “This incident will be reported.” from user ... by fafqg on Saturday April 29, 2023 @01:23PM (#35754980)
This doesn't seem to be correct.
Re:Sudo: Remove “This incident will be reported.” from user ... by can16358p on Saturday April 29, 2023 @03:35PM (#35756319)
Isn't it leaking detail about internal policy about whether incorrect sudoing is getting reported or not though?
Re:Sudo: Remove “This incident will be reported.” from user ... by asveikau on Saturday April 29, 2023 @01:23PM (#35754977)
I feel like that warning comes right out of the era of multi-user machines with unprivileged shell accounts. That era is largely gone. Today, someone, possibly a less knowledgeable user, runs sudo on their single user laptop that they completely own outright, and may get confused who they're being "reported" to.
Re:Sudo: Remove “This incident will be reported.” from user ... by jamal-kumar on Saturday April 29, 2023 @01:36PM (#35755127)
Funny if you live in a free country

Potentially terrifying if you don't

Re:Sudo: Remove “This incident will be reported.” from user ... by wkat4242 on Saturday April 29, 2023 @02:55PM (#35755901)
To themselves of course. That's pretty clear.

But there is a renewed focus on corporate laptops to remove admin rights on windows. I'm sure this will come to Linux too at some point

Re:Sudo: Remove “This incident will be reported.” from user ... by ctoth on Saturday April 29, 2023 @01:14PM (#35754882)
Completely this, I was so confused by OP because naturally this is how my playbooks configure my systems.
Re:Sudo: Remove “This incident will be reported.” from user ... by jamal-kumar on Saturday April 29, 2023 @01:40PM (#35755179)
I think this is mostly relevant to how confused and sometimes downright mortified it makes new users of sudo when they encounter it

In other words, don't think well-configured ansible playbooks are most people's first exposure to linux although it does sound like you're doing things right which is nice to hear

Re:Sudo: Remove “This incident will be reported.” from user ... by jimmaswell on Saturday April 29, 2023 @02:27PM (#35755657)
I was surprised to start getting emails about my cron tasks once I set up my mail server. It's neat.
Re:Sudo: Remove “This incident will be reported.” from user ... by prmoustache on Saturday April 29, 2023 @04:29PM (#35756849)
I've always felt it was a very bad practice not to do it.

In a lot of companies but one they avoided it for fear of receiving emails. On that only company that did it, we made sure that mailbox was clean by actually having a look when cron scripts were crapping out or when users failed sudo repeatedly and contacted the users. It was a much better housekeeping than log on a box and see there are hundreds of unread emails but dismissing it like most do.

Re:Sudo: Remove “This incident will be reported.” from user ... by evilspammer on Saturday April 29, 2023 @04:34PM (#35756887)
I think it's a fear of _sending_ emails. You could accidentally trigger a cronjob that sends a bunch of emails and gets you put on spam filters. Error reporting for cron is, of course, important; but the builtin email reporting is best used for the local machine/network. A more flexible and robust solution calls out to an API that handles transactional emails/push notifications with debouncing, escalation policies, etc.
Re:Sudo: Remove “This incident will be reported.” from user ... by hiepph on Sunday April 30, 2023 @04:20AM (#35760621)
Well, it depends! Because what you need to see more often is errors. You don't want successful notifications "spam" more often than error notifications.
Re:Sudo: Remove “This incident will be reported.” from user ... by evilspammer on Saturday April 29, 2023 @04:32PM (#35756867)
I haven't used journalctl in a while - do you mind explaining how it works with a binary path? Does it report all system logging that came from that executable, as if it were a service file?
Re:Sudo: Remove “This incident will be reported.” from user ... by teddyh on Saturday April 29, 2023 @06:00PM (#35757678)
The systemd journal logs not only raw strings and priorities (like legacy syslog), but a large number of metadata fields for each message. One of these fields is the name of the executable which generated the message. The command

  journalctl /bin/su
can, to avoid ambiguity, also be written as

  journalctl _EXE=/bin/su
See systemd.journal-fields(7) for more information: https://manpages.debian.org/stable/systemd/systemd.journal-f...
Re:Sudo: Remove “This incident will be reported.” from user ... by tryauuum on Saturday April 29, 2023 @07:00PM (#35758123)
wow! finally something neat from journald
Re:Sudo: Remove “This incident will be reported.” from user ... by dale_glass on Sunday April 30, 2023 @06:29AM (#35761260)
Finally? The thing has an amazing amount of useful features. Let's see:

* Automatic log cleanup to a desired storage size.

* Automatic compression, transparent decompression.

* Filtering by date, or boot number.

* Log shipping, ability to see interleaved logs from multiple machines.

* Microsecond precision for timestamps, multiple timestamp types and output formats.

* Output in JSON or multiple other formats, for trivial parsing.

* Cursors, for easily continuing parsing where you left off.

* Applications can log custom fields. No need to extract data from strings then.

* Captures logs that happen inside initramfs before / is mounted.

* Docker containers can log to the host's journald

It's pretty darn nice, really.