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

API Key auth #34877

Closed
zhaohuabing opened this issue Jun 25, 2024 · 13 comments · Fixed by #36968
Closed

API Key auth #34877

zhaohuabing opened this issue Jun 25, 2024 · 13 comments · Fixed by #36968
Assignees
Labels
enhancement Feature requests. Not bugs or questions. help wanted Needs help!

Comments

@zhaohuabing
Copy link
Member

zhaohuabing commented Jun 25, 2024

Title: API Key auth

Description:
An HTTP filter to support API Key auth. The API key authentication filter can be used to authorize HTTP requests using the provided API key in the request. API keys are a simple and widely used method in web services to ensure that only authorized applications and users can interact with the API. It would be beneficial if Envoy could support this feature.

An API key is a token that a client provides when making API calls. The key can be sent in the query string:

GET /something?api_key=abcdef12345

or as a request header:

GET /something HTTP/1.1
X-API-Key: abcdef12345

or as a cookie:

GET /something HTTP/1.1
Cookie: X-API-KEY=abcdef12345

[optional Relevant Links:]

https://swagger.io/docs/specification/authentication/api-keys/
envoyproxy/gateway#2630

@zhaohuabing zhaohuabing added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Jun 25, 2024
@mattklein123 mattklein123 added question Questions that are neither investigations, bugs, nor enhancements and removed enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Jun 25, 2024
@mattklein123
Copy link
Member

What exactly do you want this filter to do?

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Jul 25, 2024
@zhaohuabing
Copy link
Member Author

zhaohuabing commented Jul 26, 2024

What exactly do you want this filter to do?

Hi @mattklein123 Thanks for looking into this issue and sorry for my delayed response.

The API key authentication filter can be used to authorize HTTP requests using the provided API key in the request. API keys are a simple and widely used method in web services to ensure that only authorized applications and users can interact with the API. It would be beneficial if Envoy could support this feature. There are also some users asking for this feature in envoy gateway. envoyproxy/gateway#2630

@github-actions github-actions bot removed the stale stalebot believes this issue/PR has not been touched recently label Jul 26, 2024
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Aug 25, 2024
Copy link

github-actions bot commented Sep 1, 2024

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2024
@sanposhiho
Copy link
Contributor

Hi 👋
I'm coming from envoyproxy/gateway#2630, interested in realizing it.
Actually I'm researching other competing gateways, and actually Key auth functionality is one of the gaps that some other implementations implement, while the envoy doesn't. So, I believe it's worthy enough.

I can take an implementer part, would any maintainer be willing to help in reviewing etc to promote it?

@gecube
Copy link

gecube commented Sep 26, 2024

It is very pity that we don’t have reliable and out-of-box way to use api keys in envoy proxy.

@arkodg
Copy link
Contributor

arkodg commented Oct 2, 2024

although API Key Auth is not the most secure or the most performant way to do authn & authz, its still used in existing brownfield environments and also as an additional auth mechanism like the one outlined here, so having support for it would unblock migration to envoy proxy.
Here are the requirements that necessitates a new filter instead of reusing an existing one like the RBAC filter

@gecube
Copy link

gecube commented Oct 3, 2024

Agree, that it is essential functionality.

@wbpcode wbpcode reopened this Oct 10, 2024
@wbpcode wbpcode added enhancement Feature requests. Not bugs or questions. help wanted Needs help! and removed stale stalebot believes this issue/PR has not been touched recently question Questions that are neither investigations, bugs, nor enhancements labels Oct 10, 2024
@wbpcode
Copy link
Member

wbpcode commented Oct 10, 2024

I agree this is essential functionality. I can help with the review if someone want to contribute.

@sanposhiho
Copy link
Contributor

Thanks @wbpcode! I'll ping you when I create the PR.

@sanposhiho
Copy link
Contributor

/assign

Copy link

sanposhiho is not allowed to assign users.

🐱

Caused by: a #34877 (comment) was created by @sanposhiho.

see: more, trace.

wbpcode added a commit that referenced this issue Nov 1, 2024
<!--
!!!ATTENTION!!!

If you are fixing *any* crash or *any* potential security issue, *do
not*
open a pull request in this repo. Please report the issue via emailing
[email protected] where the issue will be triaged
appropriately.
Thank you in advance for helping to keep Envoy secure.

!!!ATTENTION!!!

For an explanation of how to fill out the fields, please see the
relevant section
in
[PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md)
-->

This PR adds the API for HTTP APIKey Auth Filter that is proposed at
#34877 and
envoyproxy/gateway#2630.

Commit Message: api: HTTP APIKey Auth Filter
Risk Level: Low (only API)
Testing: WIP (will be done after we agree on the API)
Docs Changes: WIP
Release Notes: WIP
Platform Specific Features: No
Part of: #34877

---------

Signed-off-by: Kensei Nakada <[email protected]>
Signed-off-by: wangbaiping(wbpcode) <[email protected]>
Co-authored-by: wangbaiping(wbpcode) <[email protected]>
update-envoy bot added a commit to envoyproxy/data-plane-api that referenced this issue Nov 1, 2024
<!--
!!!ATTENTION!!!

If you are fixing *any* crash or *any* potential security issue, *do
not*
open a pull request in this repo. Please report the issue via emailing
[email protected] where the issue will be triaged
appropriately.
Thank you in advance for helping to keep Envoy secure.

!!!ATTENTION!!!

For an explanation of how to fill out the fields, please see the
relevant section
in
[PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md)
-->

This PR adds the API for HTTP APIKey Auth Filter that is proposed at
envoyproxy/envoy#34877 and
envoyproxy/gateway#2630.

Commit Message: api: HTTP APIKey Auth Filter
Risk Level: Low (only API)
Testing: WIP (will be done after we agree on the API)
Docs Changes: WIP
Release Notes: WIP
Platform Specific Features: No
Part of: #34877

---------

Signed-off-by: Kensei Nakada <[email protected]>
Signed-off-by: wangbaiping(wbpcode) <[email protected]>
Co-authored-by: wangbaiping(wbpcode) <[email protected]>

Mirrored from https://github.com/envoyproxy/envoy @ 72b75074a0ee089ad81f68ae011e31f14c2936fe
wbpcode added a commit that referenced this issue Dec 10, 2024
Commit Message: auth: new api auth implementation
Additional Description:

To close #34877

Risk Level: low. New extension.
Testing: unit, integration.
Docs Changes: added.
Release Notes: added.
Platform Specific Features: n/a.

---------

Signed-off-by: wangbaiping/wbpcode <[email protected]>
Signed-off-by: wangbaiping(wbpcode) <[email protected]>
Signed-off-by: code <[email protected]>
Co-authored-by: Adi (Suissa) Peleg <[email protected]>
Co-authored-by: yanavlasov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests. Not bugs or questions. help wanted Needs help!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants