Skip to content

Commit 7dd8fe7

Browse files
author
BigPandaToo
committed
To avoid ambiguity (as cluster and index policies may have the same
name) changing implementation to have to separate policies for `index_privileges` and `cluster_privileges`. If both are set for the same policy, throw the IllegalArgumentException.
1 parent cb5bc09 commit 7dd8fe7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/audit/logfile/AuditTrailSettingsUpdateTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void testInvalidFilterSettings() throws Exception {
9696
"xpack.security.audit.logfile.events.ignore_filters.invalid.realms",
9797
"xpack.security.audit.logfile.events.ignore_filters.invalid.roles",
9898
"xpack.security.audit.logfile.events.ignore_filters.invalid.indices",
99-
"xpack.security.audit.logfile.events.ignore_filters.invalid.privileges"};
99+
"xpack.security.audit.logfile.events.ignore_filters.invalid.index_privileges"};
100100
settingsBuilder.put(randomFrom(allSettingsKeys), invalidLuceneRegex);
101101
final IllegalArgumentException e = expectThrows(IllegalArgumentException.class,
102102
() -> client().admin().cluster().prepareUpdateSettings().setTransientSettings(settingsBuilder.build()).get());
@@ -226,7 +226,7 @@ private static Settings randomFilterPolicySettings(String policyName) {
226226
if (randomBoolean()) {
227227
// filter by privileges
228228
final List<String> filteredPrivileges = randomNonEmptyListOfFilteredNames();
229-
settingsBuilder.putList("xpack.security.audit.logfile.events.ignore_filters." + policyName + ".privileges",
229+
settingsBuilder.putList("xpack.security.audit.logfile.events.ignore_filters." + policyName + ".index_privileges",
230230
filteredPrivileges);
231231
}
232232
} while (settingsBuilder.build().isEmpty());

0 commit comments

Comments
 (0)