Conversation
|
I was using: https://github.com/1set/starlet - I could be wrong, but it made life a lot simpler. Simple Poc is here: https://github.com/metraction/scanner-poc/blob/main/integrations/riskanalyzer.go#L53 |
Starlark (or any enrichment plugin)I aggree with the general pattern:
Suggestion
|
|
Currently each mapper gets We agreed that each mapper will get Then meta is written to the PharosScanResult.ScanTask.Context We need to agree should we allow to modify PharosScanResult.
|
Plugin Function Signaturepayload, meta := func(payload, meta) Payload
Meta
|
|
*Payload modifications Reason
What it is not a problem
|
Hard to argue with "splunk plugin works exactly this way" as I don't know internals and not sure splunk case is applicable for us. https://community.splunk.com/t5/Splunk-Enterprise/Is-there-any-possible-to-modify-raw-data-in-Splunk/m-p/553396 states that ingested data is immutable, so this opposes "exactly this way". |
With the starlet pkg you can add functions to it. No need. |
The input must be immutable, it is linked to other objects, if you change the vuln data for one image, it will be changed globally unless you create a copy. |
I propose to integrate starlark as mapper: NewStarlark takes filename of .star file and creates a
func(item map[string]interface{}) map[string]interface{}This allows pharos users to define their scripts how to map results and they appear on grafana board.
#83