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

[Backport 2.4] [MD] Update default audit log path #2795

Merged
merged 1 commit into from
Nov 4, 2022
Merged
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
8 changes: 4 additions & 4 deletions src/plugins/data_source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Update the following configuration in the `opensearch_dashboards.yml` file to ap
1. The dataSource plugin is disabled by default; to enable it:
`data_source.enabled: true`

2. The audit trail is enabled by default for logging the access to data source; to disable it:
`data_source.audit.enabled: false`
2. The audit trail is disabled by default for logging the access to data source; to disable it:
`data_source.audit.enabled: true`

- Current auditor configuration:
- Default auditor configuration:

```yml
data_source.audit.appender.kind: 'file'
data_source.audit.appender.layout.kind: 'pattern'
data_source.audit.appender.path: '/tmp/opensearch-dashboards-data-source-audit.log'
data_source.audit.appender.path: '<Operating System's Temp Folder>/opensearch-dashboards-data-source-audit.log'
```

3. The default encryption-related configuration parameters are:
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/data_source/audit_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/

import { schema } from '@osd/config-schema';
import os from 'os';
import path from 'path';
// eslint-disable-next-line @osd/eslint/no-restricted-paths
import { DateConversion } from '../../../src/core/server/logging/layouts/conversions';

Expand Down Expand Up @@ -36,7 +38,7 @@ export const fileAppenderSchema = schema.object(
kind: 'pattern',
highlight: true,
},
path: '/tmp/opensearch-dashboards-data-source-audit.log',
path: path.join(os.tmpdir(), 'opensearch-dashboards-data-source-audit.log'),
},
}
);
2 changes: 1 addition & 1 deletion src/plugins/data_source/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const configSchema = schema.object({
size: schema.number({ defaultValue: 5 }),
}),
audit: schema.object({
enabled: schema.boolean({ defaultValue: true }),
enabled: schema.boolean({ defaultValue: false }),
appender: fileAppenderSchema,
}),
});
Expand Down