Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

CorporateNetworkDetection

Justin McWilliams edited this page Oct 17, 2014 · 1 revision

Introduction

Simian has support for tracking the number of connections a client has made from on your corporate network or from any other Internet connection. This is particularly useful for mobile clients like laptops, giving admins insight into how their fleet is being used and where machines are located when patched.

Implementation

During preflight, Simian attempts to execute an optional script, not provided as part of the Simian source, to detect a corporate network connection

Simian admins may choose to craft their own scripts however they wish. At Google we attempt to connect to a couple of different servers and even validate certificates, but a tiny bash script like the following may be sufficient for many environments:

#!/bin/bash

CORP_HTTP_SERVER="http://internalonly.example.com/resource"

curl -q ${CORP_HTTP_SERVER}
if [ "$?" = "0" ]; then
 exit 0  # on the corporate network
else     
 exit 1  # NOT on the corporate network
fi

The script must:

  • be executable as /etc/simian/on_corp_cmd
  • exit 0 to signal on the corporate network
  • exit 1 to signal off the corporate network

For more details, please refer to the source.

Clone this wiki locally