Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ACL): add general info for ACL #177

Merged
merged 6 commits into from
Nov 17, 2023
Merged

chore(ACL): add general info for ACL #177

merged 6 commits into from
Nov 17, 2023

Conversation

kostasrim
Copy link
Contributor

@kostasrim kostasrim commented Oct 16, 2023

resolves #173 and #155

  • add general information about ACL and dragonfly
  • fix requirepass and auth docs

@vercel
Copy link

vercel bot commented Oct 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 17, 2023 6:44pm

@vercel
Copy link

vercel bot commented Oct 20, 2023

@kostasrim is attempting to deploy a commit to the DragonflyDB Team on Vercel.

To accomplish this, @kostasrim needs to request access to the Team.

Afterwards, an owner of the Team is required to accept their membership request.

If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account.

@@ -16,12 +16,12 @@ import PageTitle from '@site/src/components/PageTitle';

**ACL categories:** @fast, @connection

The AUTH command authenticates the current connection if the Dragonfly server is password protected via the `requirepass` option. Dragonfly will deny any command executed by the just
The AUTH command authenticates the current connection. If the `username` is omitted, it implies the user `default` from ACL. Dragonfly will deny any command executed by the just
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The AUTH command authenticates the current connection. If the `username` is omitted, it implies the user `default` from ACL. Dragonfly will deny any command executed by the just
The `AUTH` command authenticates the current connection. If the `username` is omitted, it implies the user `default` from ACL. Dragonfly will deny any command executed by the already

connected clients, unless the connection gets authenticated via `AUTH`.

If the password provided via AUTH matches the configured password, the server replies with the `OK` status code and starts accepting commands. Otherwise, an error is returned and the clients needs to try a new password.

Additionally, `AUTH` can be used to authenticate users created by the `ACL SETUSER` command.
Note, that `requirepass` now also changes the ACL default user `password`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note, that `requirepass` now also changes the ACL default user `password`.
Note that `requirepass` also changes the ACL default user `password`.

@@ -63,7 +63,7 @@ Because `HELLO` replies with useful information, and given that protover is opti

When called with the optional protover argument, this command switches the protocol to the specified version and also accepts the following options:

`AUTH <username> <password>`: directly authenticates the connection in addition to switching to the specified protocol version. This makes calling `AUTH` before `HELLO` unnecessary when setting up a new connection. Note that the username must be set to "default" as Dragonfly does not support ACLs, but rather uses the requirepass mechanism.
`AUTH <username> <password>`: directly authenticates the connection in addition to switching to the specified protocol version. This makes calling `AUTH` before `HELLO` unnecessary when setting up a new connection. Note that the username default is "default" as Dragonfly has built in support for ACLs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`AUTH <username> <password>`: directly authenticates the connection in addition to switching to the specified protocol version. This makes calling `AUTH` before `HELLO` unnecessary when setting up a new connection. Note that the username default is "default" as Dragonfly has built in support for ACLs.
`AUTH <username> <password>`: directly authenticates the connection in addition to switching to the specified protocol version. This makes calling `AUTH` before `HELLO` unnecessary when setting up a new connection. Note that the default username is "default".

@@ -0,0 +1,127 @@
# Access Control Lists (ACL)

Dragonfly has built in support for ACL. DF operators, get fine grained control on how and who accesses the datastore via the ACL family of commands.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Dragonfly has built in support for ACL. DF operators, get fine grained control on how and who accesses the datastore via the ACL family of commands.
Dragonfly has built in support for ACL. DF operators get fine grained control on how and who accesses the datastore via the ACL family of commands.

# Access Control Lists (ACL)

Dragonfly has built in support for ACL. DF operators, get fine grained control on how and who accesses the datastore via the ACL family of commands.
Since, DF is designed as a drop in replacement for Redis, you can expect the same API functionality for ACL as in Redis.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Since, DF is designed as a drop in replacement for Redis, you can expect the same API functionality for ACL as in Redis.
Since Dragonfly is designed as a drop in replacement for Redis, you can expect the same API functionality for ACL as in Redis.

```

This allows the user `John` to execute only the `SET` && `GET` commands and all of the commands associated with the group `FAST`.
Any attempt of user `John` to issue a command other than the above, will be rejected by the system.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Any attempt of user `John` to issue a command other than the above, will be rejected by the system.
Any attempt of user `John` to issue a command other than the above will be rejected by the system.

Note, that the `aclfile` file is compatible with Redis (however it must not contain any keys or
pub/sub DSL's because these yet are not supported so if you plan to migrate, just open the file and strip them away).

If you want the `aclfile` to be writable, that is, if you want `ACL SAVE` to work, we would advice against placing the `aclfile`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you want the `aclfile` to be writable, that is, if you want `ACL SAVE` to work, we would advice against placing the `aclfile`
If you want the `aclfile` to be writable, that is, if you want `ACL SAVE` to work, we would advise against placing the `aclfile`

pub/sub DSL's because these yet are not supported so if you plan to migrate, just open the file and strip them away).

If you want the `aclfile` to be writable, that is, if you want `ACL SAVE` to work, we would advice against placing the `aclfile`
under `/etc` directory because the folder is only accesible by Dragonfly as `readonly`. You change this behaviour, by editing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
under `/etc` directory because the folder is only accesible by Dragonfly as `readonly`. You change this behaviour, by editing
under `/etc` directory because usually that directory is only accessible by Dragonfly as `readonly`. You change this behavior, by editing

under `/etc` directory because the folder is only accesible by Dragonfly as `readonly`. You change this behaviour, by editing
the systemd service file located in `/lib/systemd/system/dragonfly.service`.

For convenience, we suggest to place `acl` files in `/var/lib/dragonfly/`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For convenience, we suggest to place `acl` files in `/var/lib/dragonfly/`.
For convenience, we suggest to place acl files in `/var/lib/dragonfly/`.

of their permissions) are stored in a log. The size of the log can be configured by the option `--acllog_max_len`.
This flag, operates a little bit differently from Redis. Specifically, because Dragonfly uses a shared nothing thread per core architecture,
each thread of execution has its own log. Therefore, the total size of the log entries, is the flag number multiplied
by the available number of cores in the system. So for example, if you are running on a 4 core machine with `--acllog_max_len=8`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
by the available number of cores in the system. So for example, if you are running on a 4 core machine with `--acllog_max_len=8`
by the available number of Dragonfly threads. So for example, if you are running Dragonfly with 4 threads with `--acllog_max_len=8`

Copy link
Contributor

@Niennienzz Niennienzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more nitpicks, otherwise LGTM!

@@ -0,0 +1,128 @@
# Access Control Lists (ACL)

Dragonfly has built in support for ACL. Dragonfly operators get fine grained control on how and who accesses the datastore via the ACL family of commands.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Dragonfly has built in support for ACL. Dragonfly operators get fine grained control on how and who accesses the datastore via the ACL family of commands.
Dragonfly has built-in support for ACL. Dragonfly operators get fine-grained control over how and who accesses the datastore via the ACL family of commands.

# Access Control Lists (ACL)

Dragonfly has built in support for ACL. Dragonfly operators get fine grained control on how and who accesses the datastore via the ACL family of commands.
Since, Dragonfly is designed as a drop in replacement for Redis, you can expect the same API functionality for ACL as in Redis.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Since, Dragonfly is designed as a drop in replacement for Redis, you can expect the same API functionality for ACL as in Redis.
Since Dragonfly is designed as a drop-in replacement for Redis, you can expect the same API functionality for ACL as in Redis.

All connections in Dragofnly default to the user `default` (unless that user is disabled). By default, user `default` can `AUTH` in Dragonfly using any password,
and is allowed to execute any command and is part of all the available ACL groups.

Permissions for a given user are controlled via a domain specific language (DSP) and are divided into 4 categories:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Permissions for a given user are controlled via a domain specific language (DSP) and are divided into 4 categories:
Permissions for a given user are controlled via a domain-specific language (DSL) and are divided into 4 categories:

will abide by the user's specified permissions. Changing the `default` user's status to `OFF` or password, will require all incoming connections
to authenticate.

Note that, if the password is changed and a user has already `authenticated` then they don't need to re-authenticate until they reconnect.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note that, if the password is changed and a user has already `authenticated` then they don't need to re-authenticate until they reconnect.
Note that if the password is changed and a user has already `authenticated` then they don't need to re-authenticate until they reconnect.

then their connection is killed by the system. Furthermore, any change to a user's permission list with `ACL SETUSER` will propagate to the already
active and authenticated connections.

Also note, that the flag `--requirepass` also changes the `default` user password. So, if during Dragonfly startup the flag `requirepass` is set,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Also note, that the flag `--requirepass` also changes the `default` user password. So, if during Dragonfly startup the flag `requirepass` is set,
Also note that the flag `--requirepass` also changes the `default` user password. So, if during Dragonfly startup the flag `requirepass` is set,

@kostasrim kostasrim merged commit 710c372 into main Nov 17, 2023
1 of 2 checks passed
@kostasrim kostasrim deleted the acl_docs branch November 17, 2023 18:43
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.

add acl information in managing dragonfly
3 participants