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

Implement confidential statement #4910

Merged
merged 2 commits into from
Feb 17, 2025
Merged

Implement confidential statement #4910

merged 2 commits into from
Feb 17, 2025

Conversation

acquamarin
Copy link
Collaborator

@acquamarin acquamarin commented Feb 14, 2025

This PR introduces the confidential statement.
A statement is considered as confidential if it contains user's secrets (password, key).
Shell is not going to record those statements;

Fixes #4891

auto isSuccess = queryResult->isSuccess();
queryResults.push_back(std::move(queryResult));
if (isSuccess && !database->getConfig().readOnly) {
auto clientContext = conn->getClientContext();
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks fine to me. @ray6080 can u take a second look?

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm I'm concerned about this approach because it introduces an additional binding step to every write query, which I don't think the overhead is insignificant. Need to think a bit on what's an alternative way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The additional binding only occurs in the shell and it should only take a few milliseconds. I don't think CLI users care about this little time.

Copy link
Contributor

@ray6080 ray6080 Feb 16, 2025

Choose a reason for hiding this comment

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

But I think we can limit this to a smaller set? At least we can limit this to call functions only, which you can check QuerySummary::preparedSummary.
Open for discussion here, if it is possible to introduce a new statement type for credential related queries. so this can be avoided at all (we just need to check the statement type), and easily extended to other kinds of queries in the future too.

@acquamarin acquamarin force-pushed the confidential-statement branch from 2947521 to fec6e29 Compare February 17, 2025 03:28
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.

Project coverage is 86.58%. Comparing base (ff20ff3) to head (fec6e29).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/main/query_summary.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4910      +/-   ##
==========================================
+ Coverage   86.56%   86.58%   +0.01%     
==========================================
  Files        1406     1409       +3     
  Lines       60831    60859      +28     
  Branches     7483     7483              
==========================================
+ Hits        52661    52696      +35     
+ Misses       8001     7994       -7     
  Partials      169      169              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Benchmark Result

Master commit hash: ff20ff3ac9921dff1e70d1cd8a2e1d927edd3d3c
Branch commit hash: c9c693086b61eda6806de3154843b2a7fbdfc48e

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 723.75 726.52 -2.76 (-0.38%)
aggregation q28 6369.18 6373.14 -3.96 (-0.06%)
filter q14 127.05 128.77 -1.72 (-1.34%)
filter q15 130.40 123.36 7.04 (5.71%)
filter q16 309.39 300.18 9.22 (3.07%)
filter q17 448.69 445.43 3.26 (0.73%)
filter q18 1929.01 1925.34 3.67 (0.19%)
filter zonemap-node 88.65 88.45 0.20 (0.23%)
filter zonemap-node-lhs-cast 89.55 89.11 0.44 (0.49%)
filter zonemap-node-null 90.40 88.95 1.45 (1.63%)
filter zonemap-rel 5526.33 5580.08 -53.76 (-0.96%)
fixed_size_expr_evaluator q07 573.87 571.80 2.07 (0.36%)
fixed_size_expr_evaluator q08 804.13 803.46 0.67 (0.08%)
fixed_size_expr_evaluator q09 803.30 802.04 1.26 (0.16%)
fixed_size_expr_evaluator q10 242.28 236.71 5.57 (2.35%)
fixed_size_expr_evaluator q11 231.48 229.52 1.96 (0.85%)
fixed_size_expr_evaluator q12 225.83 226.86 -1.04 (-0.46%)
fixed_size_expr_evaluator q13 1457.48 1454.71 2.77 (0.19%)
fixed_size_seq_scan q23 111.27 108.40 2.87 (2.65%)
join q29 716.24 680.64 35.60 (5.23%)
join q30 10081.31 9822.19 259.12 (2.64%)
join q31 6.67 5.01 1.66 (33.25%)
join SelectiveTwoHopJoin 57.11 55.42 1.69 (3.05%)
ldbc_snb_ic q35 2619.00 2620.67 -1.67 (-0.06%)
ldbc_snb_ic q36 458.02 471.89 -13.87 (-2.94%)
ldbc_snb_is q32 3.93 5.70 -1.77 (-31.00%)
ldbc_snb_is q33 16.30 15.05 1.26 (8.35%)
ldbc_snb_is q34 1.26 1.12 0.14 (12.10%)
multi-rel multi-rel-large-scan 1450.27 1369.92 80.35 (5.87%)
multi-rel multi-rel-lookup 23.91 29.15 -5.24 (-17.97%)
multi-rel multi-rel-small-scan 54.29 61.28 -6.99 (-11.40%)
order_by q25 130.53 130.37 0.17 (0.13%)
order_by q26 455.27 454.82 0.46 (0.10%)
order_by q27 1411.95 1416.65 -4.71 (-0.33%)
recursive_join recursive-join-bidirection 303.58 323.29 -19.71 (-6.10%)
recursive_join recursive-join-dense 5456.50 7066.95 -1610.44 (-22.79%)
recursive_join recursive-join-path 23183.85 23616.92 -433.07 (-1.83%)
recursive_join recursive-join-sparse 1058.80 1060.85 -2.04 (-0.19%)
recursive_join recursive-join-trail 5725.47 7025.93 -1300.46 (-18.51%)
scan_after_filter q01 172.03 172.77 -0.74 (-0.43%)
scan_after_filter q02 160.87 169.48 -8.61 (-5.08%)
shortest_path_ldbc100 q37 91.17 86.77 4.41 (5.08%)
shortest_path_ldbc100 q38 391.12 370.80 20.32 (5.48%)
shortest_path_ldbc100 q39 61.43 64.88 -3.45 (-5.32%)
shortest_path_ldbc100 q40 433.28 419.56 13.72 (3.27%)
var_size_expr_evaluator q03 2095.49 2078.86 16.63 (0.80%)
var_size_expr_evaluator q04 2221.12 2206.24 14.88 (0.67%)
var_size_expr_evaluator q05 2672.03 2648.73 23.30 (0.88%)
var_size_expr_evaluator q06 1354.55 1343.47 11.08 (0.82%)
var_size_seq_scan q19 1460.07 1456.43 3.64 (0.25%)
var_size_seq_scan q20 2411.07 2432.76 -21.69 (-0.89%)
var_size_seq_scan q21 2305.41 2281.12 24.29 (1.06%)
var_size_seq_scan q22 128.54 126.34 2.19 (1.73%)

@acquamarin acquamarin merged commit c4a5e54 into master Feb 17, 2025
25 checks passed
@acquamarin acquamarin deleted the confidential-statement branch February 17, 2025 18:29
acquamarin added a commit that referenced this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid recording confidential information in shell history
3 participants