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

Add read-only security_policy to block admin HTTP endpoints. #5321

Merged
merged 1 commit into from
Oct 19, 2019

Conversation

enisoc
Copy link
Member

@enisoc enisoc commented Oct 17, 2019

Previously, the only built-in policies available were effectively
"allow all" and "deny all". Anything else required writing a custom
plugin.

This adds a new built-in policy called read-only that does NOT do any
authentication, but allows anyone to query HTTP endpoints designated as
requiring the DEBUGGING or MONITORING roles, while denying everyone
access to ADMIN endpoints.

The default when no policy is specified remains "allow all".
The fallback policy remains "deny all" when an unknown, non-empty
policy name is requested. In addition, you can now explicitly request
the deny-all policy without having to engage fallback by providing an
invalid policy name.

Note that security_policy only applies to HTTP endpoints. It does NOT
affect gRPC calls, nor SQL queries. Also, the security_policy flag
must be set individually on every process (e.g. vttablet, vtgate, vtctld)
and only applies to endpoints served directly by that one process.

Signed-off-by: Anthony Yeh enisoc@planetscale.com

@enisoc enisoc requested a review from sougou October 17, 2019 17:47
@sougou
Copy link
Contributor

sougou commented Oct 17, 2019

can you undo the go.* changes? @deepthi suggests go mod tidy. I just use git checkout go.mod.

@enisoc
Copy link
Member Author

enisoc commented Oct 17, 2019

This is already the result after go mod tidy.

@enisoc
Copy link
Member Author

enisoc commented Oct 17, 2019

I reverted back to the go.{mod,sum} in master, and then checked in only the result after make build, without running go mod tidy. It seems our checked-in state on master is untidy, so using tidy results in changes. We'll keep going back and forth unless we can get all committers to agree on either always running tidy, or never.

Previously, the only built-in policies available were effectively
"allow all" and "deny all". Anything else required writing a custom
plugin.

This adds a new built-in policy called `read-only` that does NOT do any
authentication, but allows anyone to query HTTP endpoints designated as
requiring the DEBUGGING or MONITORING roles, while denying everyone
access to ADMIN endpoints.

The default when no policy is specified remains "allow all".
The fallback policy remains "deny all" when an unknown, non-empty
policy name is requested. In addition, you can now explicitly request
the `deny-all` policy without having to engage fallback by providing an
invalid policy name.

Note that security_policy only applies to HTTP endpoints. It does NOT
affect gRPC calls, nor SQL queries. Also, the security_policy flag
must be set individually on every process (e.g. vttablet, vtgate, vtctld)
and only applies to endpoints served directly by that one process.

Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
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.

2 participants