refs #2448 derive a strong password from the default opengnsys weak one #87

Merged
nserrano merged 1 commits from ogkdf into main 2025-07-11 14:07:40 +02:00
2 changed files with 11 additions and 4 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.25.1] - 2025-07-11
### Changed
- Derive a strong password from the default opengnsys weak one
## [0.25.0] - 2025-07-11
## Added

View File

@ -1,15 +1,16 @@
#!/bin/bash
F=/etc/filebeat/filebeat.yml
OGLOG_PORT=9200
OPENSEARCH_PORT=9200
if [ -f $F ]; then
PASS=$(grep "^[ ]*\(export \)\?OPTIONS=" /scripts/ogfunctions 2>&1 |sed 's/\(.*\)pass=\(\w*\)\(.*\)/\2/') ## taken from a sibling script
PASS=${PASS:-"og"}
PASS=OG+$(echo -n $PASS |sha256sum |cut -c1-12) ## og KDF
chmod 0600 $F
sed -i -e "s/__OGLOG_IP__/$oglog/g" \
-e "s/__OGLOG_PORT__/$OGLOG_PORT/g" \
-e "s/__OPENSEARCH_PASSWORD__/$PASS/g" \
sed -i -e "s/__OGLOG_IP__/$oglog/g" \
-e "s/__OGLOG_PORT__/$OPENSEARCH_PORT/g" \
-e "s/__OPENSEARCH_PASSWORD__/$PASS/g" \
$F
unset PASS