Skip to content

Commit

Permalink
more arkime
Browse files Browse the repository at this point in the history
  • Loading branch information
Trolldemorted committed Nov 19, 2023
1 parent aac0358 commit 48ecdf1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion ansible/roles/bambi-arkime/files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ RUN dpkg -i ./*.deb; apt-get install -fy
RUN touch /opt/arkime/etc/oui.txt
RUN touch /opt/arkime/etc/ipv4-address-space.csv

ENTRYPOINT ["tail", "-f", "/dev/null"]
ENTRYPOINT /BambiArkime/docker-entrypoint.sh
6 changes: 6 additions & 0 deletions ansible/roles/bambi-arkime/files/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
set -e

sh ./arkime-capture.sh bambiarkime1 &
sh ./arkime-viewer.sh bambiarkime1 &
wait
16 changes: 0 additions & 16 deletions ansible/roles/bambi-arkime/files/init.sh

This file was deleted.

4 changes: 3 additions & 1 deletion configgen/configgen/gen_wireguard_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ def gen_wireguard_internal(
listen_port=WG_LISTEN_PORT_INTERNAL,
)
)
router_configs[0].responsible_ips.append("192.168.2.0/24")
# TODO replace with peers?
if routers > 0:
router_configs[0].responsible_ips.append("192.168.2.0/24")

# Route traffic to teams through the correct router
for team in range(1, teams + 1):
Expand Down
6 changes: 6 additions & 0 deletions terraform/bambiarkime.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ variable "arkime_count" {
nullable = false
}

locals {
subnet = "192.168.2.0/24"
}

data "hcloud_image" "bambiarkime" {
with_selector = var.arkime_count > 0 ? "type=bambiarkime" : null
name = var.arkime_count > 0 ? null : "debian-10"
Expand All @@ -36,6 +40,8 @@ resource "hcloud_server" "bambiarkime" {
user_data = templatefile(
"user_data_arkime.tftpl", {
id = "${count.index + 1}",
masters = join(",", [for i in range(var.arkime_count) : cidrhost(local.subnet, i+1)]),
seeds = join(",", setsubtract([for i in range(var.arkime_count) : cidrhost(local.subnet, i+1)], [cidrhost(local.subnet, count.index+1)]))
router_ips = hcloud_floating_ip.bambirouter_ip,
elk = var.elk_count > 0 ? hcloud_floating_ip.bambielk_ip[0].ip_address : "127.0.0.1",
engine = var.engine_count > 0 ? hcloud_floating_ip.bambiengine_ip[0].ip_address : "127.0.0.1",
Expand Down
13 changes: 13 additions & 0 deletions terraform/user_data_arkime.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ systemctl enable --now "wg-quick@internal"

# Start elasticsearch cluster
sed -i -e "s#\[\[ARKIME\]\]#192.168.2.${id}#g" /services/BambiArkimeElasticsearch/docker-compose.yml
sed -i -e "s#\[\[INITIAL_MASTER_NODES\]\]#${masters}#g" /services/BambiArkimeElasticsearch/docker-compose.yml
sed -i -e "s#\[\[SEED_HOSTS\]\]#${seeds}#g" /services/BambiArkimeElasticsearch/docker-compose.yml
cd /services/BamiArkimeElasticsearch/
docker compose up -d

# Start Arkime cluster
sed -i -e "s#\[\[ARKIME\]\]#192.168.2.${id}#g" /services/BambiArkime/config.ini
cd /services/BamiArkime/
docker compose build
if [ ${id} -eq 1 ]
#/opt/arkime/db/db.pl "http://192.168.2.${id}:9200" init
#/opt/arkime/bin/arkime_add_user.sh admin "Admin User" admin --admin
then
fi

#docker compose up -d

0 comments on commit 48ecdf1

Please sign in to comment.