Skip to content

Fix deprecation of audit log settings#36175

Merged
albertzaharovits merged 3 commits intoelastic:6.xfrom
albertzaharovits:fix_deprecation_audit_log
Dec 3, 2018
Merged

Fix deprecation of audit log settings#36175
albertzaharovits merged 3 commits intoelastic:6.xfrom
albertzaharovits:fix_deprecation_audit_log

Conversation

@albertzaharovits
Copy link
Copy Markdown
Contributor

@albertzaharovits albertzaharovits commented Dec 3, 2018

I have botched deprecating the "prefix" logfile audit settings in #34475 , by not registering them.

This commit fixes this, and adds a test that these deprecated settings still work and are dynamic.

Closes #36162

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-security

Copy link
Copy Markdown
Member

@jaymode jaymode left a comment

Choose a reason for hiding this comment

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

I left a couple of small comments. Otherwise LGTM

settingsBuilder.put("xpack.security.audit.outputs", "logfile");
// add only startup filter policies
settingsBuilder.put(startupFilterSettings);
// we cannot test deprecated variants of these settings because they are overriden
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this comment is confusing. Maybe say "Remove non-deprecated version of prefix settings so that we can test the deprecated variant" ?

updateSettings(settingsBuilder.build(), persistent);
assertThat(loggingAuditTrail.entryCommonFields.commonFields.containsKey(LoggingAuditTrail.NODE_NAME_FIELD_NAME), is(false));
assertThat(loggingAuditTrail.entryCommonFields.commonFields.containsKey(LoggingAuditTrail.HOST_ADDRESS_FIELD_NAME), is(false));
assertThat(loggingAuditTrail.entryCommonFields.commonFields.containsKey(LoggingAuditTrail.HOST_NAME_FIELD_NAME), is(false));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just to be a bit paranoid, can you set them back to true and verify?

@albertzaharovits albertzaharovits merged commit 4e0a403 into elastic:6.x Dec 3, 2018
albertzaharovits added a commit that referenced this pull request Dec 4, 2018
I have botched deprecating the "prefix" logfile audit settings
in #34475 , by not registering them.
This commit fixes it and also adds a test that these deprecated
settings are indeed still working and are dynamic.

Closes #36162
@albertzaharovits albertzaharovits deleted the fix_deprecation_audit_log branch December 4, 2018 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants