Laser Hawk
Laser Hawk

Reputation: 2028

Jenkins and Cisco Anyconnect on OS X server

I have a customer that is using Cisco's Anyconnect as a vpn client in front of the repository I need to pull from. I am trying to find out if Jenkins has a plugin for Cisco's Anyconnect or a solution to get the automation past it? I suggested that the repository be mirrored to my github, but that has not happened yet.

Is there a way to install Cisco Anyconnect from the command line and have a shell script pass the credentials?

Upvotes: 1

Views: 717

Answers (1)

Electrawn
Electrawn

Reputation: 2254

I use vpnc. On some maven builds I have Pre and Post Steps, for any builds I can do execute shell and rearrange the order.

I would highly recommend installing vpnc via RPM or some easy installer. Configurations are in /etc/vpnc/

Sample Cisco PROD.conf file

IPSec gateway 172.0.0.1
IPSec ID admin
IPSec secret 12345ABC
Xauth username jenkins
Xauth password hunter2

You have to have disable RSA tokens if using this process. Keep in mind this file should only be owned by root at 600 permission level.

Add this to /etc/sudoers:

jenkins     ALL= NOPASSWD:/usr/local/sbin/vpnc*

In some situations VPNs will cause absolute havoc with other jobs on the server. Consider running on an exclusive slave or change your jenkins executor to one.

Pre Script:

 echo "Stopping VPN.\n";
 sudo /usr/local/sbin/vpnc-disconnect || true;
 echo "Starting VPN to (Production datacenter).\n";
 sudo /usr/local/sbin/vpnc prod;

Post Script:

echo "Stopping VPN.\n";
sudo /usr/local/sbin/vpnc-disconnect || true;

Upvotes: 1

Related Questions