echo -n “xxx” | sha256sum
パスワードのsha256を生成。
mkdir graylog
cd graylog
vim docker-compose.yml
docker compose up -d
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
services: mongo: container_name: mongo image: mongo:6.0.7 volumes: - mongo_data:/data/db restart: always elasticsearch: container_name: elasticsearch image: docker.elastic.co/elasticsearch/elasticsearch:7.17.10 environment: - discovery.type=single-node - ES_JAVA_OPTS=-Xms512m -Xmx512m - xpack.security.enabled=false ulimits: memlock: soft: -1 hard: -1 mem_limit: 1g restart: always volumes: - es_data:/usr/share/elasticsearch/data graylog: container_name: graylog image: graylog/graylog:6.3.5 depends_on: - mongo - elasticsearch environment: GRAYLOG_PASSWORD_SECRET: somepasswordpepper GRAYLOG_ROOT_PASSWORD_SHA2: xxx GRAYLOG_HTTP_EXTERNAL_URI: http://xxx:9000/ GRAYLOG_ELASTICSEARCH_HOSTS: http://elasticsearch:9200 ports: - "9000:9000" - "1514:1514" - "1514:1514/udp" restart: always volumes: mongo_data: es_data: |
ufw allow to any port 1514,9000 proto tcp
ufw allow to any port 1514 proto udp
ufw reload
docker logs graylog-graylog-1
で初期パスワードを確認。
http://xxx:9000/
にアクセス。
Configure a certificate authorityはスキップして大丈夫。
・Syslog
System>Inputs>Syslog UDP
Launch new inputをクリック。
Titleを入力、Portを1514にしてLaunch Inputをクリック。
RUNNING状態になっていなければSETUPをクリックして設定する。
・保存期間
System>Indices>Default index set>Edit
Rotation & Retentionを変更する。
Max,days in storageとMin,days in storageを変更し、
Update index setをクリック