Skip to content

Commit

Permalink
[Security Solution][Detection Engine] fixes empty item_id in exceptio…
Browse files Browse the repository at this point in the history
…n item update request (#194172)

## Summary

 - fixes #191315 in 8.15

When trying to update exception item with empty item_id, it will return
error


```JSON
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "[request body]: Invalid value \"\" supplied to \"item_id\""
}
```

<img width="2493" alt="Screenshot 2024-09-26 at 16 05 51"
src="https://github.com/user-attachments/assets/f68bfe94-4a4f-4d44-8255-7ae7fda8563e">


8.16(main) was fixed earlier:
#191315 (comment)
  • Loading branch information
vitaliidm authored Sep 30, 2024
1 parent d9ea8f6 commit fb1c9e3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { description } from '../../common/description';
import { name } from '../../common/name';
import { _version } from '../../common/underscore_version';
import { id } from '../../common/id';
import { item_id } from '../../common/item_id';
import { meta } from '../../common/meta';
import { namespace_type } from '../../common/namespace_type';
import { ExpireTimeOrUndefined, expireTimeOrUndefined } from '../../common';
Expand All @@ -39,7 +40,7 @@ export const updateExceptionListItemSchema = t.intersection([
comments: DefaultUpdateCommentsArray, // defaults to empty array if not set during decode
expire_time: expireTimeOrUndefined,
id, // defaults to undefined if not set during decode
item_id: t.union([t.string, t.undefined]),
item_id,
meta, // defaults to undefined if not set during decode
namespace_type, // defaults to 'single' if not set during decode
os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode
Expand Down

0 comments on commit fb1c9e3

Please sign in to comment.