-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Telemetry] Settings Collector: redact sensitive reported values #88675
Changes from all commits
bc32777
e81d8bf
a4bb8a0
1bf819a
5b6d98b
192963f
a9a1068
e8fb492
7b61956
ec3bc7d
21b3059
18e9e89
210d7b0
840d689
4dde310
0dd8b14
141b634
c9d1314
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [UiSettingsParams](./kibana-plugin-core-public.uisettingsparams.md) > [sensitive](./kibana-plugin-core-public.uisettingsparams.sensitive.md) | ||
|
||
## UiSettingsParams.sensitive property | ||
|
||
a flag indicating that value might contain user sensitive data. used by telemetry to mask the value of the setting when sent. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
sensitive?: boolean; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IUiSettingsClient](./kibana-plugin-core-server.iuisettingsclient.md) > [isSensitive](./kibana-plugin-core-server.iuisettingsclient.issensitive.md) | ||
|
||
## IUiSettingsClient.isSensitive property | ||
|
||
Shows whether the uiSetting is a sensitive value. Used by telemetry to not send sensitive values. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
isSensitive: (key: string) => boolean; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [UiSettingsParams](./kibana-plugin-core-server.uisettingsparams.md) > [sensitive](./kibana-plugin-core-server.uisettingsparams.sensitive.md) | ||
|
||
## UiSettingsParams.sensitive property | ||
|
||
a flag indicating that value might contain user sensitive data. used by telemetry to mask the value of the setting when sent. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
sensitive?: boolean; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,6 @@ export class UiSettingsClient implements IUiSettingsClient { | |
|
||
constructor(options: UiSettingsServiceOptions) { | ||
const { type, id, buildNum, savedObjectsClient, log, defaults = {}, overrides = {} } = options; | ||
|
||
this.type = type; | ||
this.id = id; | ||
this.buildNum = buildNum; | ||
|
@@ -132,6 +131,11 @@ export class UiSettingsClient implements IUiSettingsClient { | |
return this.overrides.hasOwnProperty(key); | ||
} | ||
|
||
isSensitive(key: string): boolean { | ||
const definition = this.defaults[key]; | ||
return !!definition?.sensitive; | ||
Comment on lines
+135
to
+136
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT (and personal opinion): Now that we have the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might change my opinion about this in the future but the I think using |
||
} | ||
|
||
private assertUpdateAllowed(key: string) { | ||
if (this.isOverridden(key)) { | ||
throw new CannotOverrideError(`Unable to update "${key}" because it is overridden`); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# User-changed UI Settings - Management Collector | ||
|
||
The Usage Collector `stack_management` reports user changed settings. | ||
All user changed UI Settings are automatically collected. | ||
|
||
After adding a new setting you will be required to do the following steps: | ||
|
||
1. Update the [schema](./schema.ts) to include the setting name and schema type. | ||
``` | ||
export const stackManagementSchema: MakeSchemaFrom<UsageStats> = { | ||
'MY_UI_SETTING': { type: 'keyword' }, | ||
} | ||
``` | ||
|
||
2. Update the [UsageStats interface](./types.ts) with the setting name and typescript type. | ||
``` | ||
export interface UsageStats { | ||
'MY_UI_SETTING': string; | ||
} | ||
``` | ||
3. Run the telemetry checker with `--fix` flag to automatically fix the mappings | ||
|
||
``` | ||
node scripts/telemetry_check --fix | ||
``` | ||
|
||
If you forget any of the steps our telemetry tools and tests will help you through the process! | ||
|
||
## Sensitive fields | ||
|
||
If the configured UI setting might contain user sensitive information simply add the property `sensitive: true` to the ui setting registration config. | ||
|
||
``` | ||
uiSettings.register({ | ||
[NEWS_FEED_URL_SETTING]: { | ||
name: i18n.translate('xpack.securitySolution.uiSettings.newsFeedUrl', { | ||
defaultMessage: 'News feed URL', | ||
}), | ||
value: NEWS_FEED_URL_SETTING_DEFAULT, | ||
sensitive: true, | ||
description: i18n.translate('xpack.securitySolution.uiSettings.newsFeedUrlDescription', { | ||
defaultMessage: '<p>News feed content will be retrieved from this URL</p>', | ||
}), | ||
category: [APP_ID], | ||
requiresPageReload: true, | ||
schema: schema.string(), | ||
}, | ||
}), | ||
``` | ||
|
||
The value of any UI setting marked as `sensitive` will be reported as a keyword `[REDACTED]` instead of the actual value. This hides the actual sensitive information while giving us some intelligence over which fields the users are interactive with the most. |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UltraNIT: better safe than sorry I guess, but I still wonder if this assertion is really useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not needed but to stay consistent with other symbols we check for.