Skip to content

Commit

Permalink
[MD] Update default audit log path (opensearch-project#2793) (opensea…
Browse files Browse the repository at this point in the history
…rch-project#2794)

- Fix the /tmp path issue seen on windows platform.
- Change audit log to disable by default.

Signed-off-by: Kristen Tian <tyarong@amazon.com>

Signed-off-by: Kristen Tian <tyarong@amazon.com>
(cherry picked from commit d93ea2e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 2c3c1d3 commit 9c02062
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
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

0 comments on commit 9c02062

Please sign in to comment.