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

bypass IPs not in AllowedIPs #1

Merged
merged 2 commits into from
Aug 7, 2018
Merged

bypass IPs not in AllowedIPs #1

merged 2 commits into from
Aug 7, 2018

Conversation

SteamedFish
Copy link

Most proxy protocol implementions, such as MariaDB and Percona Server
forces IP in AllowedIPs to use proxy protocol, and forces IP not in
AllowdIPs to not use proxy protocol. They still accept IPs not in
AllowdIPs to connect. They just won't parse proxy protocol header.

I think that's a more user friendly way.

I have read proxy protocol spec:

The receiver SHOULD ensure proper access filtering so that only
trusted proxyies are allowd to use this protocol.

We meet the spec requirement because we do not allow untrusted proxyies
to use proxy protocol. They are forced to use normal protocol.

Most proxy protocol implementions, such as MariaDB and Percona Server
forces IP in AllowedIPs to use proxy protocol, and forces IP not in
AllowdIPs to not use proxy protocol. They still accept IPs not in
AllowdIPs to connect. They just won't parse proxy protocol header.

I think that's a more user friendly way.

I have read proxy protocol spec:

> The receiver SHOULD ensure proper access filtering so that only
> trusted proxyies are allowd to use this protocol.

We meet the spec requirement because we do not allow untrusted proxyies
to use proxy protocol. They are forced to use normal protocol.
@blacktear23
Copy link
Owner

@SteamedFish before I create this repo, I just integrated proxyprotocol into TiDB, and the first implements is act as your PR. But this design is not allowed by TiDB community, because community want to follow proxyprotocol's spec. So I think you should create a Issue at TiDB and discuss with community members.

@coocood
Copy link

coocood commented Aug 7, 2018

How about making checkAllowed function overridable?

@blacktear23
Copy link
Owner

@SteamedFish I see the comments in this feature's PR, and I think we can merge this PR. @coocood are you agreed?

@coocood
Copy link

coocood commented Aug 7, 2018

@blacktear23
Yes, we misunderstood the spec before.

@blacktear23 blacktear23 merged commit af7a81e into blacktear23:master Aug 7, 2018
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.

3 participants