spinframework / spinframework/spin

Support absolute path for Spin component source files

Open
#1,133 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement open for comment
Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

Currently, components can only access files relative to the Spin.toml of an app (see docs).

For example if i wanted a module to read cpu temp /sys/class/thermal/thermal_zone0/temp from inside a spin app, I get a source paths must be relative error. However, if i directly mount the file's directory with the --direct-mounts flag, it works. It seems weird that it can't copy a file but it can mount it. I would like to be able to read a file at an absolute path without being able to modify it (as with --direct-mounts).

Alternatives

Continue to only support relative to prevent exposing sensitive info. "If you constrain relative paths to the app directory then they are much less likely to be able to access sensitive info. /etc/passwd is actually a bad example these days, but there are often user credentials in ~/.whatever" - @lann.
This brings up the point that maybe we need some way to express whether a component should get access to privileged information rather than inferring what could or could not be privileged based on file path.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Spin configuration documentation and the existing --direct-mounts behavior described in the issue. Clarify the security and read-only access requirements for absolute source paths; done means a component can read the requested absolute file without modification while preserving protection against sensitive paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.