Skip to content

Consider support wasi file read ABI #127

Open

Description

@bianpengyuan

The wasi abi for file read is already defined, but not implemented. This will be really useful for the case where a secret needs to be read from a file:

Word wasi_unstable_fd_read(void *, Word, Word, Word, Word) {

Activity

  1. mathetake commented on Feb 10, 2021

    @mathetake
    Contributor

    FYI, we could read secret emebedded in env vars once #126 and envoyproxy/envoy#15009 are merged, though reading file functionality could also be helpful for users.

  2. mathetake commented on Feb 10, 2021

    @mathetake
    Contributor

    @PiotrSikora thoughts?

  3. bianpengyuan commented on Feb 10, 2021

    @bianpengyuan
    ContributorAuthor

    FYI, we could read secret emebedded in env vars once #126 and envoyproxy/envoy#15009 are merged, though reading file functionality could also be helpful for users.

    I think normally people would mount secret with file, instead of specifying via env var, which is not secure enough.

  4. PiotrSikora commented on Mar 9, 2021

    @PiotrSikora
    Member

    We have people asking about this, and while some of the use cases are better served using existing facilities (e.g. reading plugin configuration from Envoy instead of from local file), some are a bit more reasonable (e.g. reading multi-megabyte files to initialize complex libraries, which we don't necessary want to propagate through the xDS pipeline).

    I believe that ultimately this will be a footgun (e.g. used for serving static files directly from Wasm), but it seems that we have to add it to unblock some legitimate use cases.

    WASI has a concept of pre-opened directories (with read & write access to files within that directiory), but I think we need to be even more strict and allow only read access to pre-opened files. I have an early prototype doing just that.

    One issue with that approach is that WASI assumes stable sandbox (i.e. args, envs, and preopen dirs are all initialized at WasmVM startup), which means that we need to configure sandbox on a per-WasmVM and not a per-plugin basis.

  5. self-assigned this
    on May 7, 2021
  6. linzg2002 commented on Oct 26, 2021

    @linzg2002

    @PiotrSikora, any update for this new feature? In my project, I want to create an envoy_fitler with WASM to do the authenticatoin&authorization check in the istio side car. To fulfill that, the filter needs to read many permission configuration data from filesystem. So very like to see the feature would be implemented(read only is fine). Anyother alternative approach is also welcomed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions