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

Removed Domain Validation #2130

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

vmmusings
Copy link
Member

@vmmusings vmmusings commented Sep 22, 2023

Description

  • Currently in datasource uri validation, we validate domain which is excessively restrictive and hampering ease of use in case of docker and using ips in prometheus URL. This PR addresses this problem by removing the restriction.

  • We can always avoid ssrf issue by specifying the host denylist plugins.query.datasources.uri.hosts.denylist

Manual Testing

curl --location 'localhost:9200/_plugins/_query/_datasources/' \
--header 'Content-Type: application/json' \
--data '{
  "name": "my_prometheus3",
  "connector": "PROMETHEUS",
  "allowedRoles": [],
  "properties": {
    "prometheus.uri": "http://10.0.0.1:9090"
  }
}'

This call worked which used to not function earlier.

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • 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.

@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Merging #2130 (12ff4ae) into main (61d1eb7) will increase coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #2130      +/-   ##
============================================
+ Coverage     97.27%   97.28%   +0.01%     
+ Complexity     4623     4621       -2     
============================================
  Files           410      410              
  Lines         11947    11938       -9     
  Branches        828      824       -4     
============================================
- Hits          11621    11614       -7     
  Misses          317      317              
+ Partials          9        7       -2     
Flag Coverage Δ
sql-engine 97.28% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...l/datasources/utils/DatasourceValidationUtils.java 100.00% <ø> (+6.66%) ⬆️

YANG-DB
YANG-DB previously approved these changes Sep 22, 2023
@anirudha
Copy link
Collaborator

Thanks

anirudha
anirudha previously approved these changes Sep 22, 2023
Signed-off-by: Vamsi Manohar <[email protected]>
@vmmusings vmmusings merged commit fe80b5c into opensearch-project:main Sep 22, 2023
18 of 21 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 22, 2023
Signed-off-by: Vamsi Manohar <[email protected]>
(cherry picked from commit fe80b5c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
pjfitzgibbons pushed a commit that referenced this pull request Sep 22, 2023
(cherry picked from commit fe80b5c)

Signed-off-by: Vamsi Manohar <[email protected]>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Prometheus connector does not accept ips as host name
5 participants