-
Notifications
You must be signed in to change notification settings - Fork 24
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
[artifact-manager] (#331) Fix CRITICAL and HIGH level vulnerabilities #420
Conversation
common/artifact-manager/src/main/java/com/vmware/pscoe/iac/artifact/rest/RestClientVrops.java
Dismissed
Show resolved
Hide resolved
@bcpmihail, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
1 similar comment
@bcpmihail, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
6419fc2
to
f7a845e
Compare
Wow, so this is great effort and a great job. Honestly, The only problem is that there are so many irrelevant changes in the form of convention and formatting, that the important ones get easily lost. I am not sure I can do a good review of this :/ Tests are passing, and they are unchanged, outside some imports, so that is good and pretty much good enough. Not sure why but again no matter what IDE I use Java dev on BTVA is.... something else... Trying to resolve that and will continue my efforts |
Shall I overwrite the git history to separate the style changes (formatting) from the rest for better readability? You'll need to review commit by commit afterwards. |
Currently addressing the codeql issues (mainly adding Javadoc comments) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't looked fully at the primitives and the clients, but let's fix the Config part, and we'll worry about that later. If you agree, of course.
Map<String, List<Artifact>> artifactsByType = allArtifacts.stream().collect(Collectors.groupingBy(Artifact::getType)); | ||
|
||
private void importArtifacts(Collection<Artifact> allArtifacts) | ||
throws MojoExecutionException, ConfigurationException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
God, this ConfigurationException seems like a complete mess... Can't we do ConfigurationException extends RuntimException
and be done with it?
PackageStore<?> store = getConfigurationForType(PackageType.fromExtension(type.getKey())) | ||
.flatMap(configuration -> Optional.of(PackageStoreFactory.getInstance(configuration))).orElseThrow(() -> new ConfigurationException( | ||
"Unable to find PackageStore based on configuration. Make sure there is configuration for type: " + pkgType.name())); | ||
.flatMap(configuration -> PackageStoreFactory.getInstanceWrapped(configuration)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get it, the whole idea behind getInstanceWrapped. TBF, I prefer it (using RuntimeException), :D Can't we do it everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just desperate to clean up this "Error Propagation" or whatever you want to call it
* @param <T> The configuration type. | ||
* @return The PackageStore instance as Optional. | ||
*/ | ||
public static <T extends Configuration> Optional<PackageStore<?>> getInstanceWrapped(T configuration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool change!
Also forgot to mention. Let's ignore the linter. Let it complain. Last thing we want is more to this PR. |
Signed-off-by: Mihail Penchev (c) <[email protected]>
Using latest springframework, jackson versions in artifact-manager. Upgraded apache httcomponents to httpcore5 5.3 and httpclient5 5.3. Signed-off-by: Mihail Penchev (c) <[email protected]>
Signed-off-by: Mihail Penchev (c) <[email protected]>
…3 and httpclient5 5.3.1 Minor changes to accomodate the new APIs. Signed-off-by: Mihail Penchev (c) <[email protected]>
Signed-off-by: Mihail Penchev (c) <[email protected]>
Signed-off-by: Mihail Penchev (c) <[email protected]>
f7a845e
to
0a5efee
Compare
0a5efee
to
6dde3d1
Compare
Changed ConfigurationException to inherit from RuntimeException. |
6dde3d1
to
7c050b1
Compare
Ignored checks for Javadoc comments, DesignForExtension Signed-off-by: Mihail Penchev (c) <[email protected]>
2c648cc
to
a6b49cb
Compare
Addressed linter issues* and reverted changes to sun_checks.xml. |
Can you sync with master @bcpmihail. |
@bcpmihail, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
1 similar comment
@bcpmihail, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
Signed-off-by: Mihail Penchev (c) <[email protected]>
b279c10
to
42dea9d
Compare
@Michaelpalacce Done |
Description
Trivy identified critical and high level vulnerabilities in the spring framework and snakeyaml dependencies for artifact-manager.
These were resolved by using the latest versions of com.fasterxml.jackson (of which snakeyaml is a transitive dependency) and org.springframework; this required upgrading org.apache.httpcomponents to 5.3, affecting:
After the upgrade, no more critical or high level vulnerabilities were detected by trivy.
Checklist
Fixed #XXX -
orClosed #XXX -
prefix to auto-close the issueTesting
Builds and deploys test project successfully to environment.
Related issues and PRs
#331