Skip to content

[Improvement] Nydusd config written to disk #709

@Fricounet

Description

@Fricounet

Problem Summary

Currently, the config needed by nydusd to start is written to disk by the snapshotter. This is a bit of a security concern because the potential registry access credentials are written in this file.
Although someone getting root access on the host would be able to do the same things as the nydus-snapshotter to generate its own credentials, it would still be better to not write them to disk at all.

Proposed Improvement

I think there are a few things to discuss there:

  1. What do we write to disk? Nothing at all? Or the nydusd config but missing the creds that will have to be passed using another method
  2. If we don't write the config at all, how do we ensure nydusd gets access to its config fast enough so that it can start properly?
  3. If we only omit the credentials, what method should we use to transmit this information early enough that nydusd hasn't started making registry api calls?

I don't have a strong opinion for 1.
For 3, @imeoer proposed in #690 that we orchestrate calling the new nydusd API PUT /api/v1/config depending where we are in the startup process and the nydusd kind (upgrade, failover, first start). I think this would work although I'm a bit wary of the orchestration complexity there. I don't think this approach would work well for 2. though because nydusd socket is started a bit late during the startup process.

There's is another idea I got and that I wanted to share which is about using kernel FIFOs. FIFO would ensure that the config (or creds for that matter) are never persisted to disk while keeping orchestration tasks simple because the snapshotter can write to the FIFO before nydusd is even started and nydusd can wait on the FIFO when it starts to make sure it gets its config in a timely manner.

Happy to discuss more on this!

Additional Context

Issue created from the discussions we had in #690

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions