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

Changed allowlist config to denylist ip config for datasource uri hosts #2042

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

vmmusings
Copy link
Member

@vmmusings vmmusings commented Aug 31, 2023

Description

  • Changed allowlist config to denylist of ips.
    plugins.query.datasources.uri.hosts.denylist is the new property.
  • Validating datasource URL in every interaction. So the datasource validation happens during datasource creation and datasource queries.

Current Process of Validation:

  • Before interacting with any customer provided URI, we do dns resolution and validate the ip against the denylist provided in the config.
  • The new config specifes denied IP CIDR blocks. For eg: 127.0.0.0/8

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 Aug 31, 2023

Codecov Report

Merging #2042 (59bc60d) into main (544cb91) will decrease coverage by 0.02%.
The diff coverage is 95.83%.

@@             Coverage Diff              @@
##               main    #2042      +/-   ##
============================================
- Coverage     97.28%   97.27%   -0.02%     
+ Complexity     4624     4623       -1     
============================================
  Files           409      410       +1     
  Lines         11943    11947       +4     
  Branches        828      828              
============================================
+ Hits          11619    11621       +2     
  Misses          317      317              
- Partials          7        9       +2     
Flag Coverage Δ
sql-engine 97.27% <95.83%> (-0.02%) ⬇️

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

Files Changed Coverage Δ
...l/datasources/utils/DatasourceValidationUtils.java 93.33% <93.33%> (ø)
...rch/sql/opensearch/setting/OpenSearchSettings.java 100.00% <100.00%> (ø)
...ch/sql/prometheus/client/PrometheusClientImpl.java 100.00% <100.00%> (ø)
...l/prometheus/storage/PrometheusStorageFactory.java 100.00% <100.00%> (ø)

📢 Have feedback on the report? Share it here.

@vmmusings vmmusings force-pushed the main branch 2 times, most recently from 6693567 to 729386d Compare September 6, 2023 00:57
common/build.gradle Outdated Show resolved Hide resolved
dai-chen
dai-chen previously approved these changes Sep 6, 2023
Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

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

Please fix the build failure. Thanks!

penghuo
penghuo previously approved these changes Sep 6, 2023
@vmmusings vmmusings dismissed stale reviews from dai-chen and penghuo via e30aec5 September 7, 2023 01:16
@vmmusings vmmusings force-pushed the main branch 4 times, most recently from c46b631 to 1c4f916 Compare September 7, 2023 20:04
@vmmusings vmmusings self-assigned this Sep 7, 2023
@vmmusings vmmusings force-pushed the main branch 2 times, most recently from fb22293 to 1158d43 Compare September 7, 2023 21:37
@vmmusings vmmusings merged commit 9082a46 into opensearch-project:main Sep 7, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 7, 2023
…ts (#2042)

Signed-off-by: Vamsi Manohar <[email protected]>
(cherry picked from commit 9082a46)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.10 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.10 2.10
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.10
# Create a new branch
git switch --create backport/backport-2042-to-2.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9082a468ec670b6e69c36f98456f01d11086421e
# Push it to GitHub
git push --set-upstream origin backport/backport-2042-to-2.10
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.10

Then, create a pull request where the base branch is 2.10 and the compare/head branch is backport/backport-2042-to-2.10.

vmmusings added a commit that referenced this pull request Sep 7, 2023
…ts (#2042)

Signed-off-by: Vamsi Manohar <[email protected]>
(cherry picked from commit 9082a46)
YANG-DB pushed a commit that referenced this pull request Sep 7, 2023
…ts (#2042) (#2059)

Signed-off-by: Vamsi Manohar <[email protected]>
(cherry picked from commit 9082a46)
vmmusings pushed a commit that referenced this pull request Sep 7, 2023
…ts (#2042) (#2058)

(cherry picked from commit 9082a46)

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants