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

Change legacy audit logger deprecation warning #110527

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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