Skip to content
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

Add sha256 and sha256_src attributes to maven_jar #9237

Closed
wants to merge 2 commits into from

Conversation

jin
Copy link
Member

@jin jin commented Aug 23, 2019

..and print warnings if sha256 or sha256_src aren't used, like this:

WARNING: /usr/local/google/home/jingwen/code/copybara/WORKSPACE:192:1: maven_jar rule @junit//jar: Not using a checksum to verify the integrity of the artifact or the usage of SHA-1 is not secure (see https://shattered.io) and can result in an non-reproducible build. Please specify the SHA-256 checksum with: sha256 = "90a8e1603eeca48e7e879f3afbc9560715322985f39a274f6f6070b43f9d06fe",

WARNING: /usr/local/google/home/jingwen/code/copybara/WORKSPACE:192:1: maven_jar rule @junit//jar: Not using a checksum to verify the integrity of the artifact or the usage of SHA-1 is not secure (see https://shattered.io) and can result in an non-reproducible build. Please specify the SHA-256 checksum with: sha256_src = "694f4694a51f67dadea4d2045742d38fb4efb92d82d42744b15e26ce653bcd3e",

The warning message is designed to be copy paste-able directly into the WORKSPACE file.

#6799
#8880

RELNOTES: Added sha256 and sha256_src attributes to maven_jar. Please consider migrating to SHA-256 as SHA-1 has been deemed cryptographically insecure (https://shattered.io). Or, use rules_jvm_external to manage your transitive Maven dependencies with artifact pinning and SHA-256 verification support.

Change-Id: I7e9003f373f99bedbf44e9fac4999c25b78c437a
@jin jin added the team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. label Aug 23, 2019
@jin jin marked this pull request as ready for review August 23, 2019 23:19
Change-Id: I17ef2f88911efbb4527303b1dc1bcb827cc5e308
Copy link
Contributor

@aiuto aiuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to see this. When I saw your change for not https+sha1j a few days ago I found it incredible that we only has sha1 hashes for maven. I was going to ask you about it.

This looks great. Just nits about wording. I believe we do people a favor by not "suggesting" they swtich, but telling them they must switch.

<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("sha1", Type.STRING))
/* <!-- #BLAZE_RULE(maven_jar).ATTRIBUTE(sha1_src) -->
A SHA-1 hash of the desired jar source file.
A SHA-1 hash of the desired jar source file. Please consider using 'sha256_src' instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don''t know if we need the "please" in all of these. This is a strong recommendation and my hunch is we will fully remove sha1 in 2.0. I think you are fine with
"A SHA-1 hash of the desired jar source file. (Deprecated: use sha256)"

@aiuto aiuto self-assigned this Aug 26, 2019
@bazel-io bazel-io closed this in bc9ff0c Aug 26, 2019
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
@philwo philwo removed the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants