Repository navigation
fix(security): configure ASF CVE bookkeeping senders #1745
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -874,6 +874,7 @@ available). These pre-populate `<project-config>/project.md` in Step 9: | |
| - `dev_list` is the target of the `dev` or `issues` or `pullrequests` notification containing `dev@`. If not found, default to `dev@<project>.apache.org`. | ||
| - `users_list` is the target of the `users` notification, or defaults to `users@<project>.apache.org`. | ||
| - `security_list` has no default: not every ASF project has a dedicated `security@<project>.apache.org` list. Detect it and ask, as [`adopt.md` Step 4b](adopt.md#4b--scaffold-whatever-is-still-missing) does; when no dedicated list is found, recommend requesting one from ASF Infra and offer `private@<project>.apache.org` only as a flagged fallback. | ||
| - `security_inbox.cve_tool_senders` inherits `security@apache.org` from the ASF organization profile. Ask which ASF CNA reviewers currently send CVE-tool notifications to the project. If the answer is non-empty, write one project-level list containing `security@apache.org` and the confirmed reviewer addresses because project values replace, rather than merge with, organization defaults. An empty answer leaves the key absent and keeps the inherited address; never guess reviewer addresses. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explicitly noting that project values replace rather than merge with organization defaults is critical here: it prevents adopters from accidentally omitting |
||
| - `private_list` defaults to `private@<project>.apache.org`. | ||
| - `announce_list` defaults to `announce@apache.org`. | ||
| - `github.homepage` in `.asf.yaml` may refine `product_family_url` if the GitHub repo homepage was empty. | ||
|
|
@@ -1329,6 +1330,7 @@ to this repo. | |
| - Replace the placeholder `TODO` lines with the values auto-sourced in Step 4b: | ||
| - Always (organization-agnostic): `upstream_repo`, `upstream_default_branch`, `product_family_url`, `labels`. | ||
| - **Only when `organization: ASF`** (the ASF-specific block of Step 4b): `dev_list`, `commits_list`, `users_list`, `private_list`, `announce_list`. `security_list` is not auto-sourced: settle it with the detect-and-recommend rule in `adopt.md` Step 4b ("Ask where security reports go explicitly"). For a non-ASF `organization`, leave these as `TODO` — do not write `apache.org` addresses. | ||
| - For ASF adopters with confirmed reviewer addresses, write `security_inbox.cve_tool_senders` with both `security@apache.org` and those addresses. If none were confirmed, leave the key absent so the organization default remains effective. Do not write guessed personal addresses. | ||
| - Prompt the user to confirm the auto-sourced values, and only ask them to input values for stable fields that were absent or couldn't be derived. | ||
| - Stage the written files in `.apache-magpie-overrides/` to git (`git add`). | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -239,6 +239,37 @@ def test_prefilter_rules(capsys, tmp_path) -> None: | |
| assert [t["thread_id"] for t in out["dropped"]] == ["t-bookkeeping"] | ||
|
|
||
|
|
||
| def test_prefilter_drops_asf_cna_bookkeeping_from_configured_senders(capsys, tmp_path) -> None: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clean regression test covering both the automated reservation notice and the human reviewer comment message shapes. |
||
| threads = { | ||
| "upstream": "apache/foo", | ||
| "security_list": "security@foo.apache.org", | ||
| "cve_tool_senders": ["security@apache.org", "reviewer@apache.org"], | ||
| "threads": [ | ||
| { | ||
| "thread_id": "reservation", | ||
| "messages": [ | ||
| {"subject": "CVE-2026-12345 reserved for foo", "from": "security@apache.org"}, | ||
| ], | ||
| }, | ||
| { | ||
| "thread_id": "review-comment", | ||
| "messages": [ | ||
| { | ||
| "subject": "Comment added on CVE-2026-12345", | ||
| "from": "ASF Reviewer <reviewer@apache.org>", | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| } | ||
|
|
||
| code, out = run(capsys, "prefilter", "--threads", write(tmp_path, "threads.json", threads)) | ||
|
|
||
| assert code == 0 | ||
| assert out["keep"] == [] | ||
| assert [thread["thread_id"] for thread in out["dropped"]] == ["reservation", "review-comment"] | ||
|
|
||
|
|
||
| def test_dedup_queries_batch_by_six(capsys, tmp_path) -> None: | ||
| ids = [f"19d2f40286{i:06x}" for i in range(8)] | ||
| code, out = run( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Providing
cve_tool_senders: [security@apache.org]here establishes the correct baseline for all ASF projects, preventing automated reservation notices from leaking into triage intake without requiring boilerplate configuration in every adopter'sproject.md.