If you use Cisco's VPN solution, AnyConnect, to connect to VPN into your corporate network, you know how the process goes:
Then, if your company uses MFA (Multi Factor Authentication) to strengthen the authentication process - like Cisco Duo, this happens:
These steps alone can waste up to 10 minutes of your time, in case of a non-optimal internet connection.
Now consider your credentials, in particular your password. If you are a security-concious person, or your company set a strong password policy, you might find yourself having to type something like 6k^lW7$ZDsdlQL&B
every time you want to connect to the VPN, which might happen a few times during the day.
The whole process is prone to erros and waste of time. So what can you do?
Security should not come at the price of ease of use, and the same should be true the other way around.
The simpler something is to use, the more secure it is.
This automation script is built on top of these concepts.
The repository contains the source code of the script that will automate the connection and authentication process of Cisco AnyConnect VPN with Duo.
The script automatically fetches, securely from the KeyChain, the correct credentials and setup the VPN connection. If Duo is used as MFA, a notification will be sent to your device. Once you confirm the notification the connection will be completed and up and running.
These are the requirements necessary:
# How to use it?
You have two options:
Let's start with the first option: TURN IT INTO AN APPLICATION
anyconnect.scpt
with Script Editor (which is the default program used).File
, then Export...
Application
for File Format:
, and Sign to Run Locally
for Code Sign:
Once you have your application compiled and ready:
Security & Privacy System Preferences
, go to Privacy
, then Accessibility
./Users/[yourhostname]/Applications
and then to the DockNow for the second option: KEEP IT AS A SCRIPT
anyconnect.scpt
with Script Editor (which is the default program used).Script Editor
, then click Preferences
Show Script menu in menu bar
for Script Menu:
/Users/[yourhostname]/Library/Scripts
)Once you have saved the script inside your user's script folder:
Security & Privacy System Preferences
, go to Privacy
, then Accessibility
.Script Menu
Script Editor
. This is required if you want to run the script from the Script Editor.If you are a Cisco employee, you can simply update the code as follows:
42
to: set inString to "blizzard"
mrossi@cisco.com
, then simply update line 43
to: set username to "mrossi@cisco.com"
Owner
Contributors
Categories
Products
DuoProgramming Languages
AppleScriptLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community