aquasecurity / trivy-plugin-webhook

Apache License 2.0
1 stars 8 forks source link

trivy args and slack webhook #15

Open abdidarmawan007 opened 1 year ago

abdidarmawan007 commented 1 year ago

i try sending trivy scan to slack webhook and i have questionwhat is trivy args ?

trivy webhook -- -url=https://hooks.slack.com/services/xxxx/xxxx/xxxx -- "trivy args"

HW-Jeremy commented 1 year ago

Same here :

trivy webhook -- -url="https://hooks.slack.com/services/xxx/xxx/xxx" -- "image xxx/xxx/xxx --exit-code 1 --cache-dir .trivycache/ --no-progress --security-checks vuln,config,secret --severity CRITICAL"
trivy webhook -- -url=<webhook-url> -- <trivy args>
     webhook endpoint url
2023/02/15 09:08:44 trivy webhook plugin expects a webhook endpoint url
Error: plugin error: plugin exec: exit status 1
Usage:
  trivy webhook [flags]

Flags:
  -h, --help   help for webhook

Global Flags:
      --cache-dir string          cache directory (default "/Users/xxxx/Library/Caches/trivy")
  -c, --config string             config path (default "trivy.yaml")
  -d, --debug                     debug mode
      --generate-default-config   write the default config to trivy-default.yaml
      --insecure                  allow insecure server connections when using TLS
  -q, --quiet                     suppress progress bar and log output
      --timeout duration          timeout (default 5m0s)
  -v, --version                   show version

2023-02-15T09:08:44.792+0100    FATAL   plugin error: plugin exec: exit status 1
abdidarmawan007 commented 1 year ago

@HW-Jeremy I have also tried like that and it doesn't work,

KrishnaMohanGannamraju commented 1 year ago

@knqyf263 As suggested in the https://github.com/aquasecurity/trivy/issues/632

The issue already exists here. I am trying to use this plugin to create a jira ticket for the image scan vulnerabilities.

Getting the same error.

sokoow commented 1 year ago

There's an extra -- at the beginning of the command, here's what works for me:

trivy webhook --url=http://postee.kube-system:8082 -- image alpine:3.10 --format=json