# Yapılandırma

# 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

<table id="bkmrk-parametre-tipi-a%C3%A7%C4%B1kl-1" style="width: 100%; height: 2851.96px;"><thead><tr style="height: 31.6px;"><th style="width: 31.0215%; height: 31.6px;">Parametre</th><th style="width: 10.9996%; height: 31.6px;">Tipi  
</th><th style="width: 57.9644%; height: 31.6px;">Açıklama  
</th></tr></thead><tbody><tr style="height: 30.6667px;"><td style="width: 31.0215%; height: 30.6667px;">`provider`</td><td style="width: 10.9996%; height: 30.6667px;">string</td><td style="width: 57.9644%; height: 30.6667px;">provider adı. Varsayılan `janusgraph`</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`storage`</td><td style="width: 10.9996%; height: 80.0833px;">dict</td><td style="width: 57.9644%; height: 80.0833px;">storage configuration

(deepolama yapılandırması)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`storage.backend`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">storage type. Can be `cql` or `berkeleyje`

(depolama türü.)

</td></tr><tr style="height: 102.483px;"><td style="width: 31.0215%; height: 102.483px;">`storage.hostname`</td><td style="width: 10.9996%; height: 102.483px;">list of string</td><td style="width: 57.9644%; height: 102.483px;">list of IP addresses or hostnames when using `cql` backend

(cql arka ucunu kullanırken IP adreslerinin veya ana bilgisayar adlarının listesi)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`storage.directory`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">local path for data when using `berkeleyje` backend

(BerkeleyJE arka uç kullanıldığında veri için yerel yol.)

</td></tr><tr style="height: 102.483px;"><td style="width: 31.0215%; height: 102.483px;">`storage.username`</td><td style="width: 10.9996%; height: 102.483px;">string</td><td style="width: 57.9644%; height: 102.483px;">account username with `cql` backend if Cassandra auth is configured

(Eğer Cassandra kimlik doğrulaması yapılandırılmışsa, cql arka uç ile hesap kullanıcı adı.)

</td></tr><tr style="height: 102.483px;"><td style="width: 31.0215%; height: 102.483px;">`storage.password`</td><td style="width: 10.9996%; height: 102.483px;">string</td><td style="width: 57.9644%; height: 102.483px;">account password with `cql` backend if Cassandra auth is configured

(Cassandra kimlik doğrulaması yapılandırıldıysa, cql arka uç için hesap şifresi.)

</td></tr><tr style="height: 169.683px;"><td style="width: 31.0215%; height: 169.683px;">`storage.port`</td><td style="width: 10.9996%; height: 169.683px;">integer</td><td style="width: 57.9644%; height: 169.683px;">port number with `cql` backend (`9042` by default). Change this if using an alternate port or a dedicated port number when using SSL with Cassandra

(Cql arka uç ile bağlantı noktası numarası (varsayılan olarak 9042). Cassandra ile SSL kullanıyorsanız alternatif bir bağlantı noktası veya özel bir bağlantı noktası numarası kullanmak için bunu değiştirin.)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`storage.cql`</td><td style="width: 10.9996%; height: 80.0833px;">dict</td><td style="width: 57.9644%; height: 80.0833px;">configuration for `cql` backend *if used*

(Kullanıldığında cql backend için yapılandırma.)

</td></tr><tr style="height: 30.6667px;"><td style="width: 31.0215%; height: 30.6667px;">`storage.cql.cluster-name`</td><td style="width: 10.9996%; height: 30.6667px;">string</td><td style="width: 57.9644%; height: 30.6667px;">name of the cluster name used in the configuration of Apache Cassandra</td></tr><tr style="height: 30.6667px;"><td style="width: 31.0215%; height: 30.6667px;">`storage.cql.keyspace`</td><td style="width: 10.9996%; height: 30.6667px;">string</td><td style="width: 57.9644%; height: 30.6667px;">Keyspace name used to store TheHive data in Apache Cassandra</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`storage.cql.ssl.enabled`</td><td style="width: 10.9996%; height: 80.0833px;">boolean</td><td style="width: 57.9644%; height: 80.0833px;">`false` by default. set it to `true` if SSL is used with Cassandra

(Apache Cassandra yapılandırmasında kullanılan küme adı.)

</td></tr><tr style="height: 102.483px;"><td style="width: 31.0215%; height: 102.483px;">`storage.cql.ssl.truststore.location`</td><td style="width: 10.9996%; height: 102.483px;">string</td><td style="width: 57.9644%; height: 102.483px;">path the the truststore. Specify it when using SSL with Cassandra

(TheHive verilerini depolamak için Apache Cassandra'da kullanılan keyspace adı.)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`storage.cql.ssl.password`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">password to access the truststore

(Güven deposuna erişmek için şifre)

</td></tr><tr style="height: 102.483px;"><td style="width: 31.0215%; height: 102.483px;">`storage.cql.ssl.client-authentication-enabled`</td><td style="width: 10.9996%; height: 102.483px;">boolean</td><td style="width: 57.9644%; height: 102.483px;">Enables use of a client key to authenticate with Cassandra

(Cassandra ile kimlik doğrulaması için bir istemci anahtarı kullanımını etkinleştirir.)

</td></tr><tr style="height: 124.883px;"><td style="width: 31.0215%; height: 124.883px;">`storage.cql.ssl.keystore.location`</td><td style="width: 10.9996%; height: 124.883px;">string</td><td style="width: 57.9644%; height: 124.883px;">path the the keystore. Specify it when using SSL and client auth. with Cassandra

(Keystore'un yolu. Cassandra ile SSL ve istemci kimlik doğrulaması kullanılırken belirtiniz.)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`storage.cql.ssl.keystore.keypassword`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">password to access the key in the keystore

(Anahtara erişmek için şifre)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`storage.cql.ssl.truststore.storepassword`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">password the access the keystore

(Keystore'a erişim için şifre)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`index.search`</td><td style="width: 10.9996%; height: 80.0833px;">dict</td><td style="width: 57.9644%; height: 80.0833px;">configuration for indexes

(Dizinler için yapılandırma)

</td></tr><tr style="height: 124.883px;"><td style="width: 31.0215%; height: 124.883px;">`index.search.backend`</td><td style="width: 10.9996%; height: 124.883px;">string</td><td style="width: 57.9644%; height: 124.883px;">index engine. Default: `lucene` provided with TheHive. Can also be `elasticsearch`

(Dizin motoru. Varsayılan: TheHive ile sağlanan lucene. Ayrıca elasticsearch olabilir.)

</td></tr><tr style="height: 102.483px;"><td style="width: 31.0215%; height: 102.483px;">`index.search.directory`</td><td style="width: 10.9996%; height: 102.483px;">string</td><td style="width: 57.9644%; height: 102.483px;">path to folder where indexes should be stored, when using `lucene` engine

(Lucene motoru kullanıldığında dizinlerin depolanacağı klasörün yolu.)

</td></tr><tr style="height: 102.483px;"><td style="width: 31.0215%; height: 102.483px;">`index.search.hostname`</td><td style="width: 10.9996%; height: 102.483px;">list of string</td><td style="width: 57.9644%; height: 102.483px;">list of IP addresses or hostnames when using `elasticsearch` engine

(Elasticsearch motoru kullanıldığında IP adresleri veya ana bilgisayar adlarının listesi.)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`index.search.index-name`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">name of index, when using `elasticseach` engine

(Elasticsearch motorunu kullandığınızda dizin adı.)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`index.search.elasticsearch.http.auth.type: basic`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">`basic` is the only possible value

(basic tek mümkün değerdir.)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`index.search.elasticsearch.http.auth.basic.username`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">Username account on Elasticsearch

(Elasticsearch'teki kullanıcı adı hesabı)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`index.search.elasticsearch.http.auth.basic.password`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">Password of the account on Elasticsearch

(Elasticsearch üzerindeki hesabın şifresi)

</td></tr><tr style="height: 52.9667px;"><td style="width: 31.0215%; height: 52.9667px;">`index.search.elasticsearch.ssl.enabled`</td><td style="width: 10.9996%; height: 52.9667px;">boolean</td><td style="width: 57.9644%; height: 52.9667px;">Enable SSL `true/false`(SSL'yi etkinleştir true/false)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`index.search.elasticsearch.ssl.truststore.location`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">Location of the truststore

(Güven deposunun konumu)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`index.search.elasticsearch.ssl.truststore.password`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">Password of the truststore

(Güven deposunun şifresi)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`index.search.elasticsearch.ssl.keystore.location`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">Location of the keystore for client authentication

(İstemci kimlik doğrulaması için keystore'un konumu)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`index.search.elasticsearch.ssl.keystore.storepassword`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">Password of the keystore

(Keystore'un şifresi)

</td></tr><tr style="height: 80.0833px;"><td style="width: 31.0215%; height: 80.0833px;">`index.search.elasticsearch.ssl.keystore.keypassword`</td><td style="width: 10.9996%; height: 80.0833px;">string</td><td style="width: 57.9644%; height: 80.0833px;">Password of the client certificate

(İstemci sertifikasının şifresi)

</td></tr><tr style="height: 48.5333px;"><td style="width: 31.0215%; height: 48.5333px;">`index.search.elasticsearch.ssl.disable-hostname-verification`</td><td style="width: 10.9996%; height: 48.5333px;">boolean</td><td style="width: 57.9644%; height: 48.5333px;">Disable SSL verification `true/false`(SSL doğrulamasını devre dışı bırak true/false)

</td></tr><tr style="height: 48.5333px;"><td style="width: 31.0215%; height: 48.5333px;">`index.search.elasticsearch.ssl.allow-self-signed-certificates`</td><td style="width: 10.9996%; height: 48.5333px;">boolean</td><td style="width: 57.9644%; height: 48.5333px;">Allow self signe certificates `true/false`

(Kendinden imzalı sertifikalara izin ver true/false)

</td></tr></tbody></table>

**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 &amp; Elasticsearch ile bağımsız sunucu :

<div class="tabbed-block" id="bkmrk-install-a-cassandra-">1. Install a Cassandra server locally
2. Install Elasticsearch
3. Configure TheHive accordingly

</div>```
## 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:

<div class="tabbed-block" id="bkmrk-install-a-cluster-of">1. 1. Install a cluster of Cassandra servers
    2. Get access to an Elasticsearch server
    3. 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
                    }
                  }
                }
              }
            }
          }
        }                
        
        ```

</div><p class="callout warning">Bu yapılandırmada, tüm TheHive simgerleri 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.  
</p>

```
script.allowed_types: inline,stored
```

# Dosya Depolama Yapılandırması

Dosya depolama yapılandırması#

TheHive yerel veya dağıtılmış dosya sistemlerini kullanacak şekilde yapılandırılabilir.

**Local veya NFS :**

<div class="result-frame svelte-1a37brm" id="bkmrk-%C3%96zel-klas%C3%B6r-olu%C5%9Fturu">Özel klasör oluşturun; thehive:thehive kullanıcı ve grubuna ait olmalıdır.</div><div class="result-frame svelte-1a37brm" id="bkmrk-"></div>```
mkdir /opt/thp/thehive/files
chown thehive:thehive /opt/thp/thehive/files
```

<div class="result-frame svelte-1a37brm" id="bkmrk-thehive%27%C4%B1-uygun-%C5%9Feki">TheHive'ı uygun şekilde yapılandırın:</div><div class="result-frame svelte-1a37brm" id="bkmrk--1"></div>```
## Ek depolama yapılandırması
storage {
  ## Local filesystem
  provider: localfs
  localfs {
    location: /opt/thp/thehive/files
  }
}
```

<div class="result-frame svelte-1a37brm" id="bkmrk-m%C4%B1n.io%3A">**Mın.IO:**  
</div>1. Min.IO kümesi yükleme
2. TheHive'ın her bir düğümünü uygun şekilde yapılandırın.

<div class="highlight" id="bkmrk-%2Fetc%2Fthehive%2Fapplica">*<span class="filename">/etc/thehive/application.conf with TheHive 5.0.x</span>*</div><div class="highlight" id="bkmrk--2"></div>```
## Attachment storage configuration
storage {
  provider: s3
  s3 {
    bucket = "thehive"
    readTimeout = 1 minute
    writeTimeout = 1 minute
    chunkSize = 1 MB
    endpoint = "http://<IP_MINIO_1>:9100"
    accessKey = "thehive"
    secretKey = "password"
    region = "us-east-1"
  }
}
alpakka.s3.access-style = path

```

<div class="highlight" id="bkmrk-%2Fetc%2Fthehive%2Fapplica-1">*<span class="filename">/etc/thehive/application.conf with TheHive &gt; 5.0</span>*</div><div class="highlight" id="bkmrk--3"></div>```
storage {
  provider: s3
  s3 {
    bucket = "thehive"
    readTimeout = 1 minute
    writeTimeout = 1 minute
    chunkSize = 1 MB
    endpoint = "http://<IP_MINIO_1>:9100"
    accessKey = "thehive"
    aws.credentials.provider = "static"
    aws.credentials.secret-access-key = "password"
    access-style = path
    aws.region.provider = "static"
    aws.region.default-region = "us-east-1"
  }
}

```

<div class="highlight" id="bkmrk-yap%C4%B1land%C4%B1rma-geriye-">- Yapılandırma geriye dönük uyumludur
- MinIO yapılandırmasında hiçbiri belirtilmemişse us-east-1 varsayılan bölgedir. Bu durumda, bu parametre isteğe bağlıdır.

</div><div class="result-frame svelte-1a37brm" id="bkmrk--4"></div><div class="result-frame svelte-1a37brm" id="bkmrk--5"></div>

# Bağlayıcılar Yapılandırması

TheHive bağlayıcıları

TheHive, Cortex ve MISP ile entegre olmak için bağlayıcılara sahiptir.

Varsayılan olarak, bunlar */etc/thehive/application.conf* yapılandırma dosyasında etkindir. Eğer bunlardan birini veya her ikisini kullanmıyorsanız ilgili satırı yorumlayarak devre dışı bırakabilirsiniz:

*<span class="filename">/etc/thehive/application.conf</span>*

```
[..]
scalligraph.modules += org.thp.thehive.connector.cortex.CortexModule
# scalligraph.modules += org.thp.thehive.connector.misp.MispModule  #
```

<p class="callout info">Yapılandırma dosyasının güncellenmesi için TheHive hizmetinin yeniden başlatılması gerekir.</p>

# Akka Yapılandırması

Akka, Java ve Scala için yüksek düzeyde eşzamanlı, dağıtılmış ve esnek mesaj odaklı uygulamalar oluşturmaya yönelik bir araç setidir

\-- [https://akka.io/](https://akka.io/)

Akka, TheHive'in birçok düğümünü bir araya getirerek ve sorunsuz bir kullanıcı deneyimi sunarak çalışmasını sağlamak için kullanılır.

**Temel yapılandırma**

İyi bir küme kurulumu, TheHive uygulamalarının en az 3 düğümünü gerektirir. Her düğüm için Akka şu şekilde yapılandırılmalıdır:

```
akka {
  cluster.enable = on
  actor {
    provider = cluster
  }
  remote.artery {
    canonical {
      hostname = "<HOSTNAME OR IP_ADDRESS>"
      port = 2551
    }
  }
# seed node list contains at least one active node
  cluster.seed-nodes = [ "akka://application@HOSTNAME1:2551", "akka://application@HOSTNAME2:2551", "akka://application@HOSTNAME3:2551" ]
}
```

ile:

*remote.artery.hostname* düğümün ana bilgisayar adını veya IP adresini içerir,  
akka düğümlerinin listesini içeren ve tüm düğümlerde aynı olan *cluster.seed-nodes*

<div class="result-frame svelte-1a37brm" id="bkmrk-bir-k%C3%BCmenin-3-d%C3%BC%C4%9F%C3%BCml">Bir Kümenin 3 Düğümlü Yapılandırması:</div><div class="result-frame svelte-1a37brm" id="bkmrk-"></div><div class="result-frame svelte-1a37brm" id="bkmrk--1"></div><div class="result-frame svelte-1a37brm" id="bkmrk-d%C3%BC%C4%9F%C3%BCm-1%3A">Düğüm 1:</div><div class="result-frame svelte-1a37brm" id="bkmrk--2">  
</div>```
akka {
    cluster.enable = on
    actor {
      provider = cluster
    }
    remote.artery {
      canonical {
          <mark class="critic">hostname = "10.1.2.1"</mark>
          port = 2551
      }
    }
    # seed node list contains at least one active node
    cluster.seed-nodes = [ "akka://application@10.1.2.1:2551", "akka://application@10.1.2.2:2551", "akka://application@10.1.2.3:2551" ]
}
```

Düğüm 2:

```
akka {
    cluster.enable = on
    actor {
    provider = cluster
    }
    remote.artery {
    canonical {
        <mark class="critic">hostname = "10.1.2.2"</mark>
        port = 2551
    }
    }
    # seed node list contains at least one active node
    cluster.seed-nodes = [ "akka://application@10.1.2.1:2551", "akka://application@10.1.2.2:2551", "akka://application@10.1.2.3:2551" ]
}
```

Düğüm3:

```
akka {
    cluster.enable = on
    actor {
    provider = cluster
    }
    remote.artery {
    canonical {
        <mark class="critic">hostname = "10.1.2.3"</mark>
        port = 2551
    }
    }
    # seed node list contains at least one active node
    cluster.seed-nodes = [ "akka://application@10.1.2.1:2551", "akka://application@10.1.2.2:2551", "akka://application@10.1.2.3:2551" ]
}
```

**SSL/TLS desteği**

Akka, düğümler arasındaki iletişimi şifrelemek için SSL/TLS'yi destekler. SSL desteği ile tipik bir yapılandırma :

```
akka {
  cluster.enable = on
  actor {
    provider = cluster
  }
  remote.artery {
    transport = tls-tcp
    canonical {
      hostname = "<HOSTNAME OR IP_ADDRESS>"
      port = 2551
    }

    ssl.config-ssl-engine {
      key-store = "<PATH TO KEYSTORE>"
      trust-store = "<PATH TO TRUSTSTORE>"

      key-store-password = "chamgeme"
      key-password = "chamgeme"
      trust-store-password = "chamgeme"

      protocol = "TLSv1.2"
    }
  }
# seed node list contains at least one active node
  cluster.seed-nodes = [ "akka://application@HOSTNAME1:2551", "akka://application@HOSTNAME2:2551", "akka://application@HOSTNAME3:2551" ]
}
```

Not: *akka.remote.artery.transport*'un değiştiğini ve *akka.ssl.config-ssl-engine'*in yapılandırılması gerektiğini unutmayın.

Referans: [https://doc.akka.io/docs/akka/current/remoting-artery.html#remote-security](https://doc.akka.io/docs/akka/current/remoting-artery.html#remote-security)

<div class="result-frame svelte-1a37brm" id="bkmrk-sertifikalar-hakk%C4%B1nd">**Sertifikalar Hakkında**</div>Sertifikalar Hakkında

Kendi dahili PKI'nızı veya sertifikalarınızı oluşturmak için keytool komutlarını kullanabilirsiniz.

Referans: [https://lightbend.github.io/ssl-config/CertificateGeneration.html#using-keytool](https://lightbend.github.io/ssl-config/CertificateGeneration.html#using-keytool)

Sunucu sertifikalarınızın her şeyin düzgün çalışması için çeşitli KeyUsage ve ExtendedkeyUsage uzantıları içermesi gerekir:

<div class="result-frame svelte-1a37brm" id="bkmrk-keyusage-uzant%C4%B1lar%C4%B1-">- KeyUsage uzantıları 
    - nonRepudiation
    - dataEncipherment
    - digitalSignature
    - keyEncipherment
- ExtendedkeyUsage uzantıları 
    - serverAuth
    - clientAuth

</div><div class="result-frame svelte-1a37brm" id="bkmrk-node-1-i%C3%A7in-ssl-ile-"><div class="result-frame svelte-1a37brm">Node 1 için SSL ile Akka yapılandırması:</div><div class="result-frame svelte-1a37brm"></div></div>```
akka {
  cluster.enable = on
  actor {
    provider = cluster
  }
  remote.artery {
    <mark class="critic">transport = tls-tcp</mark>
    canonical {
      hostname = "10.1.2.1"
      port = 2551
    }

    ssl.config-ssl-engine {
      key-store = "/etc/thehive/application.conf.d/certs/10.1.2.1.jks"
      trust-store = "/etc/thehive/application.conf.d/certs/internal_ca.jks"

      key-store-password = "chamgeme"
      key-password = "chamgeme"
      trust-store-password = "chamgeme"

      protocol = "TLSv1.2"
    }
  }
# seed node list contains at least one active node
  cluster.seed-nodes = [ "akka://application@10.1.2.1:2551", "akka://application@10.1.2.2:2551", "akka://application@10.1.2.3:2551" ]
}
```

Aynı prensibi diğer düğümler için de uygulayın ve tüm hizmetleri yeniden başlatın.

# Logs (Günlükler) Yapılandırması

TheHive, çalışan süreç hakkında bilgi kaydetmek için logback kullanır. Logs, /etc/thehive/logback.xml dosyasında yapılandırılır. Bu dosyayı düzenleyin ve değişikliklerinizi uygulamak için hizmeti yeniden yükleyin.

Varsayılan olarak, günlükler /var/log/thehive/ dizininde depolanır. Son günlük dosyasına application.log denir ve eski dosyalar application.%i.log.zip biçiminde sıkıştırılmış bir formatta saklanır.

**Log Seviyesini Artırma/Azaltma**

Logback, birkaç log seviyesini destekler.

Daha fazla şeyi kaydetmek için kök düzeyini DEBUG (veya TRACE) olarak güncelleyebilirsiniz:

<div class="highlight" id="bkmrk-logback.xml">*<span class="filename">logback.xml</span>*</div>```
    <!-- ... -->
    <root level="DEBUG">
        <!-- ... -->
    </root>

```

Daha az şeyi log kaydetmek için WARN, ERROR veya OFF seviyelerini kullanabilirsiniz.

Log seviyesi, belirli bir kaydedicinin seviyesi değiştirilerek ayrı ayrı da güncellenebilir:

<div class="highlight" id="bkmrk-logback.xml-1">*<span class="filename">logback.xml</span>*</div>```
    <logger name="org.thp" level="DEBUG"/>

```

**Docker'da Logs**

Docker içindeki konteynerde, günlükleyici varsayılan olarak */etc/thehive/logback.xml* dosyasıyla yapılandırılır ve uygulama stdout'a ve */var/log/thehive/application.log*'a günlükler.

Varsayılan yapılandırmayı değiştirmek isterseniz, kendi logback dosyanızı /etc/thehive/logback.xml'ye bağlayabilirsiniz.

**Logback Yapılandırmanızı Hata Ayıklama**

Eğer sorunlarınız varsa logback.xml'de debug bayrağını true olarak ayarlayın:

<div class="highlight" id="bkmrk-logback.xml-2">*<span class="filename">logback.xml</span>*</div>```
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">

```

Bu, uygulama başladığında logback yapılandırmanızı konsola kaydeder.

**Log Erişimi Nasıl Oluşturulur**

Logback yapılandırmasını değiştirerek, belirli günlükleri uygulamadan başka bir yere yönlendirebilirsiniz. Aşağıda, erişim günlüklerinin *access.log* dosyasına yönlendirildiği ve bir döner dosya stratejisi kullandığı bir örnek bulunmaktadır.

Bu yapılandırmayı uygulamak için, ekleyicileri ve günlükleyicilerin tanımlarını kopyalayın.

<div class="highlight" id="bkmrk-logback.xml-3">*<span class="filename">logback.xml</span>*</div>```
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">

    <!-- ... other appenders and settings -->

    <appender name="ACCESSFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/var/log/thehive/access.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>/var/log/thehive/access.%i.log.zip</fileNamePattern>
            <minIndex>1</minIndex>
            <maxIndex>10</maxIndex>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>10MB</maxFileSize>
        </triggeringPolicy>

        <encoder>
            <pattern>%date [%level] from %logger [%traceID] %message%n%xException</pattern>
        </encoder>
    </appender>

    <appender name="ASYNCACCESSFILE" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="ACCESSFILE"/>
    </appender>

    <logger name="org.thp.scalligraph.AccessLogFilter">
        <appender-ref ref="ASYNCACCESSFILE" />
    </logger>
    <logger name="org.thp.scalligraph.controllers.Entrypoint">
        <appender-ref ref="ASYNCACCESSFILE" />
    </logger>

    <root level="INFO">
        <!-- other appender-refs ... -->
    </root>

</configuration>

```

**Log'lar syslog'a Nasıl Gönderilir**

Bir SyslogAppender eklemeniz gerekecektir.

<div class="highlight" id="bkmrk-logback.xml-4">*<span class="filename">logback.xml</span>*</div>```
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">

    <!-- ... other appenders and settings -->

    <appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
        <syslogHost>remote_host</syslogHost>
        <facility>AUTH</facility>
        <suffixPattern>[%thread] %logger %msg</suffixPattern>
    </appender>

    <root level="INFO">
        <appender-ref ref="SYSLOG" />
        <!-- other appender-refs ... -->
    </root>

```

Sınırlamalar: Resmi syslog uygulayıcısı günlükleri yalnızca UDP üzerinden bir sunucuya gönderebilir. TCP ve TLS kullanamaz

<div class="notranslate" id="bkmrk-" style="all: initial;"></div>

# Proxy Yapılandırması

#### Proxy Ayarları

**Genel Uygulama için Proxy**

Proxy kullanılabilir. Varsayılan olarak, JVM'de yapılandırılan proxy kullanılır, ancak her HTTP istemcisi için özel yapılandırmalar yapılabilmektedir.

<table id="bkmrk-parameter-type-descr"><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>`wsConfig.proxy.host`</td><td>string</td><td>The hostname of the proxy server</td></tr><tr><td>`wsConfig.proxy.port`</td><td>integer</td><td>The port of the proxy server</td></tr><tr><td>`wsConfig.proxy.protocol`</td><td>string</td><td>The protocol of the proxy server. Use "http" or "https". Defaults to "http" if not specified</td></tr><tr><td>`wsConfig.proxy.user`</td><td>string</td><td>The username of the credentials for the proxy server</td></tr><tr><td>`wsConfig.proxy.password`</td><td>string</td><td>The password for the credentials for the proxy server</td></tr><tr><td>`wsConfig.proxy.ntlmDomain`</td><td>string</td><td>The NTLM domain</td></tr><tr><td>`wsConfig.proxy.encoding`</td><td>string</td><td>The realm's charset</td></tr><tr><td>`wsConfig.proxy.nonProxyHosts`</td><td>list</td><td>The list of hosts on which proxy must not be used</td></tr></tbody></table>

# Secrets (Gizli) Yapılandırma

secret.conf dosyası

Bu dosya, kullanıcı oturumunu yönetmek için kullanılan çerezleri tanımlamak için kullanılan bir sırrı içerir. Sonuç olarak, TheHive'ın bir örneği benzersiz bir sır anahtarı kullanmalıdır.

Örnek:

```
play.http.secret.key="dgngu325mbnbc39cxas4l5kb24503836y2vsvsg465989fbsvop9d09ds6df6"
```

<p class="callout warning">TheHive düğümlerinden oluşan bir küme söz konusu olduğunda, tüm düğümler aynı gizli anahtarla aynı secret.conf dosyasına sahip olmalıdır. Gizli anahtar kullanıcı oturumları oluşturmak için kullanılır.</p>

# SSL Yapılandırması

**HTTPS kullanarak TheHive'a bağlanın**

SSL katmanını yönetmek için bir ters proxy kullanmanızı öneririz; Örneğin, Nginx.

**Reference**: [Configuring HTTPS servers](https://nginx.org/en/docs/http/configuring_https_servers.html) on [nginx.org](https://nginx.org)

<div class="tabbed-content" id="bkmrk-%2Fetc%2Fnginx%2Fsites-ava"><div class="tabbed-block"><div class="highlight"><span class="filename">/etc/nginx/sites-available/thehive.conf</span></div></div></div>```
server {
  listen 443 ssl http2;
  server_name thehive;

  ssl on;
  ssl_certificate       path-to/thehive-server-chained-cert.pem;
  ssl_certificate_key   path-to/thehive-server-key.pem;

  proxy_connect_timeout   600;
  proxy_send_timeout      600;
  proxy_read_timeout      600;
  send_timeout            600;
  client_max_body_size    2G;
  proxy_buffering off;
  client_header_buffer_size 8k;

  location / {
    add_header              Strict-Transport-Security "max-age=31536000; includeSubDomains";
    proxy_pass              http://127.0.0.1:9000/;
    proxy_http_version      1.1;
  }
}

```

**İstemci Yapılandırması**

Uzak servislere bağlanmak için SSL yapılandırması gerekebilir. Aşağıdaki parametreler tanımlanabilir:

<table id="bkmrk-parameter-type-descr"><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>`wsConfig.ssl.keyManager.stores`</td><td>list</td><td>Stores client certificates (see [\#certificate-manager](https://docs.strangebee.com/thehive/setup/configuration/ssl/#certificate-manager) )</td></tr><tr><td>`wsConfig.ssl.trustManager.stores`</td><td>list</td><td>Stored custom Certificate Authorities (see [\#certificate-manager](https://docs.strangebee.com/thehive/setup/configuration/ssl/#certificate-manager)</td></tr><tr><td>`wsConfig.ssl.protocol`</td><td>string</td><td>Defines a different default protocol (see [\#protocols](https://docs.strangebee.com/thehive/setup/configuration/ssl/#protocols))</td></tr><tr><td>`wsConfig.ssl.enabledProtocols`</td><td>list</td><td>List of enabled protocols (see [\#protocols](https://docs.strangebee.com/thehive/setup/configuration/ssl/#protocols))</td></tr><tr><td>`wsConfig.ssl.enabledCipherSuites`</td><td>list</td><td>List of enabled cipher suites (see [\#ciphers](https://docs.strangebee.com/thehive/setup/configuration/ssl/#ciphers))</td></tr><tr><td>`wsConfig.ssl.loose.acceptAnyCertificate`</td><td>boolean</td><td>Accept any certificates *true / false*</td></tr></tbody></table>

**Sertifika Yöneticisi**

Sertifika yöneticisi, istemci sertifikalarını ve sertifika yetkililerini depolamak için kullanılır. Özel Sertifika Yetkilileri Kullanma#

Özel Sertifika Yetkililerini kullanmanın tercih edilen yolu sistem yapılandırmasını kullanmaktır.

Uygulama genelinde özel bir Sertifika Yetkilisi kurulumu gerekiyorsa (web proxy'lerine, LPAPS sunucusu gibi uzak hizmetlere bağlanmak için), daha iyi bir çözüm, bunu işletim sistemine yükleyip TheHive'ı yeniden başlatmaktır.

**Debian :**

ca-certificates-java paketinin kurulu olduğundan emin olun ve CA sertifikasını doğru klasöre kopyalayın. Ardından dpkg-reconfigure ca-certificates komutunu çalıştırın ve TheHive hizmetini yeniden başlatın.

```
apt-get install -y ca-certificates-java
mkdir /usr/share/ca-certificates/extra
cp mycustomcert.crt /usr/share/ca-certificates/extra
dpkg-reconfigure ca-certificates
service thehive restart

```

**RPM :**

Fedora veya RHEL'de ek pakete gerek yoktur. CA sertifikasını doğru klasöre kopyalayın, update-ca-trust'ı çalıştırın ve TheHive hizmetini yeniden başlatın.

```
cp mycustomcert.crt /etc/pki/ca-trust/source/anchors
sudo update-ca-trust 
service thehive restart

```

Bir alternatif yöntem, ayrı bir güven deposu kullanmaktır; ancak bu Tercih Edilen bir seçenek DEĞİLDİR. TheHive yapılandırmasında trustManager anahtarını kullanın. Bu, uzak bir ana bilgisayarla güvenli bir bağlantı kurmak için kullanılır. Sunucu sertifikası, güvenilir bir sertifika otoritesi tarafından imzalanmış olmalıdır.

```
 wsConfig.ssl.trustManager {
    stores = [
      {
        type = "JKS" // JKS or PEM
        path = "keystore.jks"
        password = "password1"
      }
    ]
  }
```

**İstemci Sertifikaları**

keyManager, HTTP istemcisinin (sertifika tabanlı kimlik doğrulaması kullanıldığında) kendini uzak sunucuda kimlik doğrulamak için hangi sertifikayı kullanabileceğini belirtir.

```
 wsConfig.ssl.keyManager {
    stores = [
      {
        type = "pkcs12" // JKS or PEM
        path = "mycert.p12"
        password = "password1"
      }
    ]
  }
```

**Protokoller**

Farklı bir varsayılan protokol tanımlamak istiyorsanız, bunu istemcide özel olarak ayarlayabilirsiniz:

```
wsConfig.ssl.protocol = "TLSv1.2"
```

Etkin protokollerin listesini tanımlamak istiyorsanız, bunu açıkça bir liste sağlayarak yapabilirsiniz:

```
wsConfig.ssl.enabledProtocols = ["TLSv1.2", "TLSv1.1", "TLSv1"]
```

#### Gelişmiş seçenekler

  
**Parolalar**

Parola paketleri wsConfig.ssl.enabledCipherSuites kullanılarak yapılandırılabilir:

```
wsConfig.ssl.enabledCipherSuites = [
  "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
  "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
  "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384",
  "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
]
```

**Hata ayıklama**

Anahtar yöneticisi / güven yöneticisinde hata ayıklamak için aşağıdaki bayrakları ayarlayın:

```
  wsConfig.ssl.debug = {
    ssl = true
    trustmanager = true
    keymanager = true
    sslctx = true
    handshake = true
    verbose = true
    data = true
    certpath = true
  }
```

# Hizmet Yapılandırması

**Dinleme adresi ve bağlantı noktası**

Uygulama varsayılan olarak tüm arayüzleri ve 9000 numaralı portu dinler. Bu, application.conf dosyasında aşağıdaki parametrelerle dinleme adresini ve bağlantı noktalarını belirtmek mümkündür:

```
http.address=127.0.0.1
http.port=9000
```

**Bağlam**

Ters proxy kullanıyorsanız ve bir konum belirtmek istiyorsanız (örn: /thehive), TheHive yapılandırmasını da güncellemeniz gerekir

```
play.http.context: "/thehive"
```

**Akışlar için özel yapılandırma**

Nginx gibi bir ters proxy kullanıyorsanız, aşağıdaki mesajı içeren hata pop-up'ları alabilirsiniz: StreamSrv 504 Ağ Geçidi Zaman Aşımı.

Uzun yoklama yenilemesi için varsayılan ayarı değiştirmeniz gerekir, stream.longPolling.refresh'i buna göre ayarlayın.

```
stream.longPolling.refresh: 45 seconds
```

**Web proxy kullanımı**

Eğer TheHive'ın önünde bir NGINX ters proxy kullanıyorsanız, bu, metin verisi ile bir dosya yükleme arasında ayırım yapmaz.

Bu nedenle, NGINX sunucu yapılandırmanızda, TheHive *application.conf* dosyasında belirtilen dosya yükleme ve metin boyutu arasındaki en yüksek değere eşit olan *client\_max\_body\_size* parametresini ayarlamanız gerekir.

# Uyumluluk

### GDPR

<p class="callout info">Bu özellik, THeHive 5.x'in Platinum planı ile yalnızca mevcuttur.</p>

TheHive, veritabanındaki veri saklama politikasını yönetmeye yönelik bir özelliğe sahiptir, bu özellik varsayılan olarak etkin değildir.

Stratejiler

İki strateji mevcuttur:

1. Hassas değerleri &lt;redacted&gt; ile değiştirin
2. Verileri silme

**Değerleri &lt;redacted&gt; ile Değiştirin**

- Vakalar için aşağıdaki alanlar redakte edilir:

davanin `summary` ve `message`  
yorumların `message`  
görev günlüklerinde `message`  
`gdpr.dataTypesToDelete` yapılandırma özelliğinde seçilen ve doldurulan veri tipleri için gözlemlenebilirlerin `message`  
sayfaların `content`  
TTP'lerdeki prosedürlerin `description`

- Uyarılar için aşağıdaki alanlar redakte edilir:

uyarı `message`  
gözlemlenebilirlerin `message`(bkz. `gdpr.dataTypesToDelete` yapılandırma özelliği)  
prosedürleri̇n `description`(ttp)

**Denetimler İçin:**

alan `details` redakte edilmiştir.

**Verileri Sil**

Strateji `delete` seçilirse:

Vaka ve bileşenleri - *tasks, task logs, procedures, comments, pages, custom events in timelines, values of custom field and observables* - are deleted  
Uyarı ve bileşenleri- *procedures, comments, values of custom field and observables* - are deleted.  
Denetim silinir

**Saklama**

RetentionPeriod parametresi, silinecek veya redakte edilecek verilerin minimum yaşını tanımlar. GDPR süreci, bu ayardan daha eski verilere uygulanacaktır. Yaş, son güncelleme tarihine (veya hiç güncellenmemişse oluşturma tarihine) dayanır. Biçim bir sayı ve bir zaman birimidir. Desteklenen birimler şunlardır:

gün: `d`, `day`  
saat: `h`, `hr`, `hour`  
dakika: `m`, `min`, `minute`  
saniye: `s`, `sec`, `second`  
milisaniye: `ms`, `milli`, `millisecond`

**Yapılandırma**

Bunu etkinleştirmek için /etc/thehive/application.conf yapılandırma dosyası güncellenmelidir. Aşağıdaki yapılandırmayı dosyaya ekleyin:

```
gdpr {
    enabled = true

    ## Format http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html
    ## Every Sunday at 02:30

    schedule = "0 30 2 ? * SUN"

    ## Possible GDPR strategies:
    ##   delete: remove the documents
    ##   redact: replace sensitive values by "<redacted>" (cf. dataTypesToDelete)

    strategy = "delete"

    ## if the strategy is "redacted", the observable with dataType in 
    ## "dataTypesToDelete" will be removed
    ## for other observables, message will be "<redacted>", not the data
    ## Uncomment following line to select datatypes

    # dataTypesToDelete = [] ## ["ip", "domain"]

    ## only documents older than the "retentionPeriod" will be processed

    retentionPeriod = 730 days # 2 years

    ## Advanced parameters (should not be modified)

    jobTimeout = 24 days ## maximum time the job is executed
    batchSizeCase = 5     ## how many cases is processed per transaction
    batchSizeAlert = 10   ## how many cases is processed per transaction
    batchSizeAudit = 100  ## how many cases is processed per transaction
}
```

Ardından uygulamayı yeniden başlatın.