opensearch-project / security

🔐 Secure your cluster with TLS, numerous authentication backends, data masking, audit logging as well as role-based access control on indices, documents, and fields
https://opensearch.org/docs/latest/security-plugin/index/
Apache License 2.0
189 stars 272 forks source link

[RFC] Support for API Keys in OpenSearch Security Plugin #4009

Open cwperks opened 7 months ago

cwperks commented 7 months ago

Introduction

This proposal seeks to introduce API Key authentication as a feature within the OpenSearch Security Plugin, responding to significant community demand as evidenced by the number of thumbs up reactions on #1504. This feature aims to enhance security and usability for OpenSearch users by providing a more flexible and secure method of authentication for various use cases, including scheduled jobs.

Background

The OpenSearch Security Plugin currently supports a variety of authentication methods including HTTP Basic Authentication, JWT, SAML, OpenID Connect and others. However, the lack of API Key support limits the flexibility and ease of use for developers and administrators, particularly in scenarios involving automated processes or services that require access to the OpenSearch cluster without human intervention.

API Keys are a widely adopted method for service-to-service authentication, offering a secure and convenient way to grant access to APIs without exposing user credentials. They are particularly useful for scheduled jobs, where a job needs to authenticate with OpenSearch to perform operations in a known context.

Proposal

We propose the addition of an API Key authentication mechanism to the OpenSearch Security Plugin with the following features:

1. API Key Generation

2. API Key Storage

3. API Key Usage

4. API Key Revocation

5. UX Component

6. Scheduled Jobs Support

Security Considerations

Conclusion

The introduction of API Key support in the OpenSearch Security Plugin will significantly enhance the security and usability of OpenSearch, particularly for automated processes and services. This feature will provide a flexible, secure, and user-friendly method of authentication, aligning with modern security practices and meeting the needs of the OpenSearch community.

We invite comments, suggestions, and contributions from the community to refine and implement this proposal.

cwperks commented 7 months ago

1. UX for Listing API Keys for a User

Page Layout:

Table Columns:

Functionality:

2. UX for Revoking an API Key

Modal Dialog:

Functionality:

3. UX for Generating an API Key

Page/Modal Layout:

Functionality:

stephen-crawford commented 7 months ago

[Triage] Hi @cwperks thank you for creating this very detailed RFC. Hopefully we can get some community input for this and move forward from there.

merlinz01 commented 4 months ago

This RFC looks great as far as I'm concerned; I would be happy to see it implemented.

I noticed on this issue that the author says "API Keys are not generally considered secure". What is the rationale for considering them less secure than username/password authentication?