fosstars-rating-core icon indicating copy to clipboard operation
fosstars-rating-core copied to clipboard

Better checks for signed artifacts in the security ratings

Open artem-smotrakov opened this issue 3 years ago • 2 comments

Currently, SignsJarArtifacts data provider check whether or not a project use a plugin that signs artifacts. However, some projects don't use such plugins. For example, https://github.com/spring-projects/spring-security However, there are PGP signatures for its artifacts

https://repo1.maven.org/maven2/org/springframework/security/spring-security-core/5.5.0/

It may be better if the data provider checked if signatures exists instead of looking for plugins.

artem-smotrakov avatar Jun 21 '21 09:06 artem-smotrakov

@artem-smotrakov There are few things to consider

  • To identify if an artifact is signed with PGP signatures, we need to get the .asc.
  • If I am checking the whole GitHub project, I would have to parse through all the version folders in the maven repo and then check if a .asc file exists with the content for the GitHub project.
-----BEGIN PGP SIGNATURE-----
...
-----END PGP SIGNATURE-----
  • If a .asc file does exist, do we have to make sure that all the jars in a artifact version https://repo1.maven.org/maven2/org/springframework/security/spring-security-core/5.5.0/ also has an associated .asc file?
  • Please clarify if my understanding is correct.

sourabhsparkala avatar Sep 01 '21 07:09 sourabhsparkala

@sourabhsparkala

  • If I am checking the whole GitHub project, I would have to parse through all the version folders

I think it is enough to check a few latest versions.

  • If a .asc file does exist, do we have to make sure that all the jars in a artifact version https://repo1.maven.org/maven2/org/springframework/security/spring-security-core/5.5.0/ also has an associated .asc file?

If a signature doesn't exist, then the jar is not signed. It's better to check the docs anyway.

A few more things to consider here:

  • A jar file can be signed by jarsigner, then the signature will be in the jar's manifest.
  • It would be good to support other artifact types, not only jar files.

artem-smotrakov avatar Sep 04 '21 15:09 artem-smotrakov