Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::AuthorizationSettings Struct Reference
Inheritance diagram for nix::AuthorizationSettings:
nix::Config nix::AbstractConfig

Public Attributes

Setting< Strings > trustedUsers
Setting< Strings > allowedUsers

Additional Inherited Members

Public Types inherited from nix::Config
using Settings = std::map<std::string, SettingData>
Public Member Functions inherited from nix::Config
 Config (StringMap initials={})
bool set (const std::string &name, const std::string &value) override
void addSetting (AbstractSetting *setting)
void getSettings (std::map< std::string, SettingInfo > &res, bool overriddenOnly=false) const override
void resetOverridden () override
nlohmann::json toJSON () override
std::string toKeyValue (bool overriddenOnly=false) override
void convertToArgs (Args &args, const std::string &category) override
Public Member Functions inherited from nix::AbstractConfig
void applyConfig (const std::string &contents, const std::string &path="<unknown>")
void warnUnknownSettings ()
void reapplyUnknownSettings ()
Protected Member Functions inherited from nix::AbstractConfig
 AbstractConfig (StringMap initials={})
Protected Attributes inherited from nix::AbstractConfig
StringMap unknownSettings

Detailed Description

Settings related to authenticating clients for the Nix daemon.

For pipes we have little good information about the client side, but for Unix domain sockets we do. So currently these options implemented mandatory access control based on user names and group names (looked up and translated to UID/GIDs in the CLI process that runs the code in this file).

No code outside of this file knows about these settings (this is not exposed in a header); all authentication and authorization happens in daemon.cc.

Member Data Documentation

◆ allowedUsers

Setting<Strings> nix::AuthorizationSettings::allowedUsers
Initial value:
{
this,
{"*"},
"allowed-users",
R"(
A list of user names, separated by whitespace.
These users are allowed to connect to the Nix daemon.
You can specify groups by prefixing names with `@`.
For instance, `@wheel` means all users in the `wheel` group.
Also, you can allow all users by specifying `*`.
> **Note**
>
> Trusted users (set in [`trusted-users`](#conf-trusted-users)) can always connect to the Nix daemon.
)"}

Who we trust to use the daemon in safe ways

◆ trustedUsers

Setting<Strings> nix::AuthorizationSettings::trustedUsers
Initial value:
{
this,
{"root"},
"trusted-users",
R"(
A list of user names, separated by whitespace.
These users will have additional rights when connecting to the Nix daemon, such as the ability to specify additional [substituters](#conf-substituters), or to import unsigned realisations or unsigned input-addressed store objects.
You can also specify groups by prefixing names with `@`.
For instance, `@wheel` means all users in the `wheel` group.
> **Warning**
>
> Adding a user to `trusted-users` is essentially equivalent to giving that user root access to the system.
> For example, the user can access or replace store path contents that are critical for system security.
)"}

The documentation for this struct was generated from the following file: