Commit Graph

97 Commits

Author SHA1 Message Date
Rachael Newitt
11b0e6b805 Update the insuffient vuln scanning warning.
The previous CL changed the validation criteria, but did not update
the error message we're posting on the bugs we file, which is very
confusing. In the future we should try to write some tests to catch
things like this.

Bug: 452151523
Change-Id: I08272353a3cfada8f242355b48c4f003eec4abf4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7153383
Auto-Submit: Rachael Newitt <renewitt@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
Reviewed-by: Jordan Brown <rop@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-11-13 18:15:02 -08:00
Ramin Halavati
9c69e0d573 Update licenses allowlist for the latest build of ChromeScreenAI.
Added licenses are needed by the latest build of the ChromeScreenAI
library. The license list is updated in: http://crrev.com/c/7079126

The list is generated using the following tools:
.../opensource/tools/collect_licenses/collect_licenses
.../opensource/thirdparty/licenseclassifier/identify_license

Bug: 378472917
Change-Id: I83f07d0774ace7a9984087d7c8ac1acd604e82e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7088131
Reviewed-by: Anne Redulla <aredulla@google.com>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
2025-11-12 23:21:39 -08:00
Jordan
0a519cc269 Export license helpers
This allows client code to check if a license is in a given allowlist
e.g. 'WITH_PERMISSION_ONLY' without exporting the lists. This is done
because we now process licenses (e.g. .lower()) when checking against
the lists.

Also fix a type annotation.

Change-Id: I7c52dd19493f72ba3fb927f1654ee1affde320dd
Bug: 452151523, 460076179
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7149079
Reviewed-by: Anne Redulla <aredulla@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
Commit-Queue: Anne Redulla <aredulla@google.com>
2025-11-12 19:17:09 -08:00
Jiewei Qian
cdddcc5974 metadata/license_allowlist: export consts depended on by downstream
This CL re-epxorts normalized license list consts temporarily so we
unbreak downstream clients relying on their import names.

Future CL will migrate downstream clients to use the exported functions
(which handles normalization correctly), then remove this temporary
export.

Bug: 452151523
Change-Id: I05a96fb35c3decda77890808d8f78ae867f47b09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7148918
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jiewei Qian <qjw@chromium.org>
Reviewed-by: Jordan Brown <rop@google.com>
2025-11-12 16:08:26 -08:00
Jordan
8acc772e9a Removing git tag as acceptable for vuln sufficiency
Change-Id: Ie611f0fe87dc0b518104588c153b7d857a696237
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7144858
Auto-Submit: Jordan Brown <rop@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
2025-11-12 14:51:31 -08:00
Jordan
4f279935d6 Make license check case insensitive
I've been careful to make sure that the values in the warnings will
still have their original case so that we don't end up with all of the
licenses being in lowercase.

Bug: 452151523
Change-Id: Ifcc5e2ec38486a8e4f68fb7b066b00b8732cbc1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7060630
Commit-Queue: Jiewei Qian <qjw@chromium.org>
Reviewed-by: Jiewei Qian <qjw@chromium.org>
Auto-Submit: Jordan Brown <rop@google.com>
2025-11-11 21:11:41 -08:00
Sylvain Defresne
f4ffac2a93 Add licences for breakpad and libwebp to the allowlist
Those licences are found in breakpad and libwebp README.chromium from
google3 so add them to the allowlist (since they are allowed just not
listed).

Fixed: 451723867, 451723789
Change-Id: Ib2f5a3f227a3f0dc8471c3569714bd435e33203e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7036502
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Jordan Brown <rop@google.com>
2025-10-15 01:53:59 -07:00
Jordan
113c2c30f3 Note regarding case and LicenseRef
This change adds a small note to the allowlist regarding the new case
insensitivity and that the 'LicenseRef-' prefix should be removed before
adding to the allowlists.

Change-Id: I89b3c85c0f2687debd1e40c13feff73e00a0ecbd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7043444
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Jiewei Qian <qjw@chromium.org>
Commit-Queue: Jiewei Qian <qjw@chromium.org>
Auto-Submit: Jordan Brown <rop@google.com>
2025-10-14 21:48:25 -07:00
Jordan
13964577cd Improve wording of license allowlist warning
Change-Id: I57d26f8a3c36640c598eca7a7943afbb011f87b1
Bug: 452153796
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7040641
Reviewed-by: Anne Redulla <aredulla@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
2025-10-14 20:55:13 -07:00
Jordan
3008b57e5d Update license allowlist
New entries:
* Android-SDK: clank/third_party/google3/committed/third_party_notices/android_sdk_platforms/LICENSE
* Artistic-1.0-Perl: third_party/perl/licenses/License.rtf
* GUST-Font-License: ios_internal/google_internal/third_party/iosmath/LICENSE
* Public-Domain-Sigslot: third_party/rtc_base/third_party/sigslot/LICENSE

These are based on some of the issues in ios/clank that we haven't filed
bugs for yet.

Also moving these to their correct spot since they are not SPDX:
    * "Public-Domain-Gutenberg"
    * "Public-Domain-SpanDSP"

Change-Id: I67789fadd33d14da7aa81e7013825cb6b458847f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7014770
Reviewed-by: Rachael Newitt <renewitt@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
2025-10-09 20:11:05 -07:00
Jordan
4734f4d95f Expand sufficient metadata warning scope
This change removes the temporary requirement that only dependencies lacking 'Update Mechanism' would have warnings about insufficient vulnerability coverage

Change-Id: I7eceea85574cee20a5a085d46607bc5a3c97df67
Bug: 448003595
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7016933
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
2025-10-09 19:26:38 -07:00
Jordan
8c6304befd Metadata: Improve test maintainability
There are many tests checking that a certain number of warnings/errors
are shown. This change aims to make this cleaner by adding a helper to
enable more explicit testing, showing what kind of errors/warnings are
expected.

Change-Id: Ib852f889e9c9496b54e87790d0fceeb525d224d8
Bug: chromium:450416505
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7024093
Commit-Queue: Jordan Brown <rop@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Anne Redulla <aredulla@google.com>
2025-10-08 23:33:37 -07:00
Jordan
6dcf60b97d Strip LicenseRef- from licenses
Clank and ios_internal, as well as some chromium/src deps have this
prefixed in their license name as a result of using the raw value from
the license classifier.

In cases where a LicenseRef name collides with a known SPDX license, we
would expect them to have the same content. If they have additional
caveats, we expect the name to be unique.

Bug: 450137724
Change-Id: Ifd0419f719e70a5f1410fb83ea0c1fffabc634e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7014551
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
2025-10-07 22:44:54 -07:00
Jordan
b38d50f4a8 Format changes only
Change-Id: I18b808e0b02c9cff4106a4d0585c50dae194847a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7014554
Reviewed-by: Anne Redulla <aredulla@google.com>
Commit-Queue: Anne Redulla <aredulla@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
2025-10-07 20:59:55 -07:00
Jordan
88b3c4e0b1 Exclude internal deps from versioning requirement
Bug:b/449859271
Change-Id: I1b1d53e4c3f6a2c70d761342b0b030a19242157a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7005408
Reviewed-by: Anne Redulla <aredulla@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
Commit-Queue: Anne Redulla <aredulla@google.com>
2025-10-07 01:13:43 -07:00
Jordan
e4185d003f Add dtoa license
LICENSE is in use in webrtc for fft:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/third_party/fft/LICENSE

go/lican shows it as dtoa, which is a 'notice' license.

It is also a valid spdx id https://spdx.org/licenses/dtoa

Change-Id: Id617e50068892b10e42433b525b74712698e113c
Bug: 421989416
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7005870
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Anne Redulla <aredulla@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-10-02 21:47:03 -07:00
Jordan
3f15de2ac3 Add Update Mechanism: Autoroll.GoogleManaged
Forked open-source projects stored in internal Google repos, which then
get pulled into ios_internal.

They have an external upstream, but we use the Google managed fork for
ios_internal

Change-Id: Ib2cd05414f31fd7e44f1222620880c2edbaac7e8
Bug: 448767146
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7005823
Commit-Queue: Jordan Brown <rop@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Jiewei Qian <qjw@chromium.org>
2025-10-01 21:52:54 -07:00
Jordan Brown
49ffe22ecd Add a warning for insufficient metadata for vulnerability scanning.
This change introduces a `ValidationWarning` when a dependency lacks
sufficient metadata for vulnerability scanning. The warning asks
developers to provide one of the following combinations:
- 'CPEPrefix' with a version.
- A git clonable 'URL' and a 'Revision'.
- A git clonable 'URL' and a 'Version' matching the git tag.
- A package manager 'URL' and a 'Version'.

To reduce noise, this initial change is limited to dependencies that
meet the following criteria:
* Shipped; and
* Security Critical; and
* Do not provide 'Update Mechanism'

It is expected to affect about a dozen dependencies.

This change also updates some tests to be more specific to their test
cases so they don't fail for unrelated changes (like this one).

Bug: 438384123
Bug: 448003595
Change-Id: Ib1c562230b530a183e882efb1b23238b0ce0587c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6999547
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
2025-09-30 16:23:58 -07:00
Jordan Brown
675a3a9ccd Add Maven as identifiable package manager
These are the same identifiers used to identify Maven repositories in
internal scanners.
Bug: 438383466, 446990546
Change-Id: Ic00be8f96d28a63efaa09352007adb39a0328bae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6976602
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
2025-09-28 23:14:23 -07:00
Jordan Brown
20ce2373dd Fix: Use f-string for validation warning message.
The warning message for missing autoroll exception link was not
correctly interpolating `self._name` because it was missing the `f`
prefix.

Bug:b/442963176
Change-Id: I0dfaf8aa3d1238ebbbd9bb097be53e18daa1916c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6915079
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Andrew Mitchell <mitchella@google.com>
Commit-Queue: Andrew Mitchell <mitchella@google.com>
2025-09-04 00:26:37 -07:00
Jordan
f916887e12 Checking for package managers in vuln sufficiency.
This improves our alignment of vuln scan sufficiency with the scanners
we are using, based on the data extracted from README.chromium files.
Other package managers are being covered based on their manifest files.

This change splits "sufficient:URL and Version" into:
* "sufficient:Git URL and Version"; and
* "sufficient:Package Manager URL and Version"

Bug: 438384047
Change-Id: Ia3262b93092cad40e60243158e437f65a04e1916
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6905113
Reviewed-by: Anne Redulla <aredulla@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-09-03 23:01:57 -07:00
Jordan
f01b22f782 Improving vuln scan sufficiency heuristics
* Centralised CPE/Version checking to reuse logic.
* Basic check that a url contains git, googlesource, or 'bitbucket etc to indicate it's a clonable url which is required to count as sufficient.
This brings the category closely in alignment with AutoVM, removing 100
dependencies, all of which did not have vulnerability cover.

Bug:b/438384047
Change-Id: I7483f20a177670ad1d6571ffcc2545c0faddd892
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6904943
Commit-Queue: Jordan Brown <rop@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Anne Redulla <aredulla@google.com>
2025-09-01 22:37:02 -07:00
Jordan
7e5f7cbec7 Changing CPE/Version to Warning
Bug: 441973518
Change-Id: I74ced62da409b25eed88070d473b79bd06655b82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6903326
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Jordan Brown <rop@google.com>
2025-09-01 00:39:30 -07:00
Jordan Brown
0699a53d84 Add validation for CPEPrefix and Version fields.
This change introduces a new validation rule: if a `CPEPrefix` is
provided but does not contain a version component, the `Version` field
must be present in the metadata. A helper function
`has_version_component` is added to `cpe_prefix.py` to check for a
version within a CPE string. Tests are added to cover the new validation
logic and the `has_version_component` function.

Bug: 438383649
Change-Id: I69938959316051d31f7fec32c5293d2c4c1a8e2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6898421
Reviewed-by: Jiewei Qian <qjw@chromium.org>
Commit-Queue: Jordan Brown <rop@google.com>
2025-08-29 02:26:20 -07:00
Jordan Brown
dd6e72e968 Update the dependency sufficiency logic to allow for Revision:DEPS.
Change-Id: I8b54ce99829769482f356a276b3bfd3e81704708
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6773316
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
2025-07-20 20:44:09 -07:00
Jordan Brown
e1e23c1e27 Update license allowlist
Adding generic 'Public Domain' for dependencies that only provide brief licenses like 'this is for use in public domain'. If the license classifier tool identifies a license, then that value should be used instead of this.

Change-Id: I42c9bc3eec7f91910645db3f8ae74d23d88e83da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6768430
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
2025-07-17 21:07:44 -07:00
Jordan Brown
0d6837383d Fixed bug in depot_tools presubmit
Potential to call None.lower() when doing 'vuln_scan_sufficiency'

Change-Id: I55e7f207612337ff18f5799d0366e89ecfa98b32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6711769
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Jiewei Qian <qjw@chromium.org>
Commit-Queue: Jiewei Qian <qjw@chromium.org>
2025-07-07 22:36:07 -07:00
Jordan Brown
ea4e2d4117 vuln_scan_sufficiency: Ignore internal/canonical
Change-Id: Ie0dc496abc955163364feeb198881a9b58c825d3
Bug: 429937921
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6711768
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
2025-07-07 21:09:22 -07:00
Jordan Brown
ab22114f1f Allow "Google Internal" in url field
This change adds support for an "Internal" label in the "URL" custom
metadata field. When this label is used, the dependency will be not be
required to provide sufficient metadata for vulnerability coverage.

Change-Id: I747d53934b5ebe3cf4a17fc2aab2de6a9ac2c1dd
Bug: 429937921
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6706140
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-07-07 20:42:15 -07:00
Jordan Brown
1b7c452940 Add Vuln scan sufficiency to metadata.
This property helps determine if the data available in metadata is sufficient to do vulnerability scanning.

Change-Id: I7cead6ca7eacf3184f6afa0a77b48fb2439f9fa9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6706867
Auto-Submit: Jordan Brown <rop@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
2025-07-07 18:56:39 -07:00
Jordan Brown
838762e3ae Improve Update Mechanism bug link validation
Includes parsing the bug number and returning a standard format e.g.
`https://crbug.com/421989967`

Bug: 421989967
Change-Id: I4e159e6ab8ddd1d6fb253a360db8b48ee5a68c1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6669073
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
2025-06-24 23:27:22 -07:00
Jordan
d4c627ed62 Adding Update Mechanism to Presubmit validation.
Bug: b/417367156
Change-Id: I3d12566ecf3c4d6d8d42c509fceb847fa5248776
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6606603
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-06-12 01:35:35 -07:00
Ramin Halavati
f810dae272 Add two items to licenses allow list.
Add the following two items to the licenses allow list as dependencies
of ScreenAI:
 - LicenseRef-MicrosoftEnterpriseWindowsDriverKit
 - LicenseRef-Public-Domain-Gutenberg

Bug: 378472917
Change-Id: I4f8786fb9880a61dcb379b57e0ead3d3ae9cff41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6529681
Commit-Queue: Jordan Brown <rop@google.com>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: Jordan Brown <rop@google.com>
2025-05-14 22:58:45 -07:00
Jordan Brown
a60883e901 metadata: Fix metadata validator error reporting
Validate errors should be returned as errors (as warnings are ignored), not warnings

Once the following CL's have been submitted there will be 0 presubmit errors or warnings.
* https://crrev.com/c/6284506
* https://crrev.com/c/6296486
* https://crrev.com/c/6290266
* https://crrev.com/c/6296606
* https://crrev.com/c/6297263
* https://crrev.com/c/6296425
* https://crrev.com/c/6290667
* https://crrev.com/c/6287813
* https://crrev.com/c/6289887
* https://crrev.com/c/6290124



Bug: 285453019
Change-Id: I3448435dcb0505722a2c68476ef9d752a6614533
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6296579
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
2025-02-25 16:11:34 -08:00
Jordan Brown
feeac124f2 Make custom.license_file validation error a warning, not a hard error.
This is because the linux-presubmit ci job does not run with all
dependencies checked out. See bug for details.

Bug: 398970704
Change-Id: Ia562cc6de7e586f947ccc9d351e9fc5feafa9f22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6300962
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-02-24 19:56:35 -08:00
Jordan
e803e2cb4b Adding 'Patent' to WITH_PERMISSION_ONLY
Ideally we would track these separately but practically they fall into
the same category as the restricted license. It is on the OWNERS and the
reviewers to make sure that they comply with the terms of a Patent file
or any license. Currently we are just generating presubmit warnings that
are being ignored.

This will also enable future tooling that utilises this list for
auditing restricted licenses to surface Patent files.

Bug: 381146326
Change-Id: I0f091bef9649d3a9f7b03940c8634e56bee9541f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6290872
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-02-23 16:23:24 -08:00
Jordan Brown
ec894dd8c0 Support 'Refer to additional_readme_paths.json'
This is used by some README.chromium to reference transitive
dependencies, and is supported by licenses.py[0]

[0]
https://source.corp.google.com/h/chrome-internal/codesearch/chrome/src/+/main:tools/licenses/licenses.py;l=131-134

Bug: 398668341
Change-Id: Iac15b001614e7afa6eab981deaaf3d4aa5020d66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6296123
Auto-Submit: Jordan Brown <rop@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
2025-02-23 16:23:21 -08:00
Ramin Halavati
ab387d1ddc Add items to license allowlist.
Add the following items to the allowlsted licenses based on the
requirement of crrev.com/c/6239492 :
 - PngSuite
 - Spencer-86
 - unicode_org

Bug: 378472917
Change-Id: I6dfa79d612131eae154e5030ec22b787ebc57060
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6243133
Commit-Queue: Jordan Brown <rop@google.com>
Auto-Submit: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: Jordan Brown <rop@google.com>
2025-02-19 19:00:24 -08:00
Jordan Brown
9e4336f5fb Adding 0BSD and Python-2.0 to allowlist
These are both in use in chromium:
* xzutils [0] uses 0BSD and is available at https://spdx.org/licenses/0BSD
* argparse [1] uses Python-2.0 and can be found at https://spdx.org/licenses/Python-2.0

xz's provided license file needs to be updated to include the 0BSD
license, and argparse doesn't include a license file, but these are
separate issues.

[0]
https://crsrc.org/c/chrome/installer/mac/third_party/xz/README.chromium
[1]
https://source.chromium.org/chromium/chromium/src/+/main:third_party/js_code_coverage/README.chromium;l=56-72

Change-Id: Ib3671a496ac4819db80c844bd15e5f4bf0da9160
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6188506
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Jordan Brown <rop@google.com>
Reviewed-by: Bill Wendling <morbo@google.com>
2025-02-09 19:20:37 -08:00
Jordan Brown
e42fac3e9c [dependency_metadata] Allow descriptions for CVEs
This adds a new way to report CVEs that includes an accompanying
description. It also adds a new validation check that ensures that the
CVE description is present for every entry listed in the 'Mitigated:'
field.

Bug: b/392026683
Change-Id: Ie55595970b49d705ac532f1f8c41ff47d959f56c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6211644
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Jiewei Qian <qjw@chromium.org>
Commit-Queue: Jiewei Qian <qjw@chromium.org>
2025-02-03 17:18:27 -08:00
Jordan Brown
98b7273c8d Add custom Mitigated field
This field stores a list of comma-separated CVE IDs that the dependency mitigates.

The field is validated to contain only valid CVE IDs.


Bug: b/392026683
Change-Id: I9578fc709086131695cfa7eee51e717c24440853
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6197756
Reviewed-by: Jiewei Qian <qjw@chromium.org>
Commit-Queue: Jordan Brown <rop@google.com>
2025-02-02 16:58:24 -08:00
Jordan Brown
a4131b9447 Silence WITH_PERMISSION_ONLY warnings
Currently using a license in the WITH_PERMISSION_ONLY list will create a
warning. By making an ALL_LICENSE list including this list and also
allowing it when checking for open source compatible licenses, it will
no longer create warnings.

This will enable us to change the current warnings into errors.

Bug: b/388620886
Change-Id: I883a3d3c825f0f1903b62d0b93810218b1f42bb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6188501
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
2025-01-21 19:56:12 -08:00
Jordan Brown
40e4ea3b09 Add 'Android Software Development Kit License' to allowlist.
Adding a special entry for dependencies using this license id.
The Android Software Development Kit License is a special case.
It can introduce licensing complexities due to the potentially extensive
transitive dependency chain. Developers should carefully review the
licenses of all dependencies.

Change-Id: I8626391ce04f921a9efa519a5305afce62a5f1c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6174215
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-01-20 16:46:44 -08:00
Jordan Brown
9748dcdb1a Add clear documentation to license_allowlist.py
The documentation aims to cover how to make, and review changes to this file.

Change-Id: I887ce938df71119f5d04f7cec30350beddcdef47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6168292
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Nico Weber <thakis@google.com>
Reviewed-by: Rick Byers <rbyers@chromium.org>
2025-01-20 16:22:19 -08:00
Jordan Brown
9fbf88b06f Presubmit error for bad delimiters
This change introduces a new error for license fields that use any of
the following `["/", ";", " and ", " or "]`.

I chose to include the offending character/s in the error message
because I find it easier to parse error messages that tell me exactly
which character is the bad one. Similarly I've included conditions in
the reason to handle the plural cases correctly, generating either:

`License contains a bad delimiter character ...`, or
`License contains bad delimiter characters ...`

I realise this means that any downstream rules looking to detect this
error will need to check for a common subset, e.g 'bad delimiter
character', however I think it's worth it for the improved user
experience of receiving the error.

I've also anticipated that most of these errors will be due to
situations where multiple licenses are offered, and included additional
text explaining that only the most permissive of the choices should be
included.

This will affect 9 dependencies and they need to choose between multiple licenses anyway so it's okay to generate an error and have partybug file bugs.

Bug: http://b/374850412
Change-Id: I6eb53a8a3bd541a1801dff133884b719dcdfe04d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6181848
Reviewed-by: Jiewei Qian <qjw@chromium.org>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-01-20 16:18:35 -08:00
Ramin Halavati
ea75de4c3b Add 3 items to allowlisted licenses.
Adds "BLAS", "LicenseRef-base64-cpp", and "SolarDesigner", to the allow
listed licenses.

Bug: 365320654
Change-Id: Id156b2cc881167e4dac88a9e671b21e5de8263bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6172448
Reviewed-by: Jordan Brown <rop@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-01-16 22:42:53 -08:00
Jordan Brown
a912cd245b Adding WITH_PERMISSION_ONLY list to allowlist
There is a TODO to add the functionality of creating the warnings.

Change-Id: I1841007158b130a06db22647b1ba50bbaca84b57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6168291
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-01-12 21:25:49 -08:00
Jordan Brown
499afe8357 Sort entries by name in allowlist files.
This makes the allowlist files easier to read. It also prevents accidental changes when adding new entries.

Note that this CL does not modify the actual entries. A duplicate of ISC was removed.

Change-Id: Id64e64dbc934af1b412fce0e0c7c34a8d7b4c5f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6168290
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
2025-01-12 21:19:31 -08:00
Jordan Brown
fd65288d4a Add is_open_source_project to metadata validation
Reciprocal licenses can only be used in open source projects.
This change updates the presubmit validation checks to accept an
optional flag `allow_reciprocal_licenses`. When True, the allowlist is
extended to include reciprocal licenses.

Bug: 385020146
Change-Id: I0374658207bc87ffd74e033762ee4973c6e83b3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6107863
Reviewed-by: Jordan Brown <rop@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
2025-01-12 14:07:21 -08:00
Jordan Brown
af68505dfe Add an open source only licenses set.
This is a list of licenses classified as 'reciprocal'. Due to the requirements of licenses of this type we can only allow their use in open source projects. This change introduces the variable 'OPEN_SOURCE_SPDX_LICENSES' with an initial set of reciprocal licenses currently used in chromium.

Change-Id: I376a7623e3685d67edd63ceb3088ca68c9d2fb7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6107860
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
2025-01-08 23:54:11 -08:00