Gratia supports 5 levels of security:
All of these options (and variations) are controlled by flags in the service-configuration.properties file
found in the $CATALINA_HOME/gratia directory.
The first security level is straight-forward. Gratia does nothing.
The second level and up involve gratia working with tomcat. Using this approach requires a number of prerequisites:
export JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dssl.port=8443"
<!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
keystoreFile="/gratia/keystore" keystorePass="server"
truststoreFile="/gratia/truststore" truststorePass="server"
clientAuth="true" sslProtocol="TLS" />
Note that (for linux, at least) the location of the keystore file and the truststore file must be an absolute directory location.
(And you thought you were finished) …
At this point tomcat has been configured with both an open port (8880 in our example) as well as a ssl secure port. Unfortunately, tomcat will still service requests on both ports. So, what you have to do is to force ssl authentication for each of the various services you are concerned with. Specifically, the major service(s) of concern is gratia-servlets and gratia-soap (which basically handle machine to machine communications). To secure this service (as well as any other) you must:
<security-constraint>
<web-resource-collection>
<web-resource-name>Automatic SSL Forwarding</web-resource-name>
<url-pattern>>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>
CONFIDENTIAL
</transport-guarantee>
</user-data-constraint>
</security-constraint>
This flag controls the level of security gratia must deal with:
If set to 0, gratia doesn't do anything.
If set to 1, gratia works with tomcat to provide two way authentication using tomcat's ssl authentication mechanism.
If set to 2 (which is untested), gratia understands that it is running as a worker under Apache and the normal vdt/Apache security mechanisms will be used.
The rest of the options apply when running at security level 1.
Service.use.selfgenerated.certsWhen set to 1 gratia will generate self signed certs for its use and will provide certs to requesting parties (such as a probe).Service.vdt.cert.file/service.vdt.key.file
When set to 0 gratia will use doe/vdt certs but can still provide self signed certs to requesting parties.
Absolute path to the vdt/doe certificates and key pem's.Service.autoregister.pem
When running at security level 1, an outside client (such as a probe) must "register" itself with gratia e.g. by sending gratia a copy of its public key.Service.open.connection
If service.autoregister.pem = 0, gratia will add the key to the database but not insert it into its truststore. The administrator must manually do this via the gratia-administration screen.
If set to 1, however, the key is added both to the database as well as the truststore (no administration is required).
The open, unsecured url gratia is providing. As an example, http://yourgratiahost:8880Service.secure.connection
The secure url gratia is providing. As an example, https://yourgratiahost:8843.