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

[Security Solution] Remove index false from artifact saved objects mappings #155204

Merged
merged 12 commits into from
Apr 25, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ describe('checking migration metadata changes on all registered SO types', () =>
"core-usage-stats": "b3c04da317c957741ebcdedfea4524049fdc79ff",
"csp-rule-template": "099c229bf97578d9ca72b3a672d397559b84ee0b",
"dashboard": "71e3f8dfcffeb5fbd410dec81ce46f5691763c43",
"endpoint:user-artifact": "a5b154962fb6cdf5d9e7452e58690054c95cc72a",
"endpoint:user-artifact-manifest": "5989989c0f84dd2d02da1eb46b6254e334bd2ccd",
"endpoint:user-artifact": "1bc8f4ab74f9bb0d90239a431d435c16f31cc32e",
"endpoint:user-artifact-manifest": "17d17827606db55e7499b1dab259263ffee3bb09",
"enterprise_search_telemetry": "4b41830e3b28a16eb92dee0736b44ae6276ced9b",
"epm-packages": "83235af7c95fd9bfb1d70996a5511e05b3fcc9ef",
"epm-packages-assets": "00c8b5e5bf059627ffc9fbde920e1ac75926c5f6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,31 @@ export const exceptionsArtifactSavedObjectType = ArtifactConstants.SAVED_OBJECT_
export const manifestSavedObjectType = ManifestConstants.SAVED_OBJECT_TYPE;

export const exceptionsArtifactSavedObjectMappings: SavedObjectsType['mappings'] = {
dynamic: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this SO type (endpoint:user-artifact) is actually one we no longer use and have an issue open to remove it (team issue 6214), so whatever changes you want to do here, you can

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paul-tavares I went ahead and removed the SO here: 19d06c7

properties: {
identifier: {
type: 'keyword',
},
compressionAlgorithm: {
type: 'keyword',
index: false,
},
encryptionAlgorithm: {
type: 'keyword',
index: false,
},
encodedSha256: {
type: 'keyword',
},
encodedSize: {
type: 'long',
index: false,
},
decodedSha256: {
type: 'keyword',
index: false,
},
decodedSize: {
type: 'long',
index: false,
},
created: {
type: 'date',
index: false,
},
body: {
type: 'binary',
Expand All @@ -52,28 +47,25 @@ export const exceptionsArtifactSavedObjectMappings: SavedObjectsType['mappings']
};

export const manifestSavedObjectMappings: SavedObjectsType['mappings'] = {
dynamic: false,
properties: {
created: {
type: 'date',
index: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see an explanation in the comments/PR so I'll ask here: why are we adding mappings for these fields, when they previously weren't needed? These mappings can be added at any point in the future, but this is our last opportunity to remove anything unnecessarily indexed (or specified to not be indexed).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rylnd apologies - I was doing some smoke testing locally with the fields removed first. All looks OK, so I pushed up the changes.

},
schemaVersion: {
type: 'keyword',
},
semanticVersion: {
type: 'keyword',
index: false,
},
artifacts: {
type: 'nested',
properties: {
policyId: {
type: 'keyword',
index: false,
},
artifactId: {
type: 'keyword',
index: false,
},
},
},
Expand Down