You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@security.apache.org by "raboof (via GitHub)" <gi...@apache.org> on 2026/09/17 15:14:03 UTC

[PR] feat: UI to send triage emails [security-dash]

raboof opened a new pull request, #27:
URL: https://github.com/apache/security-dash/pull/27

   behind a per-project feature toggle for now


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@security.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: UI to send triage emails [security-dash]

Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof merged PR #27:
URL: https://github.com/apache/security-dash/pull/27


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@security.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: UI to send triage emails [security-dash]

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on code in PR #27:
URL: https://github.com/apache/security-dash/pull/27#discussion_r4063260337


##########
app/templates/includes/forms/untriaged.html:
##########
@@ -0,0 +1,59 @@
+{# Triage form for an untriaged report. The PMC picks a decision and writes the
+   feedback; both are handed to the notification API, which sends the email
+   previewed here. The static parts come from triage.message_preview(). #}
+{% set preview = message_preview(project_name, report, current_user.fullname or current_user.uid) %}
+<details class="triage">
+  <summary>Triage</summary>
+  <form method="post"
+        action="{{ url_for('client.project_triage_api', project=project_name) }}">
+    <input type="hidden" name="tag" value="{{ report.security_team_name }}" />
+    <input type="hidden" name="message_id" value="{{ report.message_id }}" />
+
+    <p>
+      Determine whether the issue you're triaging is a vulnerability:
+      <ul>
+        <li>Can it be exploited by an attacker?
+        <li>Does it impact Confidentiality, Integrity or Accessibility?
+        <li>Is it surprising given your security model?
+      </ul>
+      See also <a href="https://cwiki.apache.org/confluence/display/SECURITY/For+what+issues+to+create+advisories">For what issues to create advisories</a> and <a href="https://cwiki.apache.org/confluence/display/SECURITY/Documenting+your+security+model">Documenting your security model</a>.
+    </p>
+    <fieldset class="triage-decision">
+      <label>
+        <input type="radio" name="action" value="accept" required />
+        Yes, this is a vulnerability
+      </label>
+      <label>
+        <input type="radio" name="action" value="reject" />
+        No, this is not a vulnerability
+      </label>
+    </fieldset>
+
+    <div class="triage-preview">
+      <dl class="triage-headers">
+        <dt>To</dt><dd>{{ preview.to }}</dd>
+        <dt>Cc</dt><dd>{{ preview.cc|join(', ') }}</dd>
+        <dt>Subject</dt><dd>{{ preview.subject }}</dd>
+      </dl>
+      <div class="triage-body">
+        <p>{{ preview.salutation }}</p>

Review Comment:
   This should be an input too, prefilled with the value of `preview.salutation`: the display name of many reporters does not correspond to how they sign.



##########
app/templates/includes/forms/untriaged.html:
##########
@@ -0,0 +1,59 @@
+{# Triage form for an untriaged report. The PMC picks a decision and writes the
+   feedback; both are handed to the notification API, which sends the email
+   previewed here. The static parts come from triage.message_preview(). #}
+{% set preview = message_preview(project_name, report, current_user.fullname or current_user.uid) %}
+<details class="triage">
+  <summary>Triage</summary>
+  <form method="post"
+        action="{{ url_for('client.project_triage_api', project=project_name) }}">
+    <input type="hidden" name="tag" value="{{ report.security_team_name }}" />
+    <input type="hidden" name="message_id" value="{{ report.message_id }}" />
+
+    <p>
+      Determine whether the issue you're triaging is a vulnerability:
+      <ul>
+        <li>Can it be exploited by an attacker?
+        <li>Does it impact Confidentiality, Integrity or Accessibility?
+        <li>Is it surprising given your security model?
+      </ul>
+      See also <a href="https://cwiki.apache.org/confluence/display/SECURITY/For+what+issues+to+create+advisories">For what issues to create advisories</a> and <a href="https://cwiki.apache.org/confluence/display/SECURITY/Documenting+your+security+model">Documenting your security model</a>.
+    </p>

Review Comment:
   Unless I am mistaken `<p>` doesn't allow for block-level children. My IDE also marks `</p>` as not having a matching `<p>`.



##########
app/triage.py:
##########
@@ -0,0 +1,317 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Triage decisions a PMC can take on a report from the project view.
+
+The dashboard does not change report state itself: a decision is handed to the
+notification API, which emails the feedback to the reporter and moves the report
+on (rejected reports end up in the zzz-non-issue tree, so they drop off this
+dashboard entirely).
+
+Which form a report gets, and which actions that form may submit, depend on the
+state the report is in: both live in `_STATE_FORMS` below, so adding a form for
+another state is a matter of adding an entry and a template.
+
+Triage is opt-in per PMC (`pmcs_with_triage` in the config), since a decision
+mails the reporter: `enabled_for` gates both the form and the endpoint.
+"""
+
+from app import config
+from app.reports import Report
+import aiohttp
+import asyncio
+import dataclasses
+import datetime
+import enum
+from typing import Mapping
+import urllib
+
+class TriageAction(enum.StrEnum):
+    ACCEPT = "accept"
+    REJECT = "reject"
+
+@dataclasses.dataclass(frozen=True)
+class _StateForm:
+    template: str
+    actions: frozenset[TriageAction]
+
+_STATE_FORMS: dict[str, _StateForm] = {
+    "untriaged": _StateForm(
+        template="includes/forms/untriaged.html",
+        actions=frozenset({TriageAction.ACCEPT, TriageAction.REJECT}),
+    ),
+}
+
+MAX_FEEDBACK_LENGTH = 10_000
+
+# The notification API owns the real email template; these are the static parts
+# of it, so the PMC can see what the reporter will receive before submitting.
+# TODO: they are a copy, and have to be kept in step with that API by hand.
+# Better, once it exists: have it render the preview and fetch it from here.
+_SALUTATION = "Dear {reporter},"
+_OPENING = "Thank you for your report."
+_DECISION_PARAGRAPHS: dict[TriageAction, str] = {
+    TriageAction.ACCEPT: (
+        "The PMC has confirmed the issue you reported as a vulnerability and is "
+        "working on a fix. You will be notified once a release containing the fix "
+        "is available, and are asked to keep the report confidential until then."
+    ),
+    TriageAction.REJECT: (
+        "The PMC has determined that the issue you reported is not a vulnerability "

Review Comment:
   We can be never too careful about the reporter missing the negation:
   
   ```suggestion
           "The PMC has determined that the issue you reported is NOT a vulnerability "
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@security.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: UI to send triage emails [security-dash]

Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on code in PR #27:
URL: https://github.com/apache/security-dash/pull/27#discussion_r4063458848


##########
app/templates/includes/forms/untriaged.html:
##########
@@ -0,0 +1,59 @@
+{# Triage form for an untriaged report. The PMC picks a decision and writes the
+   feedback; both are handed to the notification API, which sends the email
+   previewed here. The static parts come from triage.message_preview(). #}
+{% set preview = message_preview(project_name, report, current_user.fullname or current_user.uid) %}
+<details class="triage">
+  <summary>Triage</summary>
+  <form method="post"
+        action="{{ url_for('client.project_triage_api', project=project_name) }}">
+    <input type="hidden" name="tag" value="{{ report.security_team_name }}" />
+    <input type="hidden" name="message_id" value="{{ report.message_id }}" />
+
+    <p>
+      Determine whether the issue you're triaging is a vulnerability:
+      <ul>
+        <li>Can it be exploited by an attacker?
+        <li>Does it impact Confidentiality, Integrity or Accessibility?
+        <li>Is it surprising given your security model?
+      </ul>
+      See also <a href="https://cwiki.apache.org/confluence/display/SECURITY/For+what+issues+to+create+advisories">For what issues to create advisories</a> and <a href="https://cwiki.apache.org/confluence/display/SECURITY/Documenting+your+security+model">Documenting your security model</a>.
+    </p>
+    <fieldset class="triage-decision">
+      <label>
+        <input type="radio" name="action" value="accept" required />
+        Yes, this is a vulnerability
+      </label>
+      <label>
+        <input type="radio" name="action" value="reject" />
+        No, this is not a vulnerability
+      </label>
+    </fieldset>
+
+    <div class="triage-preview">
+      <dl class="triage-headers">
+        <dt>To</dt><dd>{{ preview.to }}</dd>
+        <dt>Cc</dt><dd>{{ preview.cc|join(', ') }}</dd>
+        <dt>Subject</dt><dd>{{ preview.subject }}</dd>
+      </dl>
+      <div class="triage-body">
+        <p>{{ preview.salutation }}</p>

Review Comment:
   TBH I think that's their problem/responsibility: if they'd like to be addressed any particular way, it's kinda on them to make sure the machine-readable field identifying them holds that name. I'm not sure it's sensible to try and second-guess that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@security.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: UI to send triage emails [security-dash]

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on code in PR #27:
URL: https://github.com/apache/security-dash/pull/27#discussion_r4063640070


##########
app/templates/includes/forms/untriaged.html:
##########
@@ -0,0 +1,59 @@
+{# Triage form for an untriaged report. The PMC picks a decision and writes the
+   feedback; both are handed to the notification API, which sends the email
+   previewed here. The static parts come from triage.message_preview(). #}
+{% set preview = message_preview(project_name, report, current_user.fullname or current_user.uid) %}
+<details class="triage">
+  <summary>Triage</summary>
+  <form method="post"
+        action="{{ url_for('client.project_triage_api', project=project_name) }}">
+    <input type="hidden" name="tag" value="{{ report.security_team_name }}" />
+    <input type="hidden" name="message_id" value="{{ report.message_id }}" />
+
+    <p>
+      Determine whether the issue you're triaging is a vulnerability:
+      <ul>
+        <li>Can it be exploited by an attacker?
+        <li>Does it impact Confidentiality, Integrity or Accessibility?
+        <li>Is it surprising given your security model?
+      </ul>
+      See also <a href="https://cwiki.apache.org/confluence/display/SECURITY/For+what+issues+to+create+advisories">For what issues to create advisories</a> and <a href="https://cwiki.apache.org/confluence/display/SECURITY/Documenting+your+security+model">Documenting your security model</a>.
+    </p>
+    <fieldset class="triage-decision">
+      <label>
+        <input type="radio" name="action" value="accept" required />
+        Yes, this is a vulnerability
+      </label>
+      <label>
+        <input type="radio" name="action" value="reject" />
+        No, this is not a vulnerability
+      </label>
+    </fieldset>
+
+    <div class="triage-preview">
+      <dl class="triage-headers">
+        <dt>To</dt><dd>{{ preview.to }}</dd>
+        <dt>Cc</dt><dd>{{ preview.cc|join(', ') }}</dd>
+        <dt>Subject</dt><dd>{{ preview.subject }}</dd>
+      </dl>
+      <div class="triage-body">
+        <p>{{ preview.salutation }}</p>

Review Comment:
   Sounds good to me!
   
   There is one reporter in particular that will be surprised by the way he/she is addressed. :smiling_imp: 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@security.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org