Skip to content

Adding services to CRITs

Mike Goffin edited this page Feb 19, 2015 · 1 revision

The core CRITs installation comes with a Services Framework. Services are ways of extending the features and functionality of the core project to fit your needs. We don't ship core with any services to keep it light-weight so you can extend it with only those things you wish to extend it with.

Adding Services to CRITs:

If you would like to extend the functionality of CRITs by adding services, you will have to follow these steps:

Acquire services:

You can find some readily available community-developed services here.

Put the services anywhere you would like on your server (you can even have multiple directories). With the repository above you could use something like /data/crits_services as your directory.

NOTE: Any directories within the above directory are considered a unique service. When the web-server starts it will attempt to import each one. If it runs into any issues doing so, you can find more information in the logs/crits.log file. Services in the CRITs Control Panel will show up as misconfigured if they require further configuration to work. If you see a service marked as unavailable it is most likely due to an issue importing it even though it was successful in the past (usually indicative of a dependency issue or a code upgrade that isn't working).

Install dependencies

Each service has its own dependencies which can extend beyond those required by the core project. Please browse the README and DEPENDENCIES files for each service you are interested in using and make sure the dependencies are installed.

Configure CRITs to import the services

CRITs only knows which directories to look for services in if it's configured to do so. You can configure CRITs with the location(s) of the above directory in two ways:

setconfig

Using setconfig allows you to tell CRITs where the service directory is before the web server starts. You can do this with the following command:

python manage.py setconfig service_dirs "/data/crits_services"

If successful, CRITs will now look for that directory and try to import any services it finds within that directory when your webserver (re)starts.

CRITs Control Panel

If your UI is already up and running, you can go to the CRITs Control Panel via the Nav Menu. Once there, you can go to System->Service Settings and add your Service Directories there. Once they are added you will need to restart your webserver so the services can be imported.

Configuring each service

Once you've logged back into CRITs you can to to the CRITs Control Panel and to to Services. Here you will find a list of all of the successfully imported services. They can each have a different status:

  • Available
    • It requires no further configuration to run with default settings.
  • Misconfigured
    • There are required configuration options that need to be setup before it will be available.
    • Click on the name of the service to be linked to the configuration page.

Once a service is Available you can then enable it for use in different ways:

  • Enabled
    • This allows the service to show up in the interface. Usually this is under the Analysis tab on the Details page of a TLO.
  • Triage
    • Triage tells CRITs to run this service automatically any time a new TLO is uploaded that the service is designed for (see the Supported Types column).

What things can services do?

There are generally two types of services:

  • Analytic services
  • Tabbed services.

A service can come with one or both of those types of features depending on how it is designed. Check out the README of each service for more information.

Analytic services

These services are designed to:

  • Run a tool, capture the output, and store the results in CRITs.
  • Submit data to a service, capture the results, and store the results in CRITs.
  • Submit data to another system who will update CRITs with results as they are available.

In order to run one of these services, you need to go to the "Analysis" tab on the Details page of a TLO. There you will find a button on the top whose name is associated with the service you wish to run. Clicking on it will either run the service immediately or give you a form to fill out to customize how the service is executed.

Once the service starts you can use the Refresh Services button to update the tab with results as they are available. A new section will show up for that execution of the service (yes, you can run a service more than once if you want to see how results change over time (there's even a service to diff results for you!)). This section will tell you if the service is still running or if it has completed successfully or in error.

Tabbed Services

These services generally provide a more interactive experience for the user. The features they deal with tend not to store analysis results but still provide the user with useful ways to interact with data in the system.

A Tabbed service has a couple capabilities:

  • Adding a sub-item under Services in the Nav menu.
    • These usually link to a custom interface that service provides.
  • Adding a new tab (or tabs) to the Details page.
    • These tabs give a more flexible interface for the user to interact with the service.

The interfaces are usually fairly rich. This can include things like interactive graphs, exposing server-side process results in real-time, etc.

Writing your own service(s).

For more information on how to write your own service(s), check out the documentation here.

Clone this wiki locally