els0r / goProbe

High-performance IP packet metadata aggregation and efficient storage and querying of flows
GNU General Public License v2.0
12 stars 4 forks source link

[feature] Add safeguards against raw queries in global-query #316

Closed els0r closed 5 months ago

els0r commented 5 months ago

Will not run a query iff:

The error response will look as follows:

{
  "$schema": "http://localhost:8146/schemas/ErrorModel.json",
  "title": "Unprocessable Entity",
  "status": 422,
  "detail": "query safeguards violation",
  "errors": [
    {
      "message": "unbounded query. Hint: narrow down attributes",
      "location": "body.query",
      "value": "raw"
    },
    {
      "message": "unbounded query. Hint: supply condition to filter results",
      "location": "body.condition",
      "value": ""
    }
  ]
}

Other

Drive-by fix for OpenAPI generation of global-query in build pipeline.