Log default compliance salt warning once at startup#6253
Conversation
PR Reviewer Guide 🔍(Review updated until commit 37a34ca)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 37a34ca Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit fecf36a
Suggestions up to commit 60bbd2c
Suggestions up to commit f2c09bb
|
Only validate compliance salt after roles reload when masked_fields are configured, instead of warning on every Salt construction at startup. Fixes opensearch-project#6105 Signed-off-by: MdTanwer <tanw9004167@gmail.com>
f2c09bb to
60bbd2c
Compare
|
Persistent review updated to latest commit 60bbd2c |
|
@MdTanwer IMO This warning should always be logged if this salt is unconfigured even if any roles at bootstrap don't have masking. In fact, in the next major version I'd like to fail bootstrap if its unconfigured unless |
Move the default-salt warning out of Salt construction and log it once during plugin startup. Keeps unconditional warning per maintainer direction and leaves 4.0 bootstrap enforcement as a TODO. Fixes opensearch-project#6105 Signed-off-by: MdTanwer <tanw9004167@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
@cwperks Thanks for the feedback — I've revised the PR accordingly.
This keeps the always-warn behavior . Please let me know if this looks good. |
|
Persistent review updated to latest commit fecf36a |
|
Persistent review updated to latest commit 37a34ca |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6253 +/- ##
==========================================
+ Coverage 75.02% 75.09% +0.06%
==========================================
Files 451 451
Lines 29275 29279 +4
Branches 4416 4417 +1
==========================================
+ Hits 21964 21986 +22
+ Misses 5274 5257 -17
+ Partials 2037 2036 -1
🚀 New features to boost your workflow:
|
Summary
Salt.warnIfDefaultComplianceSalt(), instead of on everySaltconstruction (which produced duplicate WARN lines on startup).masked_fieldsat bootstrap.Saltconstructor so repeatedSalt.from()calls stay silent.Salt.validateSaltSettings()) as a TODO, gated onplugins.security.allow_unsafe_democertificates.Fixes #6105 (duplicate/noisy startup warnings; does not suppress the warning entirely when FLS is unused).
Test plan
./gradlew test --tests "org.opensearch.security.configuration.SaltTest"./gradlew spotlessJavaCheckplugins.security.compliance.salt— single WARN at startup (not repeated)