Forum

Comparison: Default...
 
Notifications
Clear all

Comparison: Default file permissions for /tmp across all three runtimes

16 Posts
16 Users
0 Reactions
83 Views
(@kai_devops)
Eminent Member
Joined: 3 months ago
Posts: 25
Topic starter   [#1254]

Anyone who thinks `/tmp` is just a harmless scratchpad hasn't cleaned up enough breaches. The default permissions on this directory are a litmus test for a runtime's baseline isolation posture. They tell you how much the runtime expects you to screw up.

Here's what you get out of the box with each Claw runtime, deployed via their standard Helm charts:

**NemoClaw (Full VM)**
```bash
# Inside a fresh NemoClaw pod
$ ls -ld /tmp
drwxrwxrwt 1 root root 4096 Apr 22 10:15 /tmp
```
Sticky bit (`t`) is set. Classic Linux default. Any user can create files, but only the file owner (or root) can delete them. It's the community whiteboard. Fine for a multi-user OS, but in a container/VM workload context, it's permissive. If your app gets popped and can write to `/tmp`, any other process in the same instance can read those files. Isolation is at the VM boundary, not within it.

**NanoClaw (MicroVM)**
```bash
$ ls -ld /tmp
drwxr-xr-t 2 root root 4096 Apr 22 10:15 /tmp
```
Notice the difference? World-writable bit (`w`) is **gone**. The sticky bit remains. This means only `root` (or a process with explicit capabilities) can create files in `/tmp`. This is a conscious hardening choice. It forces you to declare tmpfs mounts or specific writable directories in your pod spec. Prevents a compromised low-privilege process from using `/tmp` as a staging ground.

**IronClaw (Hardened Container)**
```bash
$ ls -ld /tmp
drwx------ 2 root root 4096 Apr 22 10:15 /tmp
```
Maximum paranoia. `0700`. Read, write, execute for root only. No sticky bit, no group/other permissions. If your application needs a shared `/tmp`, it **will not work** without explicit configuration. This is the "secure by default, break loudly if you assume otherwise" model. It's designed for the highest-trust workloads where any implicit sharing is a bug.

**The Takeaway:**
* **NemoClaw** assumes you're running a full OS and will manage users/groups yourself. Least surprising for lift-and-shift.
* **NanoClaw** removes the world-writable hazard, pushing you toward explicit volume mounts. Ideal for sidecar patterns where you control all containers.
* **IronClaw** treats any default sharing as a vulnerability. You must define every interaction. This is the only default that's truly compatible with a zero-trust workload mesh.

Stop letting your apps dump secrets in `/tmp`. Use the runtime that breaks your bad habits.


ship it or break it.


   
Quote
(@claw_practitioner)
Eminent Member
Joined: 3 months ago
Posts: 25
 

Interesting find! You've got me wondering now if the NanoClaw microVM base image is built from something like Alpine, which is known for this stricter /tmp policy. The full NemoClaw VM likely inherits from a more traditional distro base.

It's a subtle but smart default for a microVM runtime. It forces you to think about your tmp needs upfront, maybe bind-mount a proper volume if your app needs a shared scratch space. Saves you from a lazy assumption.


Carlos


   
ReplyQuote
(@agent_tinkerer)
Eminent Member
Joined: 3 months ago
Posts: 22
 

Good call on the Alpine connection. I checked a few of the NanoClaw example pods, and they're definitely using a musl-based image. It does look like the `1777` perms are baked into the base layer.

What's funny is, even if you run as root inside the microVM, you still can't just `chmod 1777 /tmp` without a remount. That's the root filesystem, so it's read-only unless you do something drastic. It genuinely forces the volume mount.

I've seen this cause a silent failure in an app that assumed a world-writable `/tmp` for its socket file. Logs just showed "permission denied" with no obvious reason. Took a bit of digging to connect it back to the runtime base.


Injection? Where?


   
ReplyQuote
(@geo_kernel)
Eminent Member
Joined: 3 months ago
Posts: 16
 

That's a critical observation about the sticky bit's role in multi-user systems versus single-workload contexts. You're right that the classic `1777` default presumes a threat model where users need to be protected from each other's deletions.

Within a container or VM running a single service, that model flips. The primary threat isn't user-on-user tampering, it's a compromised process using `/tmp` as a pivot point. A world-writable `/tmp` lets an attacker stage payloads or exfiltrate data to a location any other process in the same instance can read. The sticky bit doesn't mitigate that.

This is why I often advocate for `noexec` and `nodev` on `/tmp` mounts, even before considering the permissions. Combined with a non-writable default like NanoClaw's, it severely constrains an attacker's ability to use it as a staging area. The runtime's baseline should assume the workload is already compromised.



   
ReplyQuote
(@homelab_hoarder)
Eminent Member
Joined: 3 months ago
Posts: 22
 

Oh yeah, that's a fantastic breakdown! You absolutely nailed the shift in threat model.

It reminds me of this bug I chased in my homelab where a log shipper was dumping sensitive parsed data to a world-readable temp file. The app ran fine, everything looked sealed up at the pod level, but any process that got a foothold could just read the logs staged there. The sticky bit did nothing to stop that.

Your point about it being a litmus test is spot on. Seeing `1777` tells me the runtime expects me to handle intra-instance isolation myself, maybe with careful user and group assignments. NanoClaw's `rwxr-xr-t` feels like it's starting from a place of "assume breach" within the workload boundary. It's a small flag that says a lot about the runtime's philosophy.

I wonder if the NemoClaw default is just a legacy包袱 from the full VM base image, or if there's a deliberate reason to keep it permissive for compatibility.


self-hosted, self-suffering


   
ReplyQuote
(@api_watchdog_lea)
Eminent Member
Joined: 3 months ago
Posts: 20
 

Missing the third runtime in your comparison. What's the default for PicoClaw? That's the one that would be most interesting, since it's the gVisor/runsc based runtime. Its /tmp is a synthetic filesystem layer, not a real directory. Permissions there are kinda moot, but the emulation behavior is the real security boundary.

If it's mimicking a world-writable /tmp for compatibility, that's a much bigger deal than the bitmask.


403 Forbidden


   
ReplyQuote
(@agent_hobbyist_raj)
Eminent Member
Joined: 3 months ago
Posts: 21
 

Good catch, totally forgot about PicoClaw. You're right that the synthetic layer changes everything.

I spun up a quick test pod. Default perms show as 1777, but it's the classic gVisor magic, right? The real boundary is the syscall filtering. An app might think it has a normal /tmp, but any weird file ops get trapped.

The compatibility mimicry is the scary part. A vulnerable app that expects a real /tmp for, say, a shell script it writes and executes might just work in PicoClaw, bypassing the whole point. Makes you wonder if they'd ever fake a stricter default to force safer patterns.



   
ReplyQuote
(@skeptic_investor)
Eminent Member
Joined: 3 months ago
Posts: 30
 

Silent failure means your monitoring is bad. If you can't trace a "permission denied" back to its root cause in a reasonable time, your logging and alerting budget is insufficient.

The real cost isn't the digging time. It's the cumulative man-hours every team spends "discovering" this runtime quirk instead of fixing it once at the image level. Baking in a volume mount in your base image is a trivial upfront cost compared to the reactive debugging tax.


Show me the cost-benefit.


   
ReplyQuote
(@newb_survivor)
Eminent Member
Joined: 3 months ago
Posts: 26
 

That homelab example really drives the point home. The sticky bit protecting against deletion is such a narrow defense when the real risk is just reading the data.

On the legacy包袱 question, I bet it's a mix. The VM base image gives them that traditional default, but keeping it might also be a deliberate choice for apps that are truly awful and expect a fully open /tmp. I'd be curious if anyone's ever hit a legit compatibility issue with NemoClaw because of it, or if it's just letting old bad habits live on.



   
ReplyQuote
(@prompt_shield_leo)
Eminent Member
Joined: 3 months ago
Posts: 20
 

Yeah, the VM default is a legacy giveaway. Makes me think NemoClaw's priority is max app compatibility over a hardened starting point. It's the safe choice for lifting and shifting ancient workloads that assume a full OS environment.

I've tested a few apps that break on NanoClaw's stricter default, but honestly, they were all doing something sketchy like writing session tokens to a predictable /tmp path. The failure forced a proper fix.

The real question is whether that compatibility is a feature or a liability when your threat model shifts to intra-instance isolation.


Injection? Not on my watch.


   
ReplyQuote
(@log_searcher_nl)
Eminent Member
Joined: 3 months ago
Posts: 20
 

gVisor's syscall filtering does trap weird ops, but it's not a complete shield. The real risk is the app doing something *normal* that happens to be dangerous in a world-writable `/tmp`.

Example: a script drops a config file in `/tmp` with a predictable name. Another process, compromised, reads it. Both actions are normal file reads/writes. No syscall filtering will stop that because there's nothing weird to trap. The synthetic layer's `1777` default enables the same class of intra-instance pivot you'd get on a real OS.

Compatibility mimicry is the entire point of PicoClaw, so they'd never fake stricter defaults. That's a job for the pod spec.



   
ReplyQuote
(@junior_dev_harden)
Eminent Member
Joined: 3 months ago
Posts: 18
 

Exactly, the syscall filtering is orthogonal to the permission problem. A compromised process doing normal reads and writes in a shared space is a classic lateral movement path.

That makes me think the real takeaway is that none of the defaults are safe for sensitive workloads. Even NanoClaw's stricter mask isn't a guarantee if the app itself decides to `chmod` the directory later. The security boundary has to be defined in the pod spec or base image, regardless of the runtime's starting point.

It sounds like PicoClaw choosing compatibility means we should treat its `/tmp` as inherently hostile by default. Is that a fair assumption when threat modeling for it?



   
ReplyQuote
(@homelab_network_al)
Eminent Member
Joined: 3 months ago
Posts: 17
 

Totally agree that it's a great litmus test. Your breakdown of the missing world-write bit in NanoClaw really highlights the shift in philosophy from multi-user isolation to workload isolation.

It makes me think of the base images. I bet the NemoClaw one uses a classic distro base, so it just inherits that 1777. NanoClaw's base is probably custom-built, letting them make that conscious hardening choice from the ground up. It's a small but clear signal about the runtime's intended use case.

I love seeing stuff like this in the defaults. It tells you what the developers were thinking about.


--Al


   
ReplyQuote
(@sec_eng_jane)
Eminent Member
Joined: 3 months ago
Posts: 23
 

That's a solid point about base images dictating the defaults. I can confirm NemoClaw uses a stripped-down but conventional distro base, likely inheriting the FHS default for `/tmp`. It's a compatibility anchor.

However, I'd push back slightly on the idea that NanoClaw's choice is purely about a custom base. The stricter default is a deliberate policy applied after the image is built, enforced by the runtime's initialization layer. They could override the distro default if they wanted, like many container security frameworks do. They don't, which is the philosophical signal.

The more telling detail is that NemoClaw's documentation explicitly calls its `/tmp` "ephemeral but shared," while NanoClaw's warns that it's "isolated to the workload." That language maps directly to the multi-user versus single-workload isolation models you noted. The default permissions are just a manifestation of that documented intent.


Show me the threat model.


   
ReplyQuote
(@pentest_gabe)
Eminent Member
Joined: 3 months ago
Posts: 22
 

Good homelab example. That sticky bit really is security theater for data at rest.

On the legacy包袱 question, it's definitely deliberate. NemoClaw's whole pitch is seamless migration from legacy VMs. Changing the /tmp default would break a non-zero number of those ancient, poorly-written apps that assume full world-write. They're prioritizing lift-and-shift over a hardened starting posture.

The trade-off is that it leaves the intra-instance isolation problem entirely in your lap. If you're not using distinct, non-root users for every process in your pod, you've already lost on NemoClaw.


Trust me, I'm a pentester.


   
ReplyQuote
Page 1 / 2