This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Based on a number of discussions on and and off-list we decided to dramatically simplify the NM API and architecture, largely by merging user settings into the core daemon and securely storing all network configuration there. This will make the NM API simpler and cleaner, and enable featuers like fast-user-switching "for free". Best of all, this will simplify the codebase both in NetworkManager and in clients, allowing easier creation of new and updated user experiences that target different use-cases.

The original work towards this goal was the 2010 Google Summer of Code project of DanielGnoutcheff. Work-in-progress was posted at the rm-userset branch at http://daniel.gnoutcheff.name/nm/daemon.git. After completion of the project, his work was moved to NM git on git.freedesktop.org in the 'rm-userset' branch. The information below is a summarization of the ideas produced over the summer and a blueprint of the ongoing work to create NetworkManager 0.9. Look here for the discussions and background on how these decisions were reached.

Use cases

NetworkManager 0.9 should enable the following use-cases:

User Actions

First, let's list the main things that a user may need to do with a connection:

Permissions and Security

In place of user settings, the core daemon's settings service will be able to enforce "visibility" and access control of connections on a per-user basis. Through a combination of PolicyKit, in-connection ACLs, and a "read-only" flag, we'll be able to cover the use-cases above with a clear architecture.

Auto-activation and Visibility

A given connection is only available for automatic activation when either:

  1. it has an empty ACL, or
  2. a user listed in its ACL is logged in (and thus the connection is "visible" to at least one user)

functionality for (b) depends on ConsoleKit for session/login tracking, and we intend to make ConsoleKit an optional dependency. If ConsoleKit support is not enabled when building NetworkManager, all connections are available for auto-activation. In this case, if the connection requires secrets, and no user in the ACL list is logged in running an agent to provide those secrets, the activation attempt will fail until the next time it is manually activated. Secrets can be stored in the connection to prevent this failure.

D-Bus API Changes

Since there are now controls on what users can read which connections, each client will potentially have a different list of connections that it can read. This requires modification of the existing D-Bus API, since signals cannot be restricted to specific clients, and we do not wish to require use of peer-to-peer D-Bus connections.

Note that with this model all clients will be aware of the existence, creation, modification, and removal of any connection, even if they cannot read any details of it. We don't consider this to be problematic because virtually nothing can be determined from these events when the client is not able to actually read the connection's settings or secrets.

Secret Agents

To allow secrets to be stored securely in a users' session (as opposed to plaintext-but-root-only storage by the core daemon) specific processes (called "Agents") will be able to register with the core daemon to store and provide these secrets. VPN connections are a prime example; they are primarily single-user connections and their secrets must be well protected. A new D-Bus interface will be created to allow agents to announce their presence to NetworkManager. This interface allows multiple agents at the same time, solving the architectural issue that prevented NM 0.8 and earlier from supporting fast-user-switching. This will consist of two parts:

  1. a new interface in the core daemon to handle registration and unregistration of the agents, to request secrets from them, and to send updated secrets to them when the connection is modified
    • org.freedesktop.NetworkManager.AgentManager.Register: agents that wish to register themselves with the core daemon call this method with an identifier that enables NM to direct specific secrets requests to this agent. Only one agent may register with a given identifier in each session.

    • org.freedesktop.NetworkManager.AgentManager.Unregister: an agent that wishes to unregister may call this method. An agent is automatically unregistered when its process exits for any reason.

  2. a small interface in the agent itself to receive secrets requests and accept secrets updates from the core daemon
    • GetSecrets: analogous to the current org.freedesktop.NetworkManagerSettings.Connection.Secrets.GetSecrets request, the core daemon calls this when secrets are required to connect to a specific network. The entire connection details will be sent to the agent so that the agent itself does not have to track all connections. The agent will never be called to request secrets for a connection which the agent's user cannot "view".

    • SetSecrets: called by the core daemon to save secrets for a given connection. The entire connection is sent to the Agent.

Given that multiple agent may be registered at the same time, if a connection is visible to more than one logged-in user, and the connection itself does not provide secrets or the connection specifies that secrets should always be retrieved from an Agent, NetworkManager will query each agent (giving preference to agents in "active" sessions as determined by ConsoleKit) until it receives a secret. This should allow a system VPN connection to be shared between more than one user where secrets should be requested each time the connection is made, such as for One-Time-Pad tokens.

Settings Changes for ACLs

To facilitate the addition of the ACL to each connection the 'connection' setting will be modified to add a new 'permissions' key. This key will contain a list of strings defining exactly who has permission to view the connection. Empty elements in the list are invalid. Any given user is allowed to view or activate the connection if and only if the list is empty, or if an element in the list specifically allows that user. Each element takes the form:

<keyword>:<data>:<extra>

where the only keyword currently allowed is 'user'. Unknown keywords must be ignored and preserved. For the 'user' keyword, each <data> item names a specific user allowed to view or activate this connection. Any <extra> information is reserved for future usage by NetworkManager and must be both ignored and preserved.


2024-10-23 11:37