sshGate
WWW.LINAGORA.COM
sshGate WWW . LINAGORA . COM Plan I. S ERVER ACCESS PROBLEMS SSH G - - PowerPoint PPT Presentation
sshGate WWW . LINAGORA . COM Plan I. S ERVER ACCESS PROBLEMS SSH G ATE PRESENTATION II. III. SSH G ATE INTERNAL T HURSDAY , J ULY 28 TH , 2011 P AGE 2 / 35 About me Patrick GUIRAN T HURSDAY , J ULY 28 TH , 2011 P AGE 3 / 35 Plan I. S ERVER ACCESS
WWW.LINAGORA.COM
II. SSHGATE PRESENTATION
THURSDAY, JULY 28TH, 2011 PAGE 2 / 35
About me
PAGE 3 / 35 THURSDAY, JULY 28TH, 2011
Patrick GUIRAN
II. SSHGATE PRESENTATION
THURSDAY, JULY 28TH, 2011 PAGE 2 / 35
I. Server access problem
PAGE 5 / 35
Information system
THURSDAY, JULY 28TH, 2011
THE ¡admin ¡
I. Server access problem
PAGE 6 / 35
Information system
THURSDAY, JULY 28TH, 2011
THE ¡admin ¡
I. Server access problem
PAGE 7 / 35
Information system
THURSDAY, JULY 28TH, 2011
THE ¡admin ¡
I. Server access problem
PAGE 8 / 35
Information system
THURSDAY, JULY 28TH, 2011
THE ¡admin ¡
I. Server access problem
§ Access with password
§ Access with keys
§ Access to the all servers
§ Even business-critical servers (mail, database)
PAGE 9 / 35
Access through different ways
THURSDAY, JULY 28TH, 2011
§ Arrival and Departure of an administrator ? § Who has access to a server ? (simple to answer) § Which server does an administrator have access to ? (complex)
§ Who grants and restricts access ?
PAGE 10 / 35
Accesses managment
user_sshkey=$( cat user-sshkey.pub ) for serveur in $( cat listserver.txt ) ; do ssh $serveur 'cat ~/.ssh/authorized_keys2?' \ | grep ${user_sshkey} >/dev/null [ $? eq 0 ] && echo ”${serveur}” done
I. Server access problem
THURSDAY, JULY 28TH, 2011
§ Must have
ü Use ssh protocol ü Use keys authentification ü No user’s keys on administrated servers ü Unified access control list (ACL)
§ Nice to have
ü Log connection’s events ü Record user’s SSH session ü Notification of administration events
PAGE 11 / 35
Our needs
I. Server access problem
THURSDAY, JULY 28TH, 2011
q Wallix AdminBastion
q Observe-it
q sshProxy
q AdminProxy
PAGE 12 / 35
Look for an existing solution
I. Server access problem
THURSDAY, JULY 28TH, 2011
§ No solution
➫ Development of de sshGate !
PAGE 13 / 35
Search Result
I. Server access problem
THURSDAY, JULY 28TH, 2011
§ Use existing tools : OpenSSH & PuTTY
§ Cross-platforms
§ No patch on sshGate server (no sshd patches) § Simple, with less dependency (no SQL-database, …)
PAGE 14 / 35
Limitations & Challenges
I. Server access problem
THURSDAY, JULY 28TH, 2011
II. SSHGATE PRESENTATION
PAGE 15 / 35 THURSDAY, JULY 28TH, 2011
PAGE 16 / 35
Global view
THURSDAY, JULY 28TH, 2011
ü Support SSH sessions & SCP file transfers ü ACL management centralization (users, groups) ü Management of server name aliases ü Multi-login support ü SSH configuration support (global and per server - login) ü Log connection’s events ü Record SSH sessions ü CLI administration interface
PAGE 17 / 35
Functionalities
THURSDAY, JULY 28TH, 2011
§ Licence : GPLv2+ § Language : Shell Script (sh, dash, bash, zsh) § Cross-platforms :
PAGE 18 / 35
Characteristics
THURSDAY, JULY 28TH, 2011
§ Born of sshGate : August 2010 § First usage in production : September 2010 § Versions :
PAGE 19 / 35
History
THURSDAY, JULY 28TH, 2011
§ Some numbers
§ Accesses
§ During the 6 last months
PAGE 20 / 35
sshGate usage at Linagora
THURSDAY, JULY 28TH, 2011
§ DOS : flood logs until disk full
One solution : if the growth velocity of big logfile is too high, kill the connection
§ It’s possible to hide some commands
This is not a bug. sshGate doesn’t log keyboard events, and will never do it !
PAGE 21 / 35
Known bugs
user@host $ read s var
user@host $ eval "${var}" # Ouch !
THURSDAY, JULY 28TH, 2011
user@host $ cat /dev/random # flood :(
Debian Packaging telnet support
July August Sept In the future
PAGE 22 / 35
Roadmap
DOS protection
THURSDAY, JULY 28TH, 2011
II. SSHGATE PRESENTATION
PAGE 23 / 35 THURSDAY, JULY 28TH, 2011
PAGE 24 / 35
Session opening steps (1/4)
THURSDAY, JULY 28TH, 2011
§ Connect ¡to sshGate server via SSH
PAGE 25 / 35
Session opening steps (2/4)
THURSDAY, JULY 28TH, 2011
§ Parse ¡SSH_ORIGINAL_COMMAND ¡: ¡
PAGE 26 / 35
Session opening steps (3/4)
THURSDAY, JULY 28TH, 2011
§ Launch sshclient : <ssh-login>@<target> (<command>)
PAGE 27 / 35
Session opening steps (4/4)
THURSDAY, JULY 28TH, 2011
§ Connection is established
PAGE 28 / 35
Administration CLI
THURSDAY, JULY 28TH, 2011
PAGE 29 / 35
Entity-relationship model
THURSDAY, JULY 28TH, 2011
PAGE 30 / 35
Architecture
THURSDAY, JULY 28TH, 2011
§ Shell script toolkit
§ List of some of them :
PAGE 31 / 35
ScriptHelper Library
THURSDAY, JULY 28TH, 2011
PAGE 32 / 35
ask.lib.sh usage
ASK ASK SSHGATE_TARGETS_DEFAULT_SSH_LOGIN \ "What’s the default user account to use when connecting to target host ?" \ "${SSHGATE_TARGETS_DEFAULT_SSH_LOGIN}" CONF_SAVE CONF_SAVE SSHGATE_TARGETS_DEFAULT_SSH_LOGIN ASK ASK yesno yesno SSHGATE_MAIL_SEND \ "Activate mail notification system [Yes] ?" \ "Y” if [ "${SSHGATE_MAIL_SEND}" = 'Y' ]; then ASK ASK SSHGATE_MAIL_TO \ "Who will receive mail notification (comma separated mails) ?" \ "${SSHGATE_MAIL_TO}" [ z "${SSHGATE_MAIL_TO}" ] && SSHGATE_MAIl_SEND=’N’ fi CONF_SAVE CONF_SAVE SSHGATE_MAIL_SEND CONF_SAVE CONF_SAVE SSHGATE_MAIL_TO
THURSDAY, JULY 28TH, 2011
PAGE 33 / 35
cli.lib.sh usage
# load ScriptHelper . ./lib/cli.lib.sh
# SSHGATE_GET_HELP : In sshGate, extract help content from comment in the code # SSHGATE_DISPLAY_HELP : How to display help menu # SSHGATE_DISPLAY_HELP_FOR : How to display help for a command CLI_REGISTER_HELP '/tmp/sshgate-cli-help.txt' \ SSHGATE_GET_HELP \ SSHGATE_DISPLAY_HELP \ SSHGATE_DISPLAY_HELP_FOR
CLI_REGISTER_MENU 'user' 'User related commands' CLI_REGISTER_COMMAND 'user list' 'USERS_LIST' CLI_REGISTER_COMMAND 'user list <pattern>' 'USERS_LIST \1' CLI_REGISTER_COMMAND 'user add <user> mail <email>' 'USER_ADD \1 \2' CLI_REGISTER_COMMAND 'user del <user>' 'USER_DEL \1’
CLI_RUN
THURSDAY, JULY 28TH, 2011
§ SshGate and ScriptHelper
PAGE 34 / 35
Industrialization
tauop@Tauopbox:~/sshGate$ ./build.sh server sshgate version ? 0.2 sshGate build number ? 014 Include ScriptHelper in package ? y Build sshgateserver package ... OK tauop@Tauopbox:~/sshGate$
THURSDAY, JULY 28TH, 2011
PAGE 35 / 35
Installation (1 / 2)
tauop@Tauopbox:/tmp/sshGate-server-0.2-0.71$ sudo ./install.sh
by Patrick Guiran
If you want to install ScriptHelper system-wide, please visit http://github.com/ Tauop/ScriptHelper
Which unix account to use for sshGate users [sshgate] ? What’s the default user account to use when connecting to target host [root] ? List of available languages: fr us Default language for user messages [us] ? fr Which editor to use [vim] ? Activate mail notification system [Y] ? Who will receive mail notification (comma separated mails) [sshgate@linagora.com] ? Do users have to accept TOS when connecting for the first time [Y] ? Allow remote command [Y] ? Allow remote administration CLI [Y] ?
THURSDAY, JULY 28TH, 2011
PAGE 36 / 35
Installation (2 / 2)
[...]
This user will allow you to manage other users, targets and accesses. user login ? pguiran user mail ? pguiran@linagora.com
If you have installed sshGate client -> sshg cli with standard ssh client -> ssh -t sshgate@Tauopbox cli from this terminal -> /opt/sshgate/bin/sshgate-cli -u pguiran
THURSDAY, JULY 28TH, 2011
PAGE 37 / 35
Tests
root@gate:/opt/sshgate/bin/tests# ./test.sh all
root@gate:/opt/sshgate/bin/tests#
THURSDAY, JULY 28TH, 2011
PAGE 38 / 35
Recycle sshGate
THURSDAY, JULY 28TH, 2011
ü SshGate - http://www.github.com/Tauop/sshGate ü ScriptHelper - http://www.github.com/Tauop/ScriptHelper ü IRC@Freenode #linagora - Tauop ü Contact : pguiran@linagora.com / patrick.guiran@gmail.com
PAGE 39 / 35
Download, test, provide feedback, contribute
THURSDAY, JULY 28TH, 2011
PAGE 40 / 35
Questions & Answers
THURSDAY, JULY 28TH, 2011
Contact : LINAGORA – Siège social 80, rue Roque de Fillol 92800 PUTEAUX France
Fax : (+33) 1 46 96 63 64 Mail : info@linagora.com
WWW.LINAGORA.COM