Skip to content

Filesystem gate#30

Draft
scothis wants to merge 1 commit into
componentized:mainfrom
scothis:gate
Draft

Filesystem gate#30
scothis wants to merge 1 commit into
componentized:mainfrom
scothis:gate

Conversation

@scothis
Copy link
Copy Markdown
Member

@scothis scothis commented May 15, 2026

Intercept wasi:filesystem calls allowing per call access control decisions. The 'gate' is a component that virtualizes the wasi:filesystem interfaces and also import a latch interface. The latch defines the access control check and returns a decision.

For any call, a latch can either allow, deny or abstain. Denials include an error-code as the reason. Latches can be composed together to define more advanced behavior. The latch-N components compose N latches together. An allow or deny decision is returned immediately while an abstain decision allows the next latch to have an opinion.

For example, if we want to make a component's access to the filesystem be read-only while other parts of the runtime need read-write, we can compose the ro-consume with a gate, while the rw-consumer has full access to the filesystem. The latch is itself a composition of two other latches, the first is the read-only latch which denies calls that would modify the filesystem. The allow latch approves calls that have otherwise not been denied. The composition enabled additional behavior be added, such as denying access to certain directories, or any other. behavior a use chooses to implement. Replace the latch-2 component with latch-3 when there is a third latch to orchestrate.

              host
             ↗    ↖               ↗ latch-readonly
  rw-consumer     gate  →  latch-2
                   ↑              ↘ latch-allow
               ro-consumer

Intercept wasi:filesystem calls allowing per call access control
decisions. The 'gate' is a component that virtualizes the
wasi:filesystem interfaces and also import a latch interface. The latch
defines the access control check and returns a decision.

For any call, a latch can either allow, deny or abstain. Denials include
an error-code as the reason. Latches can be composed together to define
more advanced behavior. The latch-N components compose N latches
together. An allow or deny decision is returned immediately while an
abstain decision allows the next latch to have an opinion.

For example, if we want to make a component's access to the filesystem
be read-only while other parts of the runtime need read-write, we can
compose the ro-consume with a gate, while the rw-consumer has full
access to the filesystem. The latch is itself a composition of two other
latches, the first is the read-only latch which denies calls that would
modify the filesystem. The allow latch approves calls that have
otherwise not been denied. The composition enabled additional behavior
be added, such as denying access to certain directories, or any other.
behavior a use chooses to implement. Replace the latch2 component with
latch3 when there is a third latch to orchestrate.

```
              host
             ↗    ↖             ↗ latch-readonly
  rw-consumer     gate → latch2
                   ↑            ↘ latch-allow
               ro-consumer
```

Signed-off-by: Scott Andrews <scott@andrews.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant