aau-network-security / haaukins-store

New haaukins component responsible to store data into the database
https://docs.haaukins.com
GNU General Public License v3.0
0 stars 3 forks source link
cybersecurity database golang grpc-communication grpc-go grpc-server microservices opensource postgresql

haaukins-store

Haaukins store is internally used for managing information about events and teams which are exists in Hauukins. With gRPC communication, Haaukins is able to get/post information into haaukins store, although we have store folder in Haaukins repo, we are retrieving and updating information through Haaukins store. The one which is exists on Haaukins is just used for caching purposes. However, we have some local data which consists of configuration files which are fetched and updated directly from host for Haaukins. They are namely;

Production usage

Docker image of haaukins store could be used in any docker compose file if environment variables provided correctly. When using in production, you can specify image address instead of building it fromm source code.

Haaukins store image with recent changes will be available at docker hub, with released tag.

No need to clone the repository, make sure that .env and config.yml files are set correctly.

Steps to run it in production:

Configuration

Haaukins store uses two crucial configuration files which are namely, .env for docker-compose.yml and config.yml for retrieving some information in gRPC server side.

Specifications and more information about them given below.

Environment File

Here is the information which should be included into .env file:

CERTS_PATH=/scratch/configs/certs
CONFIG_PATH=/scratch/configs/config.yml
POSTGRES_DB=exampledb
# POSTGRES_HOST_AUTH_METHOD="trust"
POSTGRES_PASSWORD=exammplepassword

Note that there could be cases where password is not required, in those cases POSTGRES_HOST_AUTH_METHOD could be used. However when you are using it, you do NOT need to provide POSTGRES_PASSWORD.

Configuration file

Example configuration file to run haaukins store without any error.

host: localhost:50051
auth-key: development-auth-key
signin-key: development-signin-key
db:
  host: postgres-db 
  user: postgres
  pass: postgres
  db_name: dummydb
  db_port: 5432
tls:
  enabled: false
  certfile: ./tests/certs/localhost_50051.crt
  certkey: ./tests/certs/localhost_50051.key
  cafile: ./tests/

Docker compose

Docker compose file is defining how services will communicate and how they will be called when they run. The defined services which are defined in docker-compose.yml file might change during time. However, the changes will be written here, currently it uses port 5432 for postgres and port 50051 for gRPC server communication. Within docker-compose.yml, pgadmin4 service is disabled because we decided to use our own tool instead of that one. It could be enabled if we desire at some point.

Run

Haaukins store could be run by ;

Could be re-build and run by ;

Could be removed by;