Veritabanı ve Dizin Yapılandırması
TheHive, verileri ve dizini yönetmek için Cassandra ve Elasticsearch veritabanlarını kullanır. Kuruluma göre, örnek kullanabilir:
Temel Yapılandırma
TheHive için tipik bir veritabanı yapılandırması şu şekildedir:
## Database configuration
db {
  provider = janusgraph
  janusgraph {
    ## Storage configuration
    storage {
      backend = cql
      hostname = ["IP_ADDRESS"]
      cql {
        cluster-name = thp
        keyspace = thehive
      }
    }
    ## Index configuration
    index.search {
      backend = elasticsearch
      hostname = ["127.0.0.1"]
      index-name = thehive
    }
  }
}Mümkün parametrelerin listesi
Parametre Tipi Açıklama
| Parametre | Tipi | Açıklama | 
|---|---|---|
| provider | string | provider name. Default: janusgraph | 
| storage | dict | storage configuration (deepolama yapılandırması) | 
| storage.backend | string | storage type. Can be  (depolama türü.) | 
| storage.hostname | list of string | list of IP addresses or hostnames when using  (cql arka ucunu kullanırken IP adreslerinin veya ana bilgisayar adlarının listesi) | 
| storage.directory | string | local path for data when using berkeleyjebackend | 
| storage.username | string | account username with cqlbackend if Cassandra auth is configured | 
| storage.password | string | account password with cqlbackend if Cassandra auth is configured | 
| storage.port | integer | port number with cqlbackend (9042by default). Change this if using an alternate port or a dedicated port number when using SSL with Cassandra | 
| storage.cql | dict | configuration for cqlbackend if used | 
| storage.cql.cluster-name | string | name of the cluster name used in the configuration of Apache Cassandra | 
| storage.cql.keyspace | string | Keyspace name used to store TheHive data in Apache Cassandra | 
| storage.cql.ssl.enabled | boolean | falseby default. set it totrueif SSL is used with Cassandra | 
| storage.cql.ssl.truststore.location | string | path the the truststore. Specify it when using SSL with Cassandra | 
| storage.cql.ssl.password | string | password to access the truststore | 
| storage.cql.ssl.client-authentication-enabled | boolean | Enables use of a client key to authenticate with Cassandra | 
| storage.cql.ssl.keystore.location | string | path the the keystore. Specify it when using SSL and client auth. with Cassandra | 
| storage.cql.ssl.keystore.keypassword | string | password to access the key in the keystore | 
| storage.cql.ssl.truststore.storepassword | string | password the access the keystore | 
| index.search | dict | configuration for indexes | 
| index.search.backend | string | index engine. Default: luceneprovided with TheHive. Can also beelasticsearch | 
| index.search.directory | string | path to folder where indexes should be stored, when using luceneengine | 
| index.search.hostname | list of string | list of IP addresses or hostnames when using elasticsearchengine | 
| index.search.index-name | string | name of index, when using elasticseachengine | 
| index.search.elasticsearch.http.auth.type: basic | string | basicis the only possible value | 
| index.search.elasticsearch.http.auth.basic.username | string | Username account on Elasticsearch | 
| index.search.elasticsearch.http.auth.basic.password | string | Password of the account on Elasticsearch | 
| index.search.elasticsearch.ssl.enabled | boolean | Enable SSL true/false | 
| index.search.elasticsearch.ssl.truststore.location | string | Location of the truststore | 
| index.search.elasticsearch.ssl.truststore.password | string | Password of the truststore | 
| index.search.elasticsearch.ssl.keystore.location | string | Location of the keystore for client authentication | 
| index.search.elasticsearch.ssl.keystore.storepassword | string | Password of the keystore | 
| index.search.elasticsearch.ssl.keystore.keypassword | string | Password of the client certificate | 
| index.search.elasticsearch.ssl.disable-hostname-verification | boolean | Disable SSL verification true/false | 
| index.search.elasticsearch.ssl.allow-self-signed-certificates | boolean | Allow self signe certificates true/false | 
Not: İlk başlatma veya dizinleri yapılandırdıktan sonraki ilk başlatma, veritabanı büyük miktarda veri içeriyorsa biraz zaman alabilir. Bu süre, dizinlerin oluşturulmasından kaynaklanır.
Kullanım durumları
Veritabanı ve dizin motoru, kullanım durumuna ve hedef kuruluma bağlı olarak farklı olabilir:
Cassandra & Elasticsearch ile bağımsız sunucu  :
- Install a Cassandra server locally
- Install Elasticsearch
- Configure TheHive accordingly
## Database Configuration
db {
  provider = janusgraph
  janusgraph {
    ## Storage configuration
    storage {
      backend = cql
      hostname = ["127.0.0.1"]
      ## Cassandra authentication (if configured)
      username = "thehive_account"
      password = "cassandra_password"
      cql {
        cluster-name = thp
        keyspace = thehive
      }
    }
    ## Index configuration
    index.search {
      backend = elasticsearch
      hostname = ["127.0.0.1"]
      index-name = thehive
    }
  }## Database Configuration
db {
  provider = janusgraph
  janusgraph {
    ## Storage configuration
    storage {
      backend = cql
      hostname = ["127.0.0.1"]
      ## Cassandra authentication (if configured)
      username = "thehive_account"
      password = "cassandra_password"
      cql {
        cluster-name = thp
        keyspace = thehive
      }
    }
    ## Index configuration
    index.search {
      backend = elasticsearch
      hostname = ["127.0.0.1"]
      index-name = thehive
    }
  }
Cassandra ve Elasticsearch ile Küme:
- 
- Install a cluster of Cassandra servers
- Get access to an Elasticsearch server
- 
Configure TheHive accordingly ## Database Configuration db { provider = janusgraph janusgraph { ## Storage configuration storage { backend = cql hostname = ["10.1.2.1", "10.1.2.2", "10.1.2.3"] ## Cassandra authentication (if configured) username = "thehive_account" password = "cassandra_password" cql { cluster-name = thp keyspace = thehive } } ## Index configuration index { search { backend = elasticsearch hostname = ["10.1.2.5"] index-name = thehive elasticsearch { http { auth { type = basic basic { username = httpuser password = httppassword } } } ssl { enabled = true truststore { location = /path/to/your/truststore.jks password = truststorepwd } } } } } } }
 
Uyarı: Bu yapılandırmada, tüm TheHive düğümleri aynı yapılandırmaya sahip olmalıdır. Elasticsearch yapılandırması script.allowed_types için varsayılan değeri kullanmalı veya aşağıdaki yapılandırma satırını içermelidir =
script.allowed_types: inline,stored