Skip to content
Snippets Groups Projects
Commit ec956717 authored by Václav Bartoš's avatar Václav Bartoš
Browse files

Configuration of SMTP params to allow mailing from user-mgmt-ui

parent 0051a4a0
No related branches found
No related tags found
No related merge requests found
...@@ -83,7 +83,7 @@ else ...@@ -83,7 +83,7 @@ else
echo echo
echo echo
echo echo
echo "Please provide the following parameters for the first SOCTools user, which will be created during the initialization with organization admin privileges:" echo "Please provide the following parameters for the first SOCTools user, which will be created during the initialization with organization admin privileges (other user accounts can be created later via a web GUI):"
echo "username - Username of the user" echo "username - Username of the user"
echo "firstname - First name of the user" echo "firstname - First name of the user"
echo "lastname - Last name of the user" echo "lastname - Last name of the user"
...@@ -105,16 +105,37 @@ else ...@@ -105,16 +105,37 @@ else
DN="CN=${CN}" DN="CN=${CN}"
echo echo
echo echo
echo "Please provide the configuration for sending emails via SMTP (used by user management web GUI to send emails to users)."
echo "You can leave it empty if you are just testing and don't plan to add more users."
echo " host - Hostname of the SMTP server"
echo " sender - Email address used as the sender (e.g. 'soctools@${soctoolsproxy}')"
echo " username - Authenticate using this username (leave empty to send emails without authentication)"
echo " password - Authenticate using this password (WARNING: Password is stored in clear in a configuration file)"
echo
read -p "host []: " smtp_host
read -p "sender [soctools@${soctoolsproxy}]: " smtp_sender
if [ -z "$smtp_sender" ]; then
smtp_sender=soctools@${soctoolsproxy}
fi
read -p "username []: " smtp_username
read -p "password []: " smtp_password
echo
echo echo
echo "Please check the gathered variables and type 'yes' if everything is correct:" echo "Please check the gathered variables and type 'yes' if everything is correct:"
echo "soctoolsproxy: $soctoolsproxy" echo "soctoolsproxy: $soctoolsproxy"
echo "organization: $organization" echo "organization: $organization"
echo "firstname: $firstname" echo "user:"
echo "lastname: $lastname" echo " firstname: $firstname"
echo "username: $username" echo " lastname: $lastname"
echo "email: $email" echo " username: $username"
echo "DN: $DN" echo " email: $email"
echo "CN: $CN" echo " DN: $DN"
echo " CN: $CN"
echo "smtp config:"
echo " host: $smtp_host"
echo " sender: $smtp_sender"
echo " username: $smtp_username"
echo " password: $smtp_password"
echo echo
echo echo
read -p "Correct? type 'yes' or 'no': " ANSWER read -p "Correct? type 'yes' or 'no': " ANSWER
...@@ -125,14 +146,17 @@ else ...@@ -125,14 +146,17 @@ else
else else
cp -f group_vars/all/variables.template group_vars/all/variables.yml cp -f group_vars/all/variables.template group_vars/all/variables.yml
sed -i "s/CHANGE_ME_TO_FQDN/${soctoolsproxy}/g" group_vars/all/variables.yml sed -i "s/CHANGE_ME_TO_FQDN/${soctoolsproxy}/g" group_vars/all/variables.yml
sed -i "s/soctools.test/${domain}/g" group_vars/all/variables.yml sed -i "s/CHANGE_ME_ORG/${organization}/g" group_vars/all/variables.yml
sed -i "11s/CHANGE_ME_FIRST_NAME/${firstname}/" group_vars/all/variables.yml sed -i "s/CHANGE_ME_SMTP_HOST/${smtp_host}/g" group_vars/all/variables.yml
sed -i "12s/CHANGE_ME_LAST_NAME/${lastname}/" group_vars/all/variables.yml sed -i "s/CHANGE_ME_SMTP_SENDER/${smtp_sender}/g" group_vars/all/variables.yml
sed -i "13s/soc_admin/${username}/" group_vars/all/variables.yml sed -i "s/CHANGE_ME_SMTP_USERNAME/${smtp_username}/g" group_vars/all/variables.yml
sed -i "14s/soc_admin@example.org/${email}/" group_vars/all/variables.yml sed -i "s/CHANGE_ME_SMTP_PASSWORD/${smtp_password}/g" group_vars/all/variables.yml
sed -i "15s/CN=soc_admin/${DN}/" group_vars/all/variables.yml sed -i "s/CHANGE_ME_FIRST_NAME/${firstname}/" group_vars/all/variables.yml
sed -i "16s/soc_admin/${CN}/" group_vars/all/variables.yml sed -i "s/CHANGE_ME_LAST_NAME/${lastname}/" group_vars/all/variables.yml
sed -i "26s/soc_admin/${username}/" group_vars/all/variables.yml sed -i "s/CHANGE_ME_USERNAME/${username}/" group_vars/all/variables.yml
sed -i "s/CHANGE_ME_EMAIL/${email}/" group_vars/all/variables.yml
sed -i "s/CHANGE_ME_DN/${DN}/" group_vars/all/variables.yml
sed -i "s/CHANGE_ME_CN/${CN}/" group_vars/all/variables.yml
echo echo
echo echo
echo "variables file generated (group_vars/all/variables.yml)" echo "variables file generated (group_vars/all/variables.yml)"
......
...@@ -4,16 +4,28 @@ ...@@ -4,16 +4,28 @@
soctoolsproxy: "CHANGE_ME_TO_FQDN" soctoolsproxy: "CHANGE_ME_TO_FQDN"
# Short organization name (will be used as org. name in MISP, The Hive and Cortex) # Short organization name (will be used as org. name in MISP, The Hive and Cortex)
org_name: "SOCTools" org_name: "CHANGE_ME_ORG"
# SMTP connection parameters - used by user-mgmt-ui to send emails with access information to users
smtp:
# hostname and port of SMTP server to use (TLS connection is always used)
host: "CHANGE_ME_SMTP_HOST"
port: 465
# sender email address ("From:" header)
sender: "CHANGE_ME_SMTP_SENDER"
# user and pass to authenticate (optional, it tries to send email without authentication if empty)
username: "CHANGE_ME_SMTP_USERNAME"
password: "CHANGE_ME_SMTP_PASSWORD"
#List of users which will be created during the initialization with organization admin privileges #List of users which will be created during the initialization with organization admin privileges
soctools_users: soctools_users:
- firstname: "CHANGE_ME_FIRST_NAME" - firstname: "CHANGE_ME_FIRST_NAME"
lastname: "CHANGE_ME_LAST_NAME" lastname: "CHANGE_ME_LAST_NAME"
username: "soc_admin" username: "CHANGE_ME_USERNAME"
email: "soc_admin@example.org" email: "CHANGE_ME_EMAIL"
DN: "CN=soc_admin" DN: "CHANGE_ME_DN"
CN: "soc_admin" CN: "CHANGE_ME_CN"
# - firstname: "SOC Admin 2" # - firstname: "SOC Admin 2"
# lastname: "" # lastname: ""
# username: "soc_admin_2" # username: "soc_admin_2"
......
...@@ -33,8 +33,15 @@ ...@@ -33,8 +33,15 @@
chdir: '{{playbook_dir}}/user-mgmt-ui' chdir: '{{playbook_dir}}/user-mgmt-ui'
warn: no warn: no
- name: configure user-mgmt-ui
template:
src: '{{playbook_dir}}/user-mgmt-ui/config.yml.j2'
dest: '{{playbook_dir}}/user-mgmt-ui/config.yml'
- name: create systemd service file for user-mgmt-ui - name: create systemd service file for user-mgmt-ui
template: src=user-mgmt-ui.service.j2 dest=/etc/systemd/system/user-mgmt-ui.service mode=644 template:
src: user-mgmt-ui.service.j2
dest: /etc/systemd/system/user-mgmt-ui.service mode=644
- name: enable and start user-mgmt-ui service - name: enable and start user-mgmt-ui service
systemd: systemd:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment