Commit graph

4 commits

Author SHA1 Message Date
natasha-moore-elastic
86a31db057
[DOCS] Documents Osquery Timeout setting (#174595)
Contributes to https://github.com/elastic/security-docs/issues/4536 by
documenting the new **Timeout** setting and `timeout` API parameter in
Osquery docs.

---------

Co-authored-by: nastasha.solomon <nastasha.solomon@elastic.co>
Co-authored-by: Benjamin Ironside Goldstein <91905639+benironside@users.noreply.github.com>
2024-01-17 15:29:23 +00:00
Konrad Szwarc
ee26923aab
[Defend Workflows] Fix saved queries 500 (#150426)
**Bug** 
Calling `/api/osquery/saved_queries` with `sortOrder` but without `sort`
field (`/api/osquery/saved_queries?sortOrder=desc`) was causing 500
server error. Same with calls without any parameters
(`/api/osquery/saved_queries`)

**Cause**
We had defaults failover set for `sortOrder` but not for `sort`. Sorting
logic required both fields to be defined. All schema params were set to
optional and we were validating them ourselves.

**Fix** 
I've tightened the schema by making all the params required and provided
default values if not provided.
`page: schema.number({ defaultValue: 1 }),
sort: schema.string({ defaultValue: 'id' }),
sortOrder: schema.oneOf([schema.literal('asc'), schema.literal('desc')],
{defaultValue: 'desc',}),`

**Additionally** 
Outdated osQuery API docs - `perPage` became `pageSize` and `sortField`
became `sort`. Also, minor spelling fixes.

---------

Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
2023-02-14 16:11:14 +01:00
Kaarina Tungseth
be498a5c58
[DOCS] Fixes formatting in the Osquery manager APIs (#149871)
## Summary

Fixes the formatting of the rogue `Query parameters` sections.
2023-01-30 12:41:10 -06:00
Patryk Kopyciński
33689abc77
[Osquery] Add docs for Osquery API (#137162) 2022-08-09 18:43:31 +02:00