frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

When Root Meets Immutable: OpenBSD Chflags vs. Log Tampering

https://rsadowski.de/posts/2025/openbsd-immutable-system-logs/
61•todsacerdoti•4h ago

Comments

johnisgood•3h ago
It is not the same, but I do use "chattr +i" on a file (which applies the immutable attribute) on Linux to a file that otherwise would have been overwritten by programs that do not give a damn whether I want it to or not, and in my case it was easier to just make that file immutable, mainly: /etc/resolv.conf.
knorker•2h ago
Yeah chattr is a very useful weapon against the strongly but incorrectly opinionated mandates of systemd.

I'm just waiting for systemd to start clearing chattr bits because "the user's intentions are bad and they should feel bad".

johnisgood•2h ago
That actually does not sound too far-fetched. I believe there is a high chance that it might eventually happen, at least to files systemd """cares""" about.
Levitating•38m ago
I am curious, what files do you use it on specifically?
mmsc•2h ago
.bash_history
mzajc•1h ago
Better yet, `shopt -s 'histappend'` in your .bashrc and `chattr +a .bash_history`. This will still allow bash to add to the history, but it won't be able to trim the file.
comex•3h ago
> Once the system reaches normal security level, even root cannot tamper with these logs without rebooting into single-user mode

What stops the attacker from just editing /etc/rc.securelevel and then doing a normal reboot?

TacticalCoder•3h ago
> What stops the attacker from just editing /etc/rc.securelevel and then doing a normal reboot?

Certainly a full reboot leaves more tracks than no full reboot? So it's harder to hide?

kstrauser•2h ago
Make that file immutable so that you can only edit it in single-user mode.

This is definitely one of those “security vs convenience” situations where you can easily shoot yourself in the foot, but it’s great to have the option when you need it.

dgl•19m ago
Except it is sourced from /etc/rc, and that’s a shell script which obviously depends on the shell and some other pieces. If you want an immutable base you kind of need to make the whole (base) system immutable (and that is possibly best designed as such to start with).

I don’t think this is “security vs convenience”, I’d more argue it’s possible to think you’ve made this secure but you’ve missed something and haven’t configured it to be as secure as you think. An approach like others have suggested with remote logging is at least easier to reason about.

h43z•3h ago
Do I understand that correctly that in order for logs to rotate you have to reboot?
jelder•1h ago
My thoughts exactly. And couldn’t an attacker just fill the logging volume with uninteresting events to prevent certain other events from being recorded?
jorvi•56m ago
Log filtering via severity / keywords prevents this, assuming the logs are regularly and properly checked.
gertrunde•15m ago
That would be where something like auditd would come in, configured so that if the audit logs location runs low on space (or out of space), it will halt the system.

(Yes, quite harsh, but for some use cases it may be the right thing to do, i.e. to fail closed).

louwrentius•3h ago
If you want immutable logs, you log to an external log server. Anything else seems security theater to me.

That log server is properly firewalled/hardened so a hacked server can’t be used as a stepping stone to compromise the log server.

Maybe you even have access restrictions in place for the log server so people can’t wipe their own misdeeds (4-eyes principle).

This is how it’s been done for 35+ years, nothing special about this.

holowoodman•2h ago
Yes, so much this. It used to be that important logs (filtered by severity and keywords) were even continuously live-printed by a line printer, so that there was always a current paper copy of the really important stuff for forensics.

See e.g. https://www.youtube.com/watch?v=FiEGoVzmyvs but dot-matrix was also used and at least a little less noisy.

pjmlp•45m ago
Exactly the right approach.
eternauta3k•2h ago
Is root prevented from directly writing to the underlying block device?
kstrauser•2h ago
Yes.
messe•2h ago
Only if securelevel is 2. If securelevel = 1, then only mounted filesystems are RO. An attacker could conceivably forcibly unmount /var/log as root, and make the changes directly to the block device.
dspillett•2h ago
I feel this is fixating on the wrong problem. Even with immutable flags there are various ways an attacker with root access could, after getting what they want from the system, cover their tracks by trashing the whole system⁰, and as usual if someone has physical access all bets are off. I see filesystem level flags like that to be more tools to stop you or a bug accidentally doing something stupid, than to get in the way of a malicious action by someone else.

While the standard might effectively call for immutable logs¹, he needs to read between the lines one step further: those logs do not need to be on the same machine. You could stream logs to another system that stores them immutably from the PoV of anyone except those with root or physical access to it. You still have a problem if an attacker gets access to both the source system(s) and the log sinks², there might be a latency issue meaning you could easily lose the last few log entries in the case of a complete disaster, and you have an extra moving part in your infrastructure to monitor, but it satisfies the requirement where immutable filesystem flags can not.

----

[0] Yes, you'll know something happened, and you might guess it was malicious and not random corruption, but enough tracks might be covered to stop you working out the initial who & how.

[1] and some standars explicitly call for them

[2] Careful granular access management should largely mitigate that risk. That could be a problem if you are a small organisation trying to protect against internal disgruntled admins³, but you could use a a 3rd party log-sink service in that case.

[3] This may seem overly paranoid, but if it is required for the standard your target audience wants you to have a certificate for…, and TBH it isn't that paranoid.

Rygian•1h ago
That point should not require "reading between the lines" and that's why other standards (e.g. PCI) require explicitly that the logs are sent to a separate "central server" that provides guarantees of immutability.
JdeBP•1h ago
Indeed. That was exactly what I was thinking when I read the article, from experience of PCI compliance as a matter of fact. And clearly from comments here a lot of people are thinking the same. It may be a fun "Look! OpenBSD can do something!" thing, but the reality is that defence against the dark arts goes a lot deeper, and (as ever) one often has to read more than one standard/specification. (-:
bananapub•1h ago
immutable is a handy advisory feature, but the actual answer for log tampering is "get them off the box in to a different security domain", e.g. a log server this machine can't access and is securely backed up so logs that make it there can be fairly well trusted.
mrtesthah•9m ago
macOS has always had these chflags attributes, by the way, long before System Integrity Protection existed. Changing or removing the system-immutable/append-only flags required booting into single user mode. Even the macOS installer application itself was unable to clear them otherwise.

CP/M Creator Gary Kildall's Memoirs Released as Free Download

https://spectrum.ieee.org/cpm-creator-gary-kildalls-memoirs-released-as-free-download
59•rbanffy•2h ago•11 comments

When Root Meets Immutable: OpenBSD Chflags vs. Log Tampering

https://rsadowski.de/posts/2025/openbsd-immutable-system-logs/
61•todsacerdoti•4h ago•25 comments

Fully homomorphic encryption and the dawn of a private internet

https://bozmen.io/fhe
271•barisozmen•8h ago•98 comments

Psilocybin produces substantial sustained decreases in depression and anxiety

https://pmc.ncbi.nlm.nih.gov/articles/PMC5367557/
80•Bluestein•1h ago•42 comments

Inspect ANSI control codes and escape sequences

https://ansi.tools
37•webpro•3d ago•11 comments

ChatGPT agent: bridging research and action

https://openai.com/index/introducing-chatgpt-agent/
618•Topfi•19h ago•415 comments

Resolve (YC W15) Is Hiring an Operations and Billing Lead for Construction VR

1•ugolino91•44m ago

Mistral Releases Deep Research, Voice, Projects in Le Chat

https://mistral.ai/news/le-chat-dives-deep
581•pember•21h ago•129 comments

Servo Web Engine Further Tuning Performance

https://www.phoronix.com/news/Servo-June-2025-Highlights
28•doener•1h ago•2 comments

NIH is cheaper than the wrong dependency

https://lewiscampbell.tech/blog/250718.html
217•todsacerdoti•10h ago•145 comments

My experience with Claude Code after two weeks of adventures

https://sankalp.bearblog.dev/my-claude-code-experience-after-2-weeks-of-usage/
306•dejavucoder•18h ago•246 comments

15 Years If Jefit

https://www.jefit.com/our-story
4•jasong•3d ago•0 comments

My favorite use-case for AI is writing logs

https://newsletter.vickiboykis.com/archive/my-favorite-use-case-for-ai-is-writing-logs/
214•todsacerdoti•13h ago•144 comments

Perfume reviews

https://gwern.net/blog/2025/perfume
249•surprisetalk•1d ago•131 comments

The Most Powerful Server Embiggens a Bit with Power11

https://www.nextplatform.com/2025/07/16/the-worlds-most-powerful-server-embiggens-a-bit-with-power11/
12•rbanffy•1h ago•6 comments

Hand: open-source Robot Hand

https://github.com/pollen-robotics/AmazingHand
400•vineethy•1d ago•102 comments

TCP-in-UDP Solution (eBPF)

https://blog.mptcp.dev/2025/07/14/TCP-in-UDP.html
40•todsacerdoti•3d ago•11 comments

Hundred Rabbits – Low-tech living while sailing the world

https://100r.co/site/home.html
24•0xCaponte•3d ago•2 comments

Self-taught engineers often outperform (2024)

https://michaelbastos.com/blog/why-self-taught-engineers-often-outperform
337•mbastos•22h ago•262 comments

Fighting Brandolini's Law with Sampling

https://brady.fyi/fact-checking/
15•h-bradio•2d ago•5 comments

Extending That XOR Trick to Billions of Rows

https://nochlin.com/blog/extending-that-xor-trick
64•hundredwatt•3d ago•11 comments

Fixing a Direct3D9 bug in Far Cry (2018)

https://houssemnasri.github.io/2018/07/07/farcry-d3d9-bug/
39•anotherhue•10h ago•3 comments

DIY Telescope Mods That Transformed My Astrophotography

https://www.youtube.com/watch?v=Efmzr_K4ApQ
31•karlperera•3d ago•4 comments

A look at IBM's short-lived "butterfly" ThinkPad 701 of 1995

https://www.fastcompany.com/91356463/ibm-thinkpad-701-butterfly-keyboard
83•vontzy•3d ago•29 comments

All AI models might be the same

https://blog.jxmo.io/p/there-is-only-one-model
224•jxmorris12•19h ago•110 comments

RisingWave: An Open‑Source Stream‑Processing and Management Platform

https://github.com/risingwavelabs/risingwave
47•Sheldon_fun•3d ago•6 comments

Linux and Secure Boot certificate expiration

https://lwn.net/SubscriberLink/1029767/08f1d17c020e8292/
115•pabs3•8h ago•115 comments

Astronomers Discover Rare Distant Object in Sync with Neptune

https://pweb.cfa.harvard.edu/news/astronomers-discover-rare-distant-object-sync-neptune
46•MaysonL•12h ago•10 comments

Claude Code Unleashed

https://ymichael.com/2025/07/15/claude-code-unleashed
123•ymichael•2d ago•86 comments

Run TypeScript code without worrying about configuration

https://tsx.is/
86•nailer•19h ago•55 comments