-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
To pinpoint locations of entities in a YAML file, JSONPath is the standard query language for JSON, but it can also be used for YAML. With JSONPath, many tools support fetching line numbers automatically, such as yq (https://mikefarah.gitbook.io/yq/operators/line).
Currently, KubeSec identifies entities using a custom expression language (e.g., "metadata.doc.yaml.6"). Adopt JSONPath in the KubeSec parser. Then, each static analysis alert can be identified by one (in most case) or many JSONPaths. Use yq to fetch line numbers using Python subprocess module.
Introduction material:
https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html
JSONPath playground:
https://jsonpath.com/
Metadata
Metadata
Assignees
Labels
No labels