sábado, 27 de setembro de 2014

Tracking user ids when using SSH keys sharing

One of the main issues with granting remote access for multiple users with a shared authorized key, is accountability.

The following setup will allow you to track the source user ids, and the commands being executed:

1. In your source "master" server setup an iptables rule to log every SSH outgoing connection, including the user id information:
iptables -I OUTPUT -p tcp --dport 22 --syn -j LOG --log-prefix "new tcp connection: " --log-uid


2. In  your target server:
Create a wrapper script for syslog logging of remote command execution:
/usr/local/bin/log_incoming
#!/bin/sh
logger -- "SSH command from $SSH_CLIENT: $@"
$@

3. In your target shared user account, setup the authorized_keys to enforce the logging command.
~/.ssh/authorized_keys
command="/usr/local/bin/log_incoming $SSH_ORIGINAL_COMMAND",no-port-forwarding,no-X11-forwarding,no-pty SSH_PUB_KEY

In your master server you will get:
Sep 27 15:49:59 hostname kernel: [ 4266.151830] new tcp connection: IN= OUT=lo SRC=127.0.0.1 DST=127.0.0.1 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=9887 DF PROTO=TCP SPT=32858 DPT=22 WINDOW=43690 RES=0x00 SYN URGP=0 UID=1001 GID=1002

In your target server you will get:
Sep 27 15:49:59 hostname username: SSH command from 127.0.0.1 32858 22: ls

quarta-feira, 20 de agosto de 2014

Too Many Clouds


The cloud is the buzzword of the moment, unfortunately used in such a wide range of contexts that it can become misleading.

As a technology, and per the initial use of the term, the cloud refers mostly to the decoupling between software (services) and the physical hardware it runs on. In a cloud based architecture, you don't need to understand or even be aware of the physical infrastructure enabling a specific service. You access a services via a logical endpoint, and it's up to the cloud-technology to bridge your request to the proper "in-cloud" computing resources. In short, it can be easily be compared to a traditional computer cluster, but capable of grouping a massively larger and diversified set of components and providing a wider range of services.

As a service, int the enterprise IT infrastructure world, the cloud usually refers to an application or "virtual server" hosting service. An application hosting service usually supports a specific set of development frameworks, applications using such frameworks may be run with minimal adjustments to their build and deployment process. The virtual server hosting services, are usually powered by one of the many server virtualization technologies extended with the provider specific management tools.

As a service, in the "domestic" world, the cloud is usually a marketing term for internet based storage «which can be 'cloud' technology enable, or not». 

Clouds can either be public «using internet accessible components», private «using enterprise components)» or hybrid.