<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Lsm on Ethan-ZYF</title><link>https://ethanzyf.com/tags/lsm/</link><description>Recent content in Lsm on Ethan-ZYF</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 21 May 2026 00:00:00 -0700</lastBuildDate><atom:link href="https://ethanzyf.com/tags/lsm/index.xml" rel="self" type="application/rss+xml"/><item><title>Week2 Day 4: K8s security — AppArmor</title><link>https://ethanzyf.com/blog/week2-day4-apparmor/</link><pubDate>Thu, 21 May 2026 00:00:00 -0700</pubDate><guid>https://ethanzyf.com/blog/week2-day4-apparmor/</guid><description>&lt;p&gt;AppArmor as the path-based complement to seccomp&amp;rsquo;s syscall-based filtering — and a hands-on lesson in why that complement is harder to deploy. This post covers how K8s wraps AppArmor (&lt;code&gt;securityContext.appArmorProfile&lt;/code&gt;, symmetric with seccomp&amp;rsquo;s three types), why an AppArmor profile is heavier than a seccomp one (it must be pre-loaded into the node&amp;rsquo;s kernel via &lt;code&gt;apparmor_parser&lt;/code&gt;, not just dropped as a file), why &lt;code&gt;deny /data/** w&lt;/code&gt; blocks every syscall that writes there (closing the hole where &lt;code&gt;touch&lt;/code&gt; bypassed yesterday&amp;rsquo;s mkdir block), and the day&amp;rsquo;s most valuable lesson: &lt;strong&gt;the experiment couldn&amp;rsquo;t run at all&lt;/strong&gt; because a Mac/Docker-Desktop kind node has no AppArmor LSM in its kernel — a firsthand encounter with the fail-open trap and the portability problem of AppArmor-based mitigations.&lt;/p&gt;</description></item><item><title>Day 5: AppArmor + layered sandbox design</title><link>https://ethanzyf.com/blog/day5-apparmor/</link><pubDate>Sat, 16 May 2026 00:00:00 -0700</pubDate><guid>https://ethanzyf.com/blog/day5-apparmor/</guid><description>&lt;p&gt;How AppArmor actually attaches to a process (via the &lt;code&gt;bprm_check_security&lt;/code&gt; LSM hook at &lt;code&gt;execve&lt;/code&gt; time, keyed on binary path), why &lt;code&gt;bash script.sh&lt;/code&gt; silently runs &lt;em&gt;unconfined&lt;/em&gt; while &lt;code&gt;./script.sh&lt;/code&gt; does not, the six exec modifiers (&lt;code&gt;ix&lt;/code&gt;/&lt;code&gt;Px&lt;/code&gt;/&lt;code&gt;Cx&lt;/code&gt;/&lt;code&gt;Ux&lt;/code&gt; and their setuid-preserving uppercase forms), the hardlink and bind-mount tricks that bypass path-based MAC, and why a production sandbox layers &lt;strong&gt;namespace + capability + seccomp + AppArmor + cgroup&lt;/strong&gt; — with the argument that, if you can only afford two, &lt;strong&gt;seccomp + AppArmor&lt;/strong&gt; is the highest-ROI pair.&lt;/p&gt;</description></item></channel></rss>