feat(issues): closing or reopening a Prüfwerk issue in Gitea updates the finding (#953)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m27s
CI / Check (pull_request) Successful in 17m54s
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m27s
CI / Check (pull_request) Successful in 17m54s
The managed Git source's org webhook now handles `issues` events. A person closing an issue Prüfwerk opened resolves the undecided finding, recorded as "closed in the ticket" with the Gitea login; reopening it makes the finding open again. A decision already made in Prüfwerk is kept. Events whose sender is the issue's author (Prüfwerk's bot user, which opened it) are ignored, and the back-sync never calls Gitea, so nothing loops; the issue record is updated first, so the outbound sync has nothing left to comment or close. CVE issues closed in Gitea only record the close and who did it, no VEX status. The scan leaves such an issue closed while the CVE is still found, and forgets the close once a complete scan no longer finds it, so a CVE that comes back reopens the issue as before. The platform API names the events the webhook needs (`webhook_events`); Prüfwerk cannot change the webhook itself, so existing webhooks need the Issues event added in Gitea. The finding history shows "Im Ticket geschlossen von <login>". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d274c68ecb
commit
8c13fbaced
17 files changed
+1110
-23
No files matched your search
@@ -31,6 +31,14 @@ of an organisation in that instance automatically:
|
||||
also gets the label `risk:accepted`, with the reason in the comment. When
|
||||
the finding comes back (the scan finds it again, or it is reopened), the
|
||||
issue is reopened.
|
||||
- **The finding follows the issue.** When someone closes a Prüfwerk issue in
|
||||
Gitea, a finding still open counts as resolved; its history reads "Closed
|
||||
in the ticket by *Gitea user*". The next scan confirms that, or it finds the
|
||||
finding again and reopens it and the issue with a comment. When the issue
|
||||
is reopened in Gitea, the finding is open again. A decision already made in
|
||||
Prüfwerk (an accepted risk, say) stays when the issue is closed. A CVE
|
||||
issue someone closes stays closed while the scan finds the vulnerability
|
||||
unchanged; it does not set a VEX status.
|
||||
- **Sync.** Every 30 minutes Prüfwerk compares the organisation's repositories
|
||||
with its targets, in case a webhook delivery was lost.
|
||||
|
||||
@@ -72,7 +80,10 @@ PUT /api/v1/platform/tenants/{tenant_id}/git-source
|
||||
The response carries `webhook_url` and — only the first time, or with
|
||||
`"rotate_webhook_secret": true` — `webhook_secret`. With these, register an
|
||||
organisation or system webhook in Gitea (type Gitea, `application/json`) for
|
||||
the **Repository** and **Push** events. A repeated `PUT` without `bot_token`
|
||||
the **Repository**, **Push** and **Issues** events; the response names them in
|
||||
`webhook_events`. Prüfwerk cannot create or change the webhook itself (the bot
|
||||
has no administration rights): a webhook registered before issues synced back
|
||||
needs the **Issues** event added in Gitea. A repeated `PUT` without `bot_token`
|
||||
keeps the stored token, and without `rotate_webhook_secret` the secret. `GET`
|
||||
returns the source without secrets; `DELETE` removes it and archives its
|
||||
targets.
|
||||
|
||||
@@ -34,6 +34,15 @@ Repository-Organisation dieser Instanz automatisch prüfen:
|
||||
`risk:accepted`, mit der Begründung im Kommentar. Kommt der Befund wieder
|
||||
(die Prüfung findet ihn erneut, oder er wird wieder geöffnet), wird das
|
||||
Issue wieder geöffnet.
|
||||
- **Der Befund folgt dem Issue.** Schließt jemand ein Prüfwerk-Issue in Gitea,
|
||||
gilt ein noch offener Befund als behoben; im Verlauf steht „Im Ticket
|
||||
geschlossen von *Gitea-Benutzer*“. Die nächste Prüfung bestätigt das, oder
|
||||
sie findet den Befund erneut und öffnet ihn und das Issue mit Kommentar
|
||||
wieder. Wird das Issue in Gitea wieder geöffnet, ist der Befund wieder
|
||||
offen. Eine Entscheidung, die schon im Prüfwerk getroffen wurde (etwa ein
|
||||
akzeptiertes Risiko), bleibt beim Schließen bestehen. Ein CVE-Issue, das
|
||||
jemand schließt, bleibt geschlossen, solange die Prüfung die Schwachstelle
|
||||
unverändert findet; einen VEX-Status setzt das nicht.
|
||||
- **Abgleich.** Alle 30 Minuten gleicht Prüfwerk die Repository-Liste der
|
||||
Organisation mit den Prüfobjekten ab, falls ein Webhook verloren ging.
|
||||
|
||||
@@ -78,7 +87,11 @@ PUT /api/v1/platform/tenants/{tenant_id}/git-source
|
||||
Die Antwort enthält `webhook_url` und – nur beim ersten Mal oder mit
|
||||
`"rotate_webhook_secret": true` – `webhook_secret`. Damit wird in Gitea ein
|
||||
Organisations- oder System-Webhook (Typ Gitea, `application/json`) mit den
|
||||
Ereignissen **Repository** und **Push** angelegt. Ein erneuter `PUT` ohne
|
||||
Ereignissen **Repository**, **Push** und **Issues** angelegt; die Antwort
|
||||
nennt sie in `webhook_events`. Prüfwerk kann den Webhook nicht selbst anlegen
|
||||
oder ändern (der Bot hat keine Administrationsrechte): Bei einem Webhook, der
|
||||
vor dem Abgleich der Issues angelegt wurde, muss das Ereignis **Issues** in
|
||||
Gitea nachgetragen werden. Ein erneuter `PUT` ohne
|
||||
`bot_token` behält das gespeicherte Token, ohne `rotate_webhook_secret` das
|
||||
Secret. `GET` liefert die Quelle ohne Geheimnisse, `DELETE` entfernt sie und
|
||||
archiviert ihre Prüfobjekte.
|
||||
|
||||
Reference in new issue
Block a user