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

Redact sensitive configuration values when retrieving security configuration #4024

Merged
merged 4 commits into from
Feb 8, 2024

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Feb 5, 2024

Description

Redacts the field password when calling GET /_plugins/_security/api/securityconfig.

Redacting the field through the API will also ensure that it doesn't get displayed on OSD. Note: This value would only be displayed to users with access to the security pages.

Screenshot 2024-02-05 at 3 27 34 PM
  • Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)

Enhancement

Issues Resolved

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Copy link

codecov bot commented Feb 5, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (6b9ded2) 65.61% compared to head (cf1fcd4) 65.64%.
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4024      +/-   ##
==========================================
+ Coverage   65.61%   65.64%   +0.03%     
==========================================
  Files         298      298              
  Lines       21247    21278      +31     
  Branches     3457     3460       +3     
==========================================
+ Hits        13941    13968      +27     
- Misses       5586     5588       +2     
- Partials     1720     1722       +2     
Files Coverage Δ
...arch/security/dlic/rest/api/AbstractApiAction.java 88.93% <100.00%> (+0.31%) ⬆️
...ecurityconf/impl/SecurityDynamicConfiguration.java 78.57% <33.33%> (-1.11%) ⬇️
...a/org/opensearch/security/DefaultObjectMapper.java 65.97% <71.42%> (+1.50%) ⬆️

... and 2 files with indirect coverage changes

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty for adding this feature @cwperks. Could you please look into code-cov comments to see if anyone of those can be covered via more tests?

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cwperks cwperks added the backport 2.x backport to 2.x branch label Feb 6, 2024
@willyborankin willyborankin merged commit a41b3f7 into opensearch-project:main Feb 8, 2024
83 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 8, 2024
…uration (#4024)

### Description

Redacts the field `password` when calling `GET
/_plugins/_security/api/securityconfig`.

Redacting the field through the API will also ensure that it doesn't get
displayed on OSD. **Note**: This value would only be displayed to users
with access to the security pages.

<img width="471" alt="Screenshot 2024-02-05 at 3 27 34 PM"
src="https://github.com/opensearch-project/security/assets/17432265/7cd93f70-9eb9-4ac2-859c-00a7bfb56718">

* Category (Enhancement, New feature, Bug fix, Test fix, Refactoring,
Maintenance, Documentation)

Enhancement

### Issues Resolved

- #4004

### Check List
- [ ] New functionality includes testing
- [ ] New functionality has been documented
- [ ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
(cherry picked from commit a41b3f7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
willyborankin pushed a commit that referenced this pull request Feb 8, 2024
…security configuration (#4028)

Backport a41b3f7 from #4024.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dlin2028 pushed a commit to dlin2028/security that referenced this pull request May 1, 2024
…uration (opensearch-project#4024)

### Description

Redacts the field `password` when calling `GET
/_plugins/_security/api/securityconfig`.

Redacting the field through the API will also ensure that it doesn't get
displayed on OSD. **Note**: This value would only be displayed to users
with access to the security pages.

 
<img width="471" alt="Screenshot 2024-02-05 at 3 27 34 PM"
src="https://github.com/opensearch-project/security/assets/17432265/7cd93f70-9eb9-4ac2-859c-00a7bfb56718">


* Category (Enhancement, New feature, Bug fix, Test fix, Refactoring,
Maintenance, Documentation)

Enhancement

### Issues Resolved

- opensearch-project#4004

### Check List
- [ ] New functionality includes testing
- [ ] New functionality has been documented
- [ ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants