Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Sprig functions in webhook templates #3717

Closed
ndegory opened this issue Nov 29, 2023 · 1 comment · Fixed by #3724
Closed

Missing Sprig functions in webhook templates #3717

ndegory opened this issue Nov 29, 2023 · 1 comment · Fixed by #3724
Assignees
Labels
Milestone

Comments

@ndegory
Copy link
Contributor

ndegory commented Nov 29, 2023

Description

Templates provided by tracee use Sprig functions (such as DateInZone in simple.tmpl). When used in a webhook, as reintroduced with #3448, Sprig is not loaded and these functions cannot be used, limiting the value of the templates.

aqua/tracee-6dkbw[tracee]: Error: printer.(*webhookEventPrinter).Init: template: webhook.tmpl:6: function "dateInZone" not defined

example template:

{
  "hostname": "{{ .HostName }}",
  "message": "Signature name: \"{{ .Metadata.Properties.signatureName }}\" description:\n{{ .Metadata.Description }}",
  "severity": "{{ .Metadata.Properties.Severity }}",
  "time": "{{ dateInZone "2006-01-02T15:04:05Z" (now) "UTC" }}",
  "tags": {
    "category": "{{ .Metadata.Properties.Category }}",
    "external_id": "{{ .Metadata.Properties.external_id }}",
    "signature_id": "{{ .Metadata.Properties.signatureId }}"
  }
}

Output of tracee version:

Tracee version: "v0.19.0"

Output of uname -a:

Linux tracee-6dkbw 5.10.197-186.748.amzn2.x86_64 #1 SMP Tue Oct 10 00:30:07 UTC 2023 x86_64 GNU/Linux

Additional details

@josedonizetti
Copy link
Collaborator

@ndegory Thank you for reporting. Looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants