NAME

netdisco-deploy - Database, OUI and MIB deployment for Netdisco

USAGE

This script deploys the Netdisco database schema, OUI data, and MIBs. Each of these is an optional service which the user is asked to confirm.

Pre-existing requirements are that there be a database table created and a user with rights to create tables in that database. Both the table and user name must match those configured in your environment YAML file (default ~/environments/deployment.yml).

This script will download the latest MAC address vendor prefix data from the Internet, and update the OUI table in the database. Hence Internet access is required to run the script.

Similarly the latest Netdisco MIB bundle is also downloaded and placed into the user's home directory (or $ENV{NETDISCO_HOME}).

If you upgrade Netdisco make sure you run this script again to make sure your config remains compatible.

Before each upgrade also review the Release notes since additional steps might be required!

SESSION COOKIE KEY

Deploying the database stores the key which encrypts and authenticates every Netdisco web session cookie, in the sessions table under the id dancer_session_cookie_key. The key is read from the operating system random source using Crypt::URandom.

It is written only when that row is absent, so running this script again, including on upgrade, never replaces the key and never signs anybody out.

To rotate the key, for instance if you believe it has been disclosed, delete the row:

DELETE FROM sessions WHERE id = 'dancer_session_cookie_key';

then run this script again and answer yes to the database deployment, and restart the Netdisco web service. Every logged-in user is signed out and must log in again.

An earlier release took this key from PostgreSQL's random(), which is not a cryptographically secure generator. Such a key is 32 characters long where a key from this release is 64, so:

SELECT length(a_session) FROM sessions
  WHERE id = 'dancer_session_cookie_key';

reports which of the two your deployment holds. Rotate as above if it reports 32.