News for hackers. Stuff that matters.
Re:Broken by design: systemd by d0 on Monday February 10, 2014 @06:06AM (#7210293)
daemontools doesn't run as pid 1 and achieves all of this.

http://cr.yp.to/daemontools.html

Re:Broken by design: systemd by FooBarWidget on Monday February 10, 2014 @06:11AM (#7210315)
Re:Broken by design: systemd by Fasebook on Monday February 10, 2014 @07:14AM (#7210554)
That comment is insane. Why would log files need journaling? They should be serialized.

How is adding a line to a run script "duplicating logic badly"?

Coupling is clearly bad, as evidenced by ... 30+ years of software design, but is a necessary evil. I don't see any reason why it's necessary in such a low level system component. "this is not rocket science" you don't impose dependencies on something you want to be reliable.

Daemontools is clearly the most mature solution, from a perspective of stability. It's probably why nobody wants to use it, there's nothing to play with or exploit for profit because it already works.

Re:Broken by design: systemd by bitwize on Monday February 10, 2014 @08:48AM (#7210989)
That comment is insane. Why would log files need journaling? They should be serialized.

systemd-journald provides tampering-attestation features that plain-text logs do not, and cannot, provide. It's fundamentally more secure.

Re:Broken by design: systemd by peterwwillis on Monday February 10, 2014 @09:54AM (#7211344)
Fallacy: having owned the user that writes logs, I cannot fuck with your logs if journaled.

Reality: if I owned the user writing logs, I can do anything I want with the logs, no matter how they're stored.

Re:Broken by design: systemd by hdevalence on Monday February 10, 2014 @10:39AM (#7211567)
No, you cannot do anything you want with the logs.

Here is something you cannot do: you cannot alter the logs without anyone noticing, since log entries have a rolling hash.

This prevents an attacker from being able to modify logs without detection, and was implemented in systemd after the postmortem on the kernel.org breakin, i.e., it was developed to counter an actual threat.

I would suggest you read up on what log attestation actually does.

Re:Broken by design: systemd by peterwwillis on Monday February 10, 2014 @11:48AM (#7212011)
Logs can be modified in real time by being intercepted during writes to the buffer before the new hash is applied. Because of this, only the logs up to the intrusion can be preserved, and even then if the old message/hash/key/etc is still in memory, the old messages can be modified.

The only truly secure way to record messages up to the point of break-in is a one-way remote log. Any new messages after break-in is subject to falsification.

Re:Broken by design: systemd by bct on Monday February 10, 2014 @11:59AM (#7212089)
> The only truly secure way to record messages up to the point of break-in is a one-way remote log.

And if you have this then you don't need a fancy cryptographic syslogd to detect tampering.

Re:Broken by design: systemd by peterwwillis on Monday February 10, 2014 @02:09PM (#7212967)
The fancy cryptologic syslogd is fallible as I mentioned previously, so why depend on it? And really if you really want to cover your tracks you can just cause random disk corruption over the whole disk (and just happen to damage the journal in the process). Things will start failing rapidly, fsck will later show itself fixing the disk corruption, and it will be assumed to be a hardware error and the incident ignored.

Security half-measures do not mean you are secure. If it can be hacked, it will be hacked, and then what was the point of sacrificing your whole system's init system?

(Also you could just replace syslogd with a journaled syslogd, rather than replacing your entire init system... but I guess that's off-topic?)

Re:Broken by design: systemd by bct on Monday February 10, 2014 @04:10PM (#7213853)
I'm agreeing with you.
Re:Broken by design: systemd by Fasebook on Monday February 10, 2014 @02:39PM (#7213173)
>rolling hash

FAIL. You just wrote outdated software. Under this dumbass idea of journaling, which by defition is there to allow editing.., the best thing you can do is built a rolling function, which basically means coping the data, which basically means increasing your attack surface.

Re:Broken by design: systemd by andor on Monday February 10, 2014 @11:02AM (#7211730)
The journal sealing provides forward security. The sealing keys are exchanged regularly, and the old keys are deleted safely. A verification key, which is stored on another device or offline, can be used to calculate the sealing key for any given moment. While an attacker can change the logs, this will always be visible in an audit.

http://lwn.net/Articles/512895/

https://eprint.iacr.org/2013/397.pdf

Re:Broken by design: systemd by d0 on Monday February 10, 2014 @11:08AM (#7211762)
the old keys are deleted safely

Assuming nothing has managed to redirect those unlinks for example...

Re:Broken by design: systemd by andor on Monday February 10, 2014 @03:25PM (#7213543)
I guess you're right. The mechanism is forward-secure, which means for an attacker that tampering the logs is the first thing to do, not the last ;-)

As soon as the attacker manages to extract the state of the key generator from memory at one point of time, the log entries from that and the following sealing periods can be modified and cleanly sealed.

Re:Broken by design: systemd by asabjorn on Monday February 10, 2014 @10:53AM (#7211656)
From what I understand systemd can optionally store a copy of the logs on a remote server. The key to modify the logs on the remote server is changed in such a way that even if a system is compromised the log copy on the remote system can not be changed.

These remote copies of the logs could actually be used to detect log-tampering and 0day exploits.

Re:Broken by design: systemd by Fasebook on Monday February 10, 2014 @03:27PM (#7213566)
>From what I understand systemd can optionally store a copy of the logs on a remote server.

anything can have any feature, what matters is how it's built.

Re:Broken by design: systemd by edwintorok on Monday February 10, 2014 @10:53AM (#7211663)
rsyslog allows you to sign your logs if you want to: http://www.rsyslog.com/how-to-sign-log-messages-through-sign...
Re:Broken by design: systemd by aidenn0 on Monday February 10, 2014 @12:34PM (#7212304)
daemontools can't reliably monitor daemons that reparent themselves to init or kill their pgroup.

I have written hacks to work around this (I have a gentoo VM that uses supervise as an openRC replacement, and have several hacks to work around this issue). It's a pain in the ass, and one reason why systemd runs in pid 1.

I prefer daemontools, but it's not perfect; it made a different set of tradeoffs.

Re:Broken by design: systemd by gnoway on Monday February 10, 2014 @08:43AM (#7210957)
How does svscan handle service dependencies?
Re:Broken by design: systemd by d0 on Monday February 10, 2014 @09:06AM (#7211094)
It doesn't. That's the point. Nothing in daemontools does. Dependencies are bad.
Re:Broken by design: systemd by deong on Monday February 10, 2014 @09:43AM (#7211281)
I'm not sure if you're making a point more subtle than I'm reading, but when most people in the systemd debate say "dependencies are bad", they mean that having loads of things depend on the init system is bad.

The comment you're responding to is talking about dependencies in boot services, e.g., sshd depends on having the network interface up. Systemd does a great job of handling this sort of thing, allowing services to start in parallel, but ensuring that things only start after all the pieces they rely on have started. That sort of dependency isn't "bad" -- it just is. You can't remove a dependency like this, it reflects reality.

That said, I really don't care for systemd. I think the complexity it adds more than counteracts the benefits it provides, but I'm old and didn't mind SysV or BSD init.

Re:Broken by design: systemd by d0 on Monday February 10, 2014 @09:59AM (#7211371)
I'm saying that the dependency on the network being up is bad for services. An example of a bad case: if the network interface is hotplugged or down and you're running Redis, do you want it to restart and have to drag the entire AOF file off disk just because you yanked the interface card because it was failed or failing? Your 20 second hotplug problem becomes a 15 minute block of IO coming off disk because you had to restart the process.

So many problems come from such a simple dependency.

Designing all services to handle and expect failures and just let init restart regardless of the state is the RIGHT solution.