Skip to content

[JENKINS-54601] Include security fixes from 1.9.40 in 1.7.24.X #3

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

Merged
merged 19 commits into from
Nov 20, 2018

Conversation

varyvol
Copy link

@varyvol varyvol commented Nov 15, 2018

JENKINS-54601

  • Gather security fixes from 1.9.40
  • Change parent POM
  • Script and instruction to test/release with Docker (thanks @batmat).

Both PCT and OSS ATH was executed without any detected failure.

@batmat @oleg-nenashev @dwnusbaum @stephenc

@varyvol varyvol changed the title Jenkins 54601 [JENKINS-54601] Include security fixes from 1.9.40 in 1.7.24.X Nov 15, 2018
run-maven-env.sh Outdated

if [ -f "$MAVEN_SETTINGS_SECURITY" ]
then
echo "Using $MAVEN_SETTINGS_SECURITY file found."
Copy link
Member

Choose a reason for hiding this comment

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

Better remove 'Using' or 'found'? It sounds weird to me 'Using settings-security.xml file found'

Copy link
Author

Choose a reason for hiding this comment

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

Agree. Changed.

Copy link
Member

@fcojfernandez fcojfernandez left a comment

Choose a reason for hiding this comment

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

Code looks to me and also it's picked from https://github.com/AsyncHttpClient/async-http-client/
I have no enough context to review it from a functional PoV

RELEASE.adoc Outdated
= How to release this in Jenkins environment

See the `run-maven.sh` shell script to run a Docker container with the right environment.
Then, if you already have the right Maven settings.xml files, you should be able to

Choose a reason for hiding this comment

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

NIT: Maven settings.xml files-> maven settings*.xml files or maven settings files or maven setting.xml file if you are referring only to this one

Copy link
Author

Choose a reason for hiding this comment

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

Changed!

@@ -467,6 +447,17 @@ public boolean isValid() {
* @return the {@link HostnameVerifier}
*/
public HostnameVerifier getHostnameVerifier() {
if (hostnameVerifier == null) {
synchronized (this) {
if (hostnameVerifier == null)

Choose a reason for hiding this comment

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

A { will be helpful

Copy link
Member

Choose a reason for hiding this comment

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

IMO, since this repo is to fix security vulnerabilities and we are backporting the fix, I wouldn't change the code to ease future backports

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I prefer not to touch code that is coming from the library directly.

Copy link
Member

Choose a reason for hiding this comment

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

+1 to @varyvol and @fcojfernandez in this case

/**
* Set the maximum time in millisecond an {@link com.ning.http.client.AsyncHttpClient} can wait when connecting to a remote host
*
* @param defaultConnectionTimeOutInMs the maximum time in millisecond an {@link com.ning.http.client.AsyncHttpClient} can wait when connecting to a remote host

Choose a reason for hiding this comment

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

change the param name to connectTimeout

/**
* Set the maximum time in millisecond an {@link com.ning.http.client.AsyncHttpClient} can stay idle.
*
* @param defaultIdleConnectionTimeoutInMs

Choose a reason for hiding this comment

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

Ditto for all param javadocs

Copy link
Author

Choose a reason for hiding this comment

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

Changed!

@@ -1043,6 +1051,11 @@ public Builder setMaxConnectionLifeTimeInMs(int maxConnectionLifeTimeInMs) {
return this;
}

public Builder setAcceptAnyCertificates(boolean acceptAnyCertificate) {

Choose a reason for hiding this comment

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

Add javadoc as other setters?

Copy link
Author

Choose a reason for hiding this comment

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

This is coming from the library directly, that's why.

Copy link

@MRamonLeon MRamonLeon left a comment

Choose a reason for hiding this comment

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

AFAIU

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Although it is a formally breaking change, I do not see any usages of changed classes inside the jenkinsci organization. It does not fully guarantee that there will be no impact on Jenkins, because any transitive dependency within GitHub may also include dependency on Asynch HTTP Client. And we cannot be 100% for sure.

Why do I request changes in this pull request?

  • The README.md in the repository is confusing. The changed is not tested on Travis CI as the README suggests. I either request setting up a flow on Travis/Jenkins or removing the the mention of CI
  • RELEASE.adoc is not linked from README.adoc. IMO README.adoc is confusing, because it has not been updated after the fork. I recommend to just deleting the existing content and adding a small readme explaining reasons of the fork and what's inside

It would be also great if you could add a summary of how this change was tested (to the PR description).

@@ -467,6 +447,17 @@ public boolean isValid() {
* @return the {@link HostnameVerifier}
*/
public HostnameVerifier getHostnameVerifier() {
if (hostnameVerifier == null) {
synchronized (this) {
if (hostnameVerifier == null)
Copy link
Member

Choose a reason for hiding this comment

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

+1 to @varyvol and @fcojfernandez in this case

* @param sslEngineFactory the {@link SSLEngineFactory} for secure connection
* @return a {@link Builder}
*/
public Builder setSSLEngineFactory(SSLEngineFactory sslEngineFactory) {
Copy link
Member

Choose a reason for hiding this comment

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

Was unable to find usages in Jenkins plugins. I am OK with that though I would recommend to keep a method stub which would be throwing an explicit RuntimeException that the method is removed

@@ -165,11 +166,6 @@ public AsyncHttpClientConfigBean setSslContext(SSLContext sslContext) {
return this;
}

public AsyncHttpClientConfigBean setSslEngineFactory(SSLEngineFactory sslEngineFactory) {
Copy link
Member

Choose a reason for hiding this comment

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

same as above

/**
* Factory that creates an {@link SSLEngine} to be used for a single SSL connection.
*/
public interface SSLEngineFactory {
Copy link
Member

Choose a reason for hiding this comment

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

No usages AFAICT

@@ -15,101 +15,43 @@
*/
package com.ning.http.util;
Copy link
Member

Choose a reason for hiding this comment

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

I was unable to find any usages of this class inside the jenkinsci org. Fine with me

@oleg-nenashev
Copy link
Member

Maybe we should also rename this repository to lib-async-http-client to follow the common naming pattern for libraries. CC @daniel-beck

@varyvol
Copy link
Author

varyvol commented Nov 20, 2018

@oleg-nenashev I've updated the README file.

@@ -9,31 +9,18 @@
<groupId>com.ning</groupId>
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to update the parent POM to the Jenkins Parent POM to make it follow the jenkins release flow standards. https://github.com/jenkinsci/pom

@varyvol
Copy link
Author

varyvol commented Nov 20, 2018

@oleg-nenashev used https.

Copy link
Member

@fcojfernandez fcojfernandez left a comment

Choose a reason for hiding this comment

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

Better indentation now!

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

The code itself looks good to me

Did you have a chance to process this comment?

Maybe we should also rename this repository to lib-async-http-client to follow the common naming pattern for libraries.

@varyvol
Copy link
Author

varyvol commented Nov 20, 2018

Yes, but unsure on the answer. I thought that was already contemplated on the HOSTING request. I can raise a ticket if that is the usual naming pattern. Anyway I guess this is independent from the PR.

@oleg-nenashev
Copy link
Member

Yes, but unsure on the answer. I thought that was already contemplated on the HOSTING request. I can raise a ticket if that is the usual naming pattern. Anyway I guess this is independent from the PR.

Yes, it is independent. Would be nice to discuss it before the release

@varyvol varyvol merged commit 20b3885 into jenkinsci:1.7.x Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants