[JIRA] (JENKINS-61193) When using proxy also export the no_proxy hosts.

13 views
Skip to first unread message

timboeckstaens@hotmail.com (JIRA)

unread,
Feb 24, 2020, 3:25:04 AM2/24/20
to jenkinsc...@googlegroups.com
Tim B created an issue
 
Jenkins / Improvement JENKINS-61193
When using proxy also export the no_proxy hosts.
Issue Type: Improvement Improvement
Assignee: Mark Waite
Components: git-client-plugin
Created: 2020-02-24 08:24
Environment: Jenkins ver. 2.190.1
Git client 3.0.0
Priority: Minor Minor
Reporter: Tim B

The code in CliGitApiImpl will put the http_proxy and https_proxy variables in the env when a proxy should be used.
The relevant code can be found here:
https://github.com/jenkinsci/git-client-plugin/blob/master/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L2014

In our concrete case we are using CodeCommit as git repository. Jenkins is running on an AWS EC2 instance which is configured with a Role that has the required allowed actions.
For this to work we use the codecommit credential-helper. This credential helper will handle the required authentication/authorization steps. One of these steps involves calling the local IP 169.254.169.254
Setup of this credential-helper can be found: https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-unixes.html

This EC2 also runs inside a subnet with no default route and needs to use a forward proxy.

Now when we configure the proxy inside Jenkins the git plugin will set the http_proxy and https_proxy. By doing this the credential helper's call to the IP 169.254.169.254 will also be sent over the proxy. Which shouldn't happen.

Now if NO_PROXY would be set with the list of the "No Proxy Host" field, it would work. As the credential-helper would not use the proxy to call the IP 169.254.169.254.
This can also be found in the AWS documentation: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-proxy.html#cli-configure-proxy-ec2

Would it be possible to alter the code so that after

env.put("http_proxy", http_proxy.toString());
 env.put("https_proxy", http_proxy.toString());

The no_proxy would also be set?

 env.put("no_proxy", listOfConfiguredNoProxyHosts);
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 24, 2020, 3:06:02 PM2/24/20
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
Change By: Mark Waite
Assignee: Mark Waite

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 24, 2020, 3:07:02 PM2/24/20
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
Labels: newbie-friendly

gyaneshaprajjwal@gmail.com (JIRA)

unread,
Feb 25, 2020, 3:39:06 AM2/25/20
to jenkinsc...@googlegroups.com
Gyanesha Prajjwal commented on Improvement JENKINS-61193
 
Re: When using proxy also export the no_proxy hosts.

I would like to contribute on this.

 

gyaneshaprajjwal@gmail.com (JIRA)

unread,
Feb 25, 2020, 10:35:02 PM2/25/20
to jenkinsc...@googlegroups.com

gyaneshaprajjwal@gmail.com (JIRA)

unread,
Feb 26, 2020, 4:04:02 AM2/26/20
to jenkinsc...@googlegroups.com
 
Re: When using proxy also export the no_proxy hosts.

Sir, I have made a pull request kindly look into it.

gyaneshaprajjwal@gmail.com (JIRA)

unread,
Mar 5, 2020, 5:43:02 AM3/5/20
to jenkinsc...@googlegroups.com

I have added a commit, please verify it.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

gyaneshaprajjwal@gmail.com (JIRA)

unread,
Mar 18, 2020, 3:07:02 AM3/18/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages