(no commit message)
[devwiki.git] / trustrouterinfo.mdwn
1 <h2>BUILDING/INSTALLING A TRUST ROUTER</h2>
2
3 (Assumes you already have a Moonshot DVD installed.)
4
5 To check out the latest Moonshot code:
6
7 git clone --recursive git://git.project-moonshot.org/moonshot.git
8
9 The Trust Router depends on MIT Kerberos, OpenSSL, jansson and SQLite Version 3.  The dependencies for freeradius are discussed in the freeradius documentation.
10
11 To build and install a Trust Router, you need to separately 'make' and 'make install' in both the moonshot/trust_router and moonshot/freeradius-server directories, in that order.  The Moonshot Debian repositories include a moonshot-trust-router package and a freeradius package with Trust Router integration.  The Centos repository includes trust router packages but not Freeradius packages.
12
13 <h2>CONFIGURING A TRUST ROUTER</h2>
14
15 In addition to having a valid freeradius TLS/PSK configuration, a set of Trust Router and TID-specific configuration is required in order to use the Trust Router.
16
17 The Trust Router reads its configuration from a set of JSON configuration files (anything with a .cfg file extension) in the directory from which it is run.  These files can be generated by the
18 Moonshot Management Portal or configured by hand.  An example is found in the tr/portal.cfg and tr/manual.cfg files  in the trust_router sources.  Both files are needed.
19
20 The TIDC also requires specific configuration in the freeradius raddb/mods-available/realm configuration file.  Three new parameters have been added to the realm configuration: a default community (default_community), an RP realm (rp_realm) and a trust router (trust_router).  The default community will be used when no community is specified in a AAA request (over-riding on a per-request basis is TBD).  The RP realm is used in all TID requests from this proxy, and the trust_router is the IP address to which those requests will be sent.
21
22 For example:
23
24 realm suffix {<br/>
25         format = suffix<br/>
26         delimiter = "@"<br/>
27         default_community = "testing.communities.ja.net"<br/>
28         rp_realm = "painless-security.com"<br/>
29         trust_router = "10.0.2.15"<br/>
30 }
31
32 In addition, the Freeradius RP will need credentials with which to access the trust router.  These credentials can be installed using the moonshot-webp command run as the same user freeradius runs as.  On debian, this is "freerad".
33
34 <h2>BRINGING UP/VERIFYING A TRUST ROUTER</h2>
35
36 To run all of the components needed to test the Trust Router, you will need to have at least two different nodes (or VMs) at different IP addresses.
37
38 On one node, you will run the IDP AAA Server and the TIDS.  The TIDS must run on the same machine as the AAA Server and have access to the keys database used by the AAA Server.  The TIDS is configured with the address where the AAA Server can be reached, and the filename of the SQL database.
39
40 Before running the IDP AAA Server, you will need to configure freeradius to use the SQL key database that will be shared with the TIDS.  This can be done by adding a file called 'psk' to the /etc/freeradius/mods-enabled directory with the following contents:
41
42 sql psksql {<br/>
43   driver = "rlm_sql_sqlite"<br/>
44   sqlite {<br/>
45     filename = "/var/tmp/keys"<br/>
46   }<br/>
47 }<br/>
48
49 You will also need to add 'psksql' to the existing 'instantiate' section in etc/freeradius/radiusd.conf.
50
51 Before running TIDS for the first time, create the SQL database using the following commands:
52
53 sqlite3 /var/tmp/keys<br/>
54 sqlite3>  create table psk_keys (keyid text primary key, key blob);<br/>
55 ^D
56
57 Start the freeradius server (on Node-2, as root):>
58
59 root@debian:/opt/moonshot/sbin# ./radiusd -fxx -l stdout
60
61 Start the TID Server (on Node-2, as root):
62
63 root@debian:/opt/moonshot/bin# ./tids 10.1.10.90 gss_id /var/tmp/keys
64
65 The IP address is the address of the AAA server sharing /var/tmp/keys
66
67 The gss_id is the GSS name that will be used by the trustrouter to connect to the TIDS.  For example if trustrouter@apc.painless-security.com is provisioned as the identity, then enter trustrouter@apc.painless-security.com.
68
69 On the second virtual machine, you will run the freeradius RP AAA Proxy (with built-in TIDC), the Trust Router, the GSS Server and the GSS Client.  For example:
70
71 Starting the freeradius RP AAA Proxy (on Node-1, as root):
72
73 root@moonshot-proxy:/usr/local/sbin# ./radiusd -fxx -l stdout
74
75 Starting the Trust Router (on Node-1, as root):
76
77 root@moonshot-proxy:/home/margaret/moonshot/trust_router/tr# ./tr 
78
79 Starting the GSS server (on Node-1, as root):
80
81 root@moonshot-proxy:/home/margaret# gss-server host@localhost
82
83 Starting the GSS client (on Node-1, any user):
84
85 margaret@moonshot-proxy:~$ gss-client -spnego 127.0.0.1 host@localhost "test message"
86