News for hackers. Stuff that matters.
Re:I Built Linux from Scratch by lrvick on Tuesday June 27, 2023 @02:35PM (#36496901)
IMO a secure server is an immutable appliance. I still build Linux from scratch most weeks as a core part of my job.

Bare bones hardened kernel + shim init + target application are all you need, and will be your highest security/reliability systems.

And yeah, threadrippers are a must.

Re:I Built Linux from Scratch by englishrookie on Tuesday June 27, 2023 @02:57PM (#36497192)
I assume you compile the source code because you want to be sure you don't use any compromised binaries? But how can you be sure the source code wasn't compromised with some obfuscated C code? (Honest question, I'm just a humble application developer.)
Re:I Built Linux from Scratch by musicnarcoman on Tuesday June 27, 2023 @03:14PM (#36497394)
While I do not build LFS regularly or for production use, the security improvement typically comes from the fact that the end system is _super_small_ and focused. Less software means less attack surface.

Sure, compromised binaries are nasty but personally I do place quite a lot of trust with the distribution repos.

(PS, if you are reading this and contribute packages to distribution repos: Thank you!)

Re:I Built Linux from Scratch by sneed_chucker on Tuesday June 27, 2023 @03:14PM (#36497390)
You can never be 100% sure. Even the compiler, firmware, or hardware could be compromised.

Security comes down to reducing attack surface, ideally to an infinitesimal degree.

Re:I Built Linux from Scratch by lrvick on Tuesday June 27, 2023 @06:01PM (#36499274)
It is dramatically easier to hide malware in a compiled artifact than in public source code, not to imply that the latter does not happen.

In security focused orgs though you review all code yourself with the exception of things with extensive third party signed review such as the Linux kernel itself. Even then I review codepaths in the kernel critical for my use case such as random.c

From there, if I -alone- compile containers, kernels, or binaries, someone could coerce me to tamper with them to compromise all downstream users. Same if there was a central build system I can access. To mitigate this I ensure my artifact builds are deterministic, sign my changes, and have team members review my changes, reproduce my artifacts bit for bit, then counter-sign the results.

It is never wise to be in a position where there is possibility of you yourself tampering with things that control anything of value, or else someone will coerce you to help them steal said value.

As a security engineer it is my job to ensure no one ever has to trust anyone, including me.

Re:I Built Linux from Scratch by severine on Tuesday June 27, 2023 @06:31PM (#36499589)
Typo in your homepage: "Continuious Integration"

Interesting thread!

Re:I Built Linux from Scratch by lrvick on Tuesday June 27, 2023 @10:57PM (#36501727)
Good catch!
Re:I Built Linux from Scratch by ilyt on Tuesday June 27, 2023 @04:28PM (#36498213)
As in manually or https://buildroot.org/ ?
Re:I Built Linux from Scratch by lrvick on Tuesday June 27, 2023 @06:04PM (#36499301)
I used to make heavy use of buildroot but these days for most of my use cases I just have a kernel, and an init/application binary that I statically compile into the kernel. A simple makefile gets the job done and is easier to review than the whole of buildroot.
Re:I Built Linux from Scratch by ranger_danger on Sunday July 02, 2023 @01:26PM (#36563537)
what happens if the program crashes? with no init there is no way to restart it?
Re:I Built Linux from Scratch by reaperman on Tuesday June 27, 2023 @10:59PM (#36501733)
> And yeah, threadrippers are a must.

I mean, they give a wonderfully higher quality of life for compiling but they are $2,500-6,000 just for the CPU. Of course this can be done on much lower-cost CPUs! A 12-core Ryzen is already at the "I have lots of money to spend" end of what I'd suggest for something like this.

Re:I Built Linux from Scratch by lrvick on Wednesday June 28, 2023 @06:09AM (#36504456)
If you are compiling Linux kernels for a living, odds are near 100% your time waiting on compiles costs more than an employer buying you a beefy CPU.
Re:I Built Linux from Scratch by reaperman on Wednesday June 28, 2023 @07:21AM (#36504883)
Sorry, by "something like this" I meant LFS. Obviously the word "this" was ambiguous as GP said "I compile linux kernels for work".