Skip to content

mthc

mthc #60

Workflow file for this run

name: mthc
on:
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Increase limits on mmapfs on host for Elasticsearch
run: echo -e "vm.max_map_count=262144" | sudo tee -a /etc/sysctl.conf; sudo sysctl -p
- name: Build the stack
run: docker-compose up -d
- name: Waiting for stack to build....
uses: jakejarvis/wait-action@master
with:
time: '60s'
- name: Gathering cortex service status
run: |
echo "{cortext_status}={docker inspect -f {{.State.Running}} $(docker ps -f name=mthc_cortex_1 --quiet)}" >> $GITHUB_ENV
echo "cortex service status: $cortex_status"
- name: Gathering thehive service status
run: |
echo "{thehive_status}={docker inspect -f {{.State.Running}} $(docker ps -f name=mthc_thehive_1 --quiet)}" >> $GITHUB_ENV
echo "thehive service status: $thehive_status"
- name: Gathering misp-web service status
run: |
echo "{mispweb_status}={docker inspect -f {{.State.Running}} $(docker ps -f name=mthc_misp-web_1 --quiet)}" >> $GITHUB_ENV
echo "misp-web service status: $mispweb_status"
- name: Gathering elasticsearch service status
run: |
echo "{elasticsearch_status}={docker inspect -f {{.State.Running}} $(docker ps -f name=mthc_elasticsearch_1 --quiet)}" >> $GITHUB_ENV
echo "elasticsearch service status: $elasticsearch_status"
- name: Gathering nginx-proxy service status
run: |
echo "{proxy_status}={docker inspect -f {{.State.Running}} $(docker ps -f name=mthc_nginx-proxy_1 --quiet)}" >> $GITHUB_ENV
echo "nginx-proxy service status: $cortex_status"
- name: Gathering misp-db service status
run: |
echo "{mispdb_status}={docker inspect -f {{.State.Running}} $(docker ps -f name=mthc_misp-db_1 --quiet)}" >> $GITHUB_ENV
echo "misp-db service status: $cortex_status"
- name: Validating all statuses
run: |
if $cortex_status && $thehive_status && $mispweb_status && $elasticsearch_status && $proxy_status && $mispdb_status; then
exit 0
else
exit 1
fi