ENGINEERING 70 upvotes 2020

How We Built SELinux Support for Kubernetes

70 pts
Hacker News Signal
2020 · Shared by @twakefield
How We Built SELinux Support for Kubernetes by @twakefield

Retrospective Overview & Key Insights

Distilled reflections, business mechanics, and tactical takeaways:

In this technical retrospective (2020), @twakefield shares practical architectural lessons learned from running, scaling, or migrating production software under lean constraints.

Core Principles for Independent Builders:
1
Defaulting to simpler architectures (such as monolithic frameworks, SQLite, or managed VPS) prevents early engineering bankruptcy.
2
Evaluating true compute and egress costs reveals that high cloud bills can often be slashed by 80%+ through judicious re-platforming.
3
Code you write at 2 AM as a solo engineer must be easy to debug six months later without complex microservice dependencies.
Community Debate Themes:

HN engineers debated the tradeoffs between cloud convenience and raw server economics, database indexing strategies, and resisting premature architectural complexity.

Community Discussions & Critical Reviews

Key perspectives, counter-arguments, and peer founder insights debated on Hacker News (32 total discussions):

RW @rwmj Peer Contributor
LI @lima Peer Contributor
MA @marbu Peer Contributor

While the article shows how they build SELinux policy from scrath, they also mention udica tool[1] which generates SELinux profile based on container inspection:

# podman inspect my_container_id | udica my_container

I wonder how much would the result be different in their case or how much time would they save by having the first version of the policy being generated this way instead of writing it from scratch.

[1] https://github.com/containers/udica ↗

HE @heywire Peer Contributor

An off-topic but somewhat related question. What is a good way to whitelist which applications can access the network on my desktop linux system? (Currently running Arch, but I distro-hop quite often). Years ago when I had a MacBook, I used a program called Little Snitch. I see that there is a similar application for Linux called OpenSnitch, but I’m hoping there is a better way to utilize the built in features of Linux rather than introducing a 3rd party kernel module. Are SELinux / AppArmor the answer? Cgroups? Something else?

TE @tedk-42 Peer Contributor

SELinux was a good way of securing linux machines with many services sharing things like file systems and binaries.

k8s solves this in a different way. You can write applications that are completely stateless when spun up on a k8s node and can be limited to a read only file system. Your container can be a scratch container with no other executables binaries.

I don't know what their product is, but i seriously doubt mixing these two concepts is the right thing to do.

HISTORICAL ERA Pandemic Bubble (2020–2022)
COMMUNITY SCORE 70 points
TOTAL DISCUSSIONS 32 comments
TOPICS & TECH STACK:
More Retrospectives by @twakefield