<commit_before># Secure STOMP Messenger

[![Build Status](https://travis-ci.org/apel/ssm.svg?branch=dev)](https://travis-ci.org/apel/ssm)
[![Coverage Status](https://coveralls.io/repos/github/apel/ssm/badge.svg?branch=dev)](https://coveralls.io/github/apel/ssm?branch=dev)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cc3e808664ee41638938aa5c660a88ae)](https://www.codacy.com/app/apel/ssm)
[![Maintainability](https://api.codeclimate.com/v1/badges/34aa04f3583afce2ceb2/maintainability)](https://codeclimate.com/github/apel/ssm/maintainability)

Secure STOMP Messenger (SSM) is designed to simply send messages
using the [STOMP protocol](http://stomp.github.io/) or via the ARGO Messaging Service (AMS).
Messages are signed and may be encrypted during transit.
Persistent queues should be used to guarantee delivery.

SSM is written in Python. Packages are available for RHEL 6 and 7, and
 Ubuntu Trusty.

For more information about SSM, see the [EGI wiki](https://wiki.egi.eu/wiki/APEL/SSM).

## Acknowledgements

<span>
  <img alt="STFC logo" src="https://github.com/GOCDB/gocdb/raw/dev/htdocs/web_portal/img/UKRI_STF_Council-Logo_Horiz-RGB_crop.png" height="57" />
  <img alt="EU flag" src="https://github.com/GOCDB/gocdb/raw/dev/htdocs/web_portal/img/eu_flag_yellow_low_150.png" height="51" />
  <img alt="EOSC-hub logo" src="https://github.com/GOCDB/gocdb/raw/dev/htdocs/web_portal/img/eosc-hub-v-web_150.png" height="57" />
</span>

SSM is provided by [STFC](https://stfc.ukri.org/), a part of [UK Research and Innovation](https://www.ukri.org/), and is co-funded by the [EOSC-hub](https://www.eosc-hub.eu/) project (Horizon 2020) under Grant number 777536. Licensed under the [Apache 2 License](http://www.apache.org/licenses/LICENSE-2.0).

## Installing the RPM

### Prerequisites

The EPEL repository must be enabled.  This can be done by installing
the RPM for your version of SL, which is available on this page:
http://fedoraproject.org/wiki/EPEL
You will also need to have the OpenSSL library installed. Other prerequisites are listed below.

The Python STOMP library (N.B. versions between 3.1.1 (inclusive) and 5.0.0
(exclusive) are currently supported)
* `yum install stomppy`

The Python AMS library. This is only required if you want to use AMS. See here for details on obtaining an RPM: https://github.com/ARGOeu/argo-ams-library/

The Python daemon library
* `yum install python-daemon`

The Python ldap library
* `yum install python-ldap`

Optionally, the Python dirq library (N.B. this is only required if your messages
are stored in a dirq structure)
* `yum install python-dirq`

You need a certificate and key in PEM format accessible to the SSM.
There are a number of ways to do this.  One is to make a copy of the
hostcert and hostkey files, owned by the apel user (created later):
 * /etc/grid-security/hostcert-ssm.pem
 * /etc/grid-security/hostkey-ssm.pem
These are the default settings in the configuration file ssm.cfg.
You can use a different configuration if you prefer.

You need certificates against which you're going to verify any certs
you use or receive in the directory /etc/grid-security/certificates (or other
configured location).  The best way to do this for EGI is to install the
ca-policy-egi-core package:
* `cd /etc/yum.repos.d/`
* `wget http://repository.egi.eu/sw/production/cas/1/current/repo-files/EGI-trustanchors.repo`
* `yum install ca-policy-egi-core`

If you want to check CRLs when verifying certificates, you need
fetch_crl installed:
* `yum install fetch-crl`
* `service fetch-crl-cron start`<commit_msg>Document when python-daemon needs to be installed<commit_after># Secure STOMP Messenger

[![Build Status](https://travis-ci.org/apel/ssm.svg?branch=dev)](https://travis-ci.org/apel/ssm)
[![Coverage Status](https://coveralls.io/repos/github/apel/ssm/badge.svg?branch=dev)](https://coveralls.io/github/apel/ssm?branch=dev)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cc3e808664ee41638938aa5c660a88ae)](https://www.codacy.com/app/apel/ssm)
[![Maintainability](https://api.codeclimate.com/v1/badges/34aa04f3583afce2ceb2/maintainability)](https://codeclimate.com/github/apel/ssm/maintainability)

Secure STOMP Messenger (SSM) is designed to simply send messages
using the [STOMP protocol](http://stomp.github.io/) or via the ARGO Messaging Service (AMS).
Messages are signed and may be encrypted during transit.
Persistent queues should be used to guarantee delivery.

SSM is written in Python. Packages are available for RHEL 6 and 7, and
 Ubuntu Trusty.

For more information about SSM, see the [EGI wiki](https://wiki.egi.eu/wiki/APEL/SSM).

## Acknowledgements

<span>
  <img alt="STFC logo" src="https://github.com/GOCDB/gocdb/raw/dev/htdocs/web_portal/img/UKRI_STF_Council-Logo_Horiz-RGB_crop.png" height="57" />
  <img alt="EU flag" src="https://github.com/GOCDB/gocdb/raw/dev/htdocs/web_portal/img/eu_flag_yellow_low_150.png" height="51" />
  <img alt="EOSC-hub logo" src="https://github.com/GOCDB/gocdb/raw/dev/htdocs/web_portal/img/eosc-hub-v-web_150.png" height="57" />
</span>

SSM is provided by [STFC](https://stfc.ukri.org/), a part of [UK Research and Innovation](https://www.ukri.org/), and is co-funded by the [EOSC-hub](https://www.eosc-hub.eu/) project (Horizon 2020) under Grant number 777536. Licensed under the [Apache 2 License](http://www.apache.org/licenses/LICENSE-2.0).

## Installing the RPM

### Prerequisites

The EPEL repository must be enabled.  This can be done by installing
the RPM for your version of SL, which is available on this page:
http://fedoraproject.org/wiki/EPEL
You will also need to have the OpenSSL library installed. Other prerequisites are listed below.

The Python STOMP library (N.B. versions between 3.1.1 (inclusive) and 5.0.0
(exclusive) are currently supported)
* `yum install stomppy`

The Python AMS library. This is only required if you want to use AMS. See here for details on obtaining an RPM: https://github.com/ARGOeu/argo-ams-library/

The Python ldap library
* `yum install python-ldap`

Optionally, the Python dirq library (N.B. this is only required if your messages
are stored in a dirq structure)
* `yum install python-dirq`

The Python daemon library (N.B. installing this library is only required when
using the SSM as a receiver)
* `yum install python-daemon`

You need a certificate and key in PEM format accessible to the SSM.
There are a number of ways to do this.  One is to make a copy of the
hostcert and hostkey files, owned by the apel user (created later):
 * /etc/grid-security/hostcert-ssm.pem
 * /etc/grid-security/hostkey-ssm.pem
These are the default settings in the configuration file ssm.cfg.
You can use a different configuration if you prefer.

You need certificates against which you're going to verify any certs
you use or receive in the directory /etc/grid-security/certificates (or other
configured location).  The best way to do this for EGI is to install the
ca-policy-egi-core package:
* `cd /etc/yum.repos.d/`
* `wget http://repository.egi.eu/sw/production/cas/1/current/repo-files/EGI-trustanchors.repo`
* `yum install ca-policy-egi-core`

If you want to check CRLs when verifying certificates, you need
fetch_crl installed:
* `yum install fetch-crl`
* `service fetch-crl-cron start`
{'fraction_non_alphanumeric': 0.11728310188367937, 'fraction_numerical': 0.01814931940052248, 'mean_word_length': 4.535768645357686, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 32, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2571966', 'n_tokens_mistral': 2594, 'n_tokens_neox': 2462, 'n_words': 759}