You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/Diagnostics/PH2155.md
+20-70Lines changed: 20 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,11 +52,11 @@ In the package's `.nuspec` file:
52
52
### Diagnostic message
53
53
54
54
```
55
-
Package 'SomeGplPackage' version '1.0.0' has an unacceptable license 'GPL-3.0'. Consider adding to Allowed.Licenses.txt if license is acceptable.
55
+
Package 'SomeGplPackage' version '1.0.0' has an unacceptable license 'GPL-3.0'. Add 'SomeGplPackage GPL-3.0' to Allowed.Licenses.txt if this specific package and license combination is acceptable.
56
56
```
57
57
58
58
```
59
-
Package 'SomePackageWithFileLicense' version '1.0.0' has an unacceptable license 'UNKNOWN_FILE_LICENSE'. Consider adding to Allowed.Licenses.txt if license is acceptable.
59
+
Package 'SomePackageWithFileLicense' version '1.0.0' has an unacceptable license 'UNKNOWN_FILE_LICENSE'. Add 'SomePackageWithFileLicense UNKNOWN_FILE_LICENSE' to Allowed.Licenses.txt if this specific package and license combination is acceptable.
60
60
```
61
61
62
62
### Resolution options
@@ -70,37 +70,18 @@ Package 'SomePackageWithFileLicense' version '1.0.0' has an unacceptable license
70
70
</ItemGroup>
71
71
```
72
72
73
-
```text
74
-
# Allowed.Licenses.txt - Add acceptable licenses to this file
75
-
# Commercial license for specific vendor
76
-
CommercialLicense-Vendor-X
77
-
# Allow GPL for this specific use case
78
-
GPL-3.0
79
-
# Combined format (recommended for maximum security)
80
-
SomePackage GPL-3.0
81
-
```
82
-
83
-
#### Option 2: Use Combined Format (Recommended)
84
-
85
-
The safest approach is to use the combined package + license format:
86
-
87
-
```xml
88
-
<!-- In your project file -->
89
-
<ItemGroup>
90
-
<AdditionalFilesInclude="Allowed.Licenses.txt" />
91
-
</ItemGroup>
92
-
```
93
-
94
73
```text
95
74
# Allowed.Licenses.txt - Combined format for maximum security
96
-
# Only accept SomeGplPackage if it specifically has GPL-3.0 license
75
+
# Only accept specific packages with specific licenses
97
76
SomeGplPackage GPL-3.0
77
+
SomeCommercialPackage CommercialLicense-Vendor-X
78
+
SomePackageWithFileLicense UNKNOWN_FILE_LICENSE
98
79
99
80
# This prevents both license change issues and file name collisions
100
-
# If the package later changes to a different license, it will be flagged again
81
+
# If a package later changes to a different license, it will be flagged again
101
82
```
102
83
103
-
#### Option 3: Find alternative package
84
+
#### Option 2: Find alternative package
104
85
105
86
Replace the package with one that has a more permissive license:
106
87
@@ -109,7 +90,7 @@ Replace the package with one that has a more permissive license:
- Custom license names for commercial or proprietary packages
189
170
- SPDX license identifiers
190
-
-**Package names** for whitelisting specific packages (safer than license file names)
171
+
-Entries are case-insensitive
191
172
192
173
### Whitelisting Specific Packages
193
174
194
-
For packages with unacceptable or unknown licenses that you need to use, you have several whitelisting options in `Allowed.Licenses.txt`:
175
+
For packages with unacceptable or unknown licenses that you need to use, use the combined package + license format in `Allowed.Licenses.txt`:
195
176
196
-
#### 1. Combined Package + License Format (Recommended - Safest)
177
+
#### Combined Package + License Format (Required)
197
178
198
-
The safest approach is to use the combined format: `packagename license`. This provides both package identity verification and license verification, preventing both license change vulnerabilities and license file name collisions.
179
+
The analyzer only supports the secure combined format: `packagename license`. This provides both package identity verification and license verification, preventing both license change vulnerabilities and license file name collisions.
199
180
200
181
```text
201
-
# Allowed.Licenses.txt - Combined format examples (RECOMMENDED)
202
-
# Standard license identifiers (backward compatibility)
0 commit comments