1
0
mirror of https://github.com/quay/quay.git synced 2026-01-27 18:42:52 +03:00
Files
quay/events/vulnerability_found.html
Ivan Bazulic 6392ca972a secscan: Fix Slack notification creation on initial index (PROJQUAY-7037) (#2923)
* secscan: Fix Slack notification creation on initial index (PROJQUAY-7037)
This fixes the Slack and e-mail notifications when images are indexed on initial push, where `tags` information was missing. If an image is a manifest child, instead of the tag, we provide a full SHA digest to the client.
Also adds the ability to filter security vulnerabilites depending on their severity. If the `NOTIFICATION_MIN_SEVERITY_ON_NEW_INDEX` is not set in the `config.yaml` file, we will automatically create notifications only for vulnerabilities marked "high" or "critical". This variable can take values defined here:

3248a72da6/util/secscan/__init__.py (L1)

Example:

```
NOTIFICATION_MIN_SEVERITY_ON_NEW_INDEX: Medium
```

* Removed superfulous debug statements

* Add default to config.yaml, remove extra comment

* Fix isort sorting

* Update vulnerability_found.html

* Update vulnerability_found.html

* Isort formatting fix

* Update vulnerability_found.html
2024-06-12 09:51:11 -04:00

9 lines
640 B
HTML

{% if event_data.vulnerabilities %}
{{ event_data.vulnerabilities|length }} vulnerabilities were detected in tags
{% else %}
A <a href="{{ event_data.vulnerability.link }}">{{ event_data.vulnerability.priority }} vulnerability</a> ({{ event_data.vulnerability.id }}) was detected in tags/manifests
{% endif %}
{{ 'tags' | icon_image }}
{% for tag in event_data.tags[0:3] %}{%if loop.index > 1 %}, {% endif %}{{ (event_data.repository, tag) | repository_tag_reference }}{% endfor %} {% if event_data.tags|length > 3 %}(and {{ event_data.tags|length - 3 }} more) {% endif %} in
repository {{ event_data.repository | repository_reference }}