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

Decrease default capabilities #4216

Closed
wants to merge 4 commits into from
Closed

Conversation

gguillemas
Copy link
Contributor

@gguillemas gguillemas commented Jun 18, 2024

Thank you for submitting this pull request! We really appreciate you spending the time to work on these changes.

What is the motivation?

To decrease default capabilities, more specifically by dropping the capability to run non-scripting functions by default. The capability to run functions may extend the attack surface of SurrealDB to additional third-party libraries that are used to implement the functions as well as allow users to perform actions that should only be allowed as a result of a conscious decision by the SurrealDB owner, specially when other capabilities such as networking are enabled.

For example, by default, if the networking capability is enabled without any exceptions, an attacker may use the http functions to perform requests over the private network in order to achieve lateral movement or privilege escalation using internal network interfaces such as the Docker API, the Kubernetes API or internal cloud endpoints.

This change encourages users to enable the specific functions that their service or application requires instead of relying on a default that enables all functions. Users that require all functions can still decide to enable them.

What does this change do?

Updates the default() setting for both CoreCapabilities and the public Capabilities interface to not include functions. Creates a new none() setting in CoreCapabilities which does not include any capability. Updates the public Capabilities interface to use none() from CoreCapabilities.

What is your testing strategy?

Ensure that existing tests continue passing.

Is this related to any issues?

Addresses some issues raised on #4173.

Does this change need documentation?

No. This behavior was actually already the documented behavior.

Have you read the Contributing Guidelines?

@gguillemas gguillemas closed this Jun 18, 2024
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.

None yet

1 participant