ess-dockerfile-runtime-copy

ess-dockerfile-runtime-copy is a cursor rule for Cursor from CiscoDevNet/essentials. It costs 405 tokens per session, scanned A, original, Apache-2.0.

A Dockerfile rule for making application files in the final container image owned by root and not writable by the process that runs them. A container is an isolated environment used to package and run software.

In plain words
What is it for?
It is for setting ownership and permissions on runtime-stage Dockerfile COPY and ADD instructions, while leaving writable directories separate.
Why use it?
It reduces the chance that a compromised application can rewrite its own code and weakens the impact of a runtime compromise.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for setting ownership and permissions on runtime-stage Dockerfile COPY and ADD instructions, while leaving writable directories separate.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/ciscodevnet/essentials/ess-dockerfile-runtime-copy
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/CiscoDevNet/essentials

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ess-dockerfile-runtime-copy

README.md
[![agentmods](https://agentmods.dev/badge/rules/ciscodevnet/essentials/ess-dockerfile-runtime-copy/github.svg)](https://agentmods.dev/rules/ciscodevnet/essentials/ess-dockerfile-runtime-copy)
Your own site
<a href="https://agentmods.dev/rules/ciscodevnet/essentials/ess-dockerfile-runtime-copy"><img src="https://agentmods.dev/badge/rules/ciscodevnet/essentials/ess-dockerfile-runtime-copy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ess-dockerfile-runtime-copy

Your own site · 80×15
<a href="https://agentmods.dev/rules/ciscodevnet/essentials/ess-dockerfile-runtime-copy"><img src="https://agentmods.dev/badge/rules/ciscodevnet/essentials/ess-dockerfile-runtime-copy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 405 This file is loaded in full into every session.
When invoked 405 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00405 $0.00405
Opus 5.5 $0.00162 $0.00162
Sonnet 5.5 $0.00081 $0.00081
Haiku 4.5 $0.00040 $0.00040

Measured 12d ago against content hash 15c616ed52d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ess-dockerfile-runtime-copy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/ess-dockerfile-runtime-copy.mdc · 30 lines

What it actually says

Runtime image copies stay root-owned

A container should not be able to rewrite its own application code. If the runtime user owns the files it runs, a compromised process can change them, which breaks least privilege and container immutability. SonarQube reports this as docker:S6504, on any COPY or ADD whose --chown user is not root.

In the final stage, copy application files as root and drop the write bit. The runtime user can read and traverse them and cannot modify them.

# Bad — node owns the app and can rewrite it
COPY --from=build --chown=node:node /app/dist ./dist
USER node

# Good
COPY --from=build --chown=root:root --chmod=555 /app/dist ./dist
USER node

--chmod=555 is read and execute for everyone, so directories stay traversable and files stay readable. The same flags apply whether the runtime user is node, nextjs, or any other non-root account.

Rules

  • On every runtime-stage COPY or ADD of application files, set --chown=root:root --chmod=555.
  • Do not --chown to a non-root user or a uid other than 0.
  • A path the process must write (cache, uploads, temp) is a separate empty directory. Do not loosen the application copy to make that path writable.
  • Build-stage copies that the builder then writes, such as package.json before npm ci, stay default root and omit --chmod=555. Still do not --chown them to a non-root user.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 30 lines · 405 tokens per session scan A 15c616ed52d8

Subscribe to this mod's changes

ess-dockerfile-runtime-copy is a cursor rule published in the GitHub repository CiscoDevNet/essentials (7 stars, last pushed 8d ago), licensed Apache-2.0. It adds 405 tokens to every session, about $0.0016 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-19.

Related

ess-dockerfile-runtime-copy compared with cursor rules from other repositories

ess-dockerfile-runtime-copy next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ess-dockerfile-runtime-copyCiscoDevNet/essentialsCursor rule78d agoApache-2.0A405Cursor
dashboard-testingAutomattic/wp-calypsoCursor rule13kyesterdayGPL-2.0A0Cursor
cursorrulesAmoabaKelvin/logdeckCursor rule15213d agoGPL-3.0A43Cursor
docker-deploymentmadebyaris/poinf-of-salesCursor rule1591y agoMITC0Cursor
ponytailDietrichGebert/ponytailCursor rule202k9d agoMITA604Cursor
angular-20angular/angularCursor rule102ktodayMITA0Cursor
dev-standardapache/supersetCursor rule76kyesterdayApache-2.0A1,147Cursor