Skip to content

Commit

Permalink
Change legacy audit logger deprecation warning
Browse files Browse the repository at this point in the history
This is currently showing as a "Critical" issue in the upgrade
assistant. However, we have decided not to remove the legacy audit
logger in the 8.0 release. So I am leaving this deprecated in the docs
"for an upcoming version", but removing the deprecation warning in the
config, since we cannot currently mark this as a non-critical issue.
  • Loading branch information
jportner committed Aug 30, 2021
1 parent efdc7d5 commit 8aa7b32
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 83 deletions.
2 changes: 1 addition & 1 deletion docs/settings/security-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ xpack.security.audit.appender.type: rolling-file

[NOTE]
============
deprecated:[7.15.0,"In 8.0 and later, the legacy audit logger will be removed, and this setting will enable the ECS audit logger with a default appender."] To enable the legacy audit logger only specify:
deprecated:[7.15.0,"The legacy audit logger will be removed in an upcoming version, and this setting will enable the ECS audit logger with a default appender."] To enable the legacy audit logger only specify:
[source,yaml]
----------------------------------------
Expand Down
65 changes: 0 additions & 65 deletions x-pack/plugins/security/server/config_deprecations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,71 +205,6 @@ describe('Config Deprecations', () => {
`);
});

it('warns when using the legacy audit logger', () => {
const config = {
xpack: {
security: {
session: { idleTimeout: 123, lifespan: 345 },
audit: {
enabled: true,
},
},
},
};
const { messages, migrated } = applyConfigDeprecations(cloneDeep(config));
expect(migrated.xpack.security.audit.appender).not.toBeDefined();
expect(messages).toMatchInlineSnapshot(`
Array [
"The legacy audit logger is deprecated in favor of the new ECS-compliant audit logger.",
]
`);
});

it('does not warn when using the ECS audit logger', () => {
const config = {
xpack: {
security: {
session: { idleTimeout: 123, lifespan: 345 },
audit: {
enabled: true,
appender: {
type: 'file',
fileName: './audit.log',
},
},
},
},
};
const { messages, migrated } = applyConfigDeprecations(cloneDeep(config));
expect(migrated).toEqual(config);
expect(messages).toHaveLength(0);
});

it('does not warn about using the legacy logger when using the ECS audit logger, even when using the deprecated ECS appender config', () => {
const config = {
xpack: {
security: {
session: { idleTimeout: 123, lifespan: 345 },
audit: {
enabled: true,
appender: {
type: 'file',
path: './audit.log',
},
},
},
},
};
const { messages, migrated } = applyConfigDeprecations(cloneDeep(config));
expect(migrated.xpack.security.audit.appender.path).not.toBeDefined();
expect(migrated.xpack.security.audit.appender.fileName).toEqual('./audit.log');
expect(messages).toMatchInlineSnapshot(`
Array [
"\\"xpack.security.audit.appender.path\\" is deprecated and has been replaced by \\"xpack.security.audit.appender.fileName\\"",
]
`);
});

it(`warns that 'authorization.legacyFallback.enabled' is unused`, () => {
const config = {
xpack: {
Expand Down
17 changes: 0 additions & 17 deletions x-pack/plugins/security/server/config_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,6 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({

unused('authorization.legacyFallback.enabled'),
unused('authc.saml.maxRedirectURLSize'),
// Deprecation warning for the legacy audit logger.
(settings, fromPath, addDeprecation) => {
const auditLoggingEnabled = settings?.xpack?.security?.audit?.enabled ?? false;
const legacyAuditLoggerEnabled = !settings?.xpack?.security?.audit?.appender;
if (auditLoggingEnabled && legacyAuditLoggerEnabled) {
addDeprecation({
message: `The legacy audit logger is deprecated in favor of the new ECS-compliant audit logger.`,
documentationUrl:
'https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-settings',
correctiveActions: {
manualSteps: [
`Declare an audit logger "appender" via "xpack.security.audit.appender" to enable the ECS audit logger.`,
],
},
});
}
},
// Deprecation warning for the old array-based format of `xpack.security.authc.providers`.
(settings, fromPath, addDeprecation) => {
if (Array.isArray(settings?.xpack?.security?.authc?.providers)) {
Expand Down

0 comments on commit 8aa7b32

Please sign in to comment.