Skip to content

Commit ec04760

Browse files
authored
Spec Update: Audit Sources Options uses Checkbox & new Strings (#14652)
1 parent 2c21c70 commit ec04760

File tree

5 files changed

+21
-26
lines changed

5 files changed

+21
-26
lines changed

accepted/2025/audit-sources-visual-studio-options.md

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,54 +20,48 @@ Pain-points today:
2020
### **Functional Explanation**
2121

2222
Add an **"Audit Sources"** table to the "Package Sources" page in NuGet's Visual Studio Options.
23+
The audit source table will show the same columns as package sources:
24+
**Warnings/Errors, Enabled, Name, Source, Allow Insecure Connections** (note that mockups may not reflect all columns).
2325

2426
- **Discoverability**: Enable Quick Search (Ctrl+Q) so that searching for "Audit Source" navigates to the Package Sources page in Unified Settings.
2527
- Up to **Three Tables** can be shown in this order:
2628
- Package Sources (always shown)
2729
- Audit Sources (shown when explicitly configured),
2830
- Machine-wide Package Sources (shown when explicitly configured)
29-
- New dropdown: **Choose how NuGet Audit retrieves vulnerability data**
30-
- Introduce a dropdown control to switch from **"Read vulnerabilities from my package sources"** to **"Configure sources to read vulnerabilities"**
31-
- When an audit source is configured, the Audit Sources table appears.
32-
- To configure the first audit source, select **"Configure sources to read vulnerabilities"**; this reveals the Audit Sources table.
31+
- New Checkbox: **Use separate sources for vulnerability audit**
32+
- Introduce a Checkbox control that when checked, shows a table for adding Audit Sources.
33+
![Existing package sources Visual Studio Options page shown with a new Checkbox](../../meta/resources/AuditSources-VS/checkbox-audit-sources.png)
34+
- At least 1 audit source must be added to persist the effect of this setting.
35+
Otherwise, checking the box and closing VS and reopening this setting, the checkbox will now be unchecked since no audit sources are found.
36+
- In a future iteration, checking the box may be able to automatically open the Add Audit Source dialog.
37+
Unified Settings does not currently have this support.
38+
- When none are configured, the Audit Sources table will be **hidden**.
39+
- When one or more audit source is already configured, the Audit Sources table appears by default.
40+
- The Checkbox is **disabled** and a message indicates how to go back to using Package Sources:
41+
> "Remove all audit sources to revert to using package sources for vulnerability data."
42+
- If customers want the ability to switch back from their audit sources to only package sources for Vulnerability data, a future iteration could support this and automatically clear `<auditSources>` after showing a warning Messagebox that can be cancelled.
3343
34-
#### Read vulnerabilities from my package sources
44+
_Mockup_: Table of Audit Sources shown below Package Sources because Checkbox option "Use separate sources for vulnerability audit" is selected.
3545

36-
- Default option - if no audit sources exist, this will be the selection.
37-
- Audit Sources table will be **hidden**.
46+
![Table of Audit Sources shown below Package Sources because Checkbox option "Use separate sources for vulnerability audit" is selected](../../meta/resources/AuditSources-VS/audit-sources-visible-table.png)
3847

39-
![Existing package sources Visual Studio Options page shown with a new "Choose how NuGet Audit retrieves vulnerability data" dropdown](../../meta/resources/AuditSources-VS/audit-choose-package-source-page.png)
40-
41-
#### Configure sources to read vulnerabilities
42-
43-
- Audit Sources table will be **shown**.
44-
- **Pre-selected** when one or more audit sources are already configured.
45-
- The dropdown will be disabled as well since the presence of audit sources takes away the behavior of reading vulnerability data from package sources.
46-
- **User-selectable** only when no audit sources exist, enabling a customer to explicitly configure their first `<auditSource>` using the `Add` button.
47-
48-
![New dropdown expanded with both options shown"](../../meta/resources/AuditSources-VS/choose-nuget-audit-dropdown.png)
49-
50-
![Table of Audit Sources shown below Package Sources because Combobox option "Configure sources to read vulnerabilities" is selected](../../meta/resources/AuditSources-VS/audit-sources-visible-table.png)
51-
52-
- Switching the dropdown back to "**Read vulnerabilities from my package sources**" would not be supported in this iteration.
53-
- If customers want the ability to switch back from their audit sources to only package sources for Vulnerability data, a future iteration could support this and automatically clear `<auditSources>` after showing a warning messagebox that can be cancelled.
5448

5549
#### Describe Package versus Audit sources
5650

5751
Before each table, introduce descriptive text to reinforce with customers how Package Sources and Audit Sources work together.
5852

5953
- **Package sources**:
60-
61-
> Configure the sources NuGet will use to for displaying and downloading packages. NuGet Audit will also reference vulnerability data from sources that support it. Alternatively, dedicated Audit Source(s) can be configured below.
54+
> Package sources define where NuGet retrieves packages for install, restore, audit, and update operations. [Learn more about package sources](https://learn.microsoft.com/nuget/reference/nuget-config-file#packagesources)
6255
6356
- **Audit sources**:
6457

65-
> Configure the sources NuGet Audit will use for retrieving Package Vulnerability data. If none are configured, any configured package sources that support Vulnerability data will be used by NuGet Audit.
58+
> Audit sources provide vulnerability data during restore with
59+
out acting as package sources. If no audit sources are configured, NuGet Audit uses package sources and suppresses warning NU1905. [Learn more about audit sources](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)
6660

6761
### **Technical Explanation**
6862

6963
- Add an array setting titled "Audit Sources" to the "Package Sources" NuGet options page in the Unified Settings registration.json file.
70-
- Make the "Audit Sources" array setting hidden unless the "Choose how NuGet Audit retrieves vulnerability data" value is "Configure sources to read vulnerabilities".
64+
- Make the "Audit Sources" array setting hidden unless the "Use separate sources for vulnerability audit" value is `true` (Checked).
7165
- Use existing NuGet.Configuration APIs to read/write `<auditSources>` in `nuget.config` files.
7266

7367
#### Telemetry
@@ -77,6 +71,7 @@ Before each table, introduce descriptive text to reinforce with customers how Pa
7771
## **Drawbacks**
7872

7973
- Potential confusion for package sources that act as audit sources implicitly by having a vulnerability resource.
74+
The Checkbox is an attempt to make this more clear, and we can measure its impact and feedback from customers.
8075

8176
## **Rationale and Alternatives**
8277

Binary file not shown.
67.9 KB
Loading
9.64 KB
Loading
-7.04 KB
Binary file not shown.

0 commit comments

Comments
 (0)