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

Disable AllowAnonymousStreamAccess and AllowAnonymousEndpointAccess by default (DB-276) #3905

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,29 @@ Due to security reasons the DefaultAdminPassword and DefaultOpsPassword options

Historically, anonymous users with network access have been allowed to read/write streams that do not have access control lists.

This anonymous access to streams can be disabled, and in the future will likely be disabled by default.
This is now disabled by default but can be enabled with this setting.

| Format | Syntax |
|:---------------------|:-------------------------------------------|
| Command line | `--allow-anonymous-stream-access` |
| YAML | `AllowAnonymousStreamAccess` |
| Environment variable | `EVENTSTORE_ALLOW_ANONYMOUS_STREAM_ACCESS` |

**Default**: `true`
**Default**: `false`

Similarly to streams above, anonymous access has historically been available to the `/stats` and `/gossip` endpoints, and the `HTTP OPTIONS` method.

This can be disabled with the following option. Anonymous access will still be granted to `/ping`, `/info`, the static content of the UI, and http redirects
This is now disabled by default but can be enabled with this setting.

For this to work, you can disable the `AllowAnonymousEndpointAccess` option:
Anonymous access is still always granted to `/ping`, `/info`, the static content of the UI, and http redirects.

| Format | Syntax |
|:---------------------|:---------------------------------------------|
| Command line | `--allow-anonymous-endpoint-access` |
| YAML | `AllowAnonymousEndpointAccess` |
| Environment variable | `EVENTSTORE_ALLOW_ANONYMOUS_ENDPOINT_ACCESS` |

**Default**: `true`
**Default**: `false`

### Certificates configuration

Expand Down
2 changes: 2 additions & 0 deletions src/EventStore.Core.Tests/Helpers/MiniClusterNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public class MiniClusterNode<TLogFormat, TStreamId> {

var options = new ClusterVNodeOptions {
Application = new() {
AllowAnonymousEndpointAccess = true,
AllowAnonymousStreamAccess = true,
Insecure = !useHttps,
WorkerThreads = 1,
StatsPeriodSec = (int)TimeSpan.FromHours(1).TotalSeconds
Expand Down
2 changes: 2 additions & 0 deletions src/EventStore.Core.Tests/Helpers/MiniNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public class MiniNode<TLogFormat, TStreamId> : MiniNode {
var options = new ClusterVNodeOptions {
IndexBitnessVersion = indexBitnessVersion,
Application = new() {
AllowAnonymousEndpointAccess = true,
AllowAnonymousStreamAccess = true,
StatsPeriodSec = 60 * 60,
WorkerThreads = 1
},
Expand Down
4 changes: 2 additions & 2 deletions src/EventStore.Core/ClusterVNodeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ public record ApplicationOptions {
public bool Insecure { get; init; } = false;

[Description("Allow anonymous access to HTTP API endpoints.")]
public bool AllowAnonymousEndpointAccess { get; init; } = true;
public bool AllowAnonymousEndpointAccess { get; init; } = false;

[Description("Allow anonymous access to streams.")]
public bool AllowAnonymousStreamAccess { get; init; } = true;
public bool AllowAnonymousStreamAccess { get; init; } = false;

internal static ApplicationOptions FromConfiguration(IConfigurationRoot configurationRoot) => new() {
Config = configurationRoot.GetValue<string>(nameof(Config)),
Expand Down
Loading