Skip to content

Commit

Permalink
[MD] Update default audit log path (opensearch-project#2793)
Browse files Browse the repository at this point in the history
- 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>
Signed-off-by: Ajay Gupta <ajyg@amazon.com>
  • Loading branch information
kristenTian authored and Ajay Gupta committed Nov 25, 2022
1 parent c6579d8 commit ddb30d8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Removed Leftover X Pack references ([#2638](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2638))
- Removes Add Integration button ([#2723](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2723))
- Change geckodriver version to make consistency ([#2772](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2772))
- [Multi DataSource] Update default audit log path ([#2793](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2793))

### 🚞 Infrastructure

Expand Down
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 ddb30d8

Please sign in to comment.