How to set require-tls to False when enabling alertmanager email receiver via uipathctl in AS23-4-1 ?

Uipathctl tool does not appear to be able to correctly set require_tls.

Issue Description:

When following the documentation to set up Alertmanager alert email receiver, there is no direct option to set require-tls to false based on customer requirements.


It is required to do this manually by editing the alertmanager secret.

Steps to set up email alerts with require-tls set to false:

  1. Using uipathctl run the command to configure alert email receiver.
  • Example for no authentication:
    • uipathctl config alerts add-email --name test --to "admin@example.com" --from "admin@example.com" --smtp "server.mycompany.com:25"

  • Example for authentication:
    • uipathctl config alerts add-email --name test --to "admin@example.com" --from "admin@example.com" --smtp "server.mycompany.com:587" --username admin --password "somepassword"

  1. Reset alert manager sts so config is enabled:

kubectl -n cattle-monitoring-system rollout restart sts alertmanager-rancher-monitoring-alertmanager

  1. Check alertmanager config via secret:

kubectl -n cattle-monitoring-system get secret alertmanager-config -ojson | jq -r '.data."alertmanager.yaml"' | base64 -d

  1. On Review, it is observed that require-tls is set to true as this is set by default, regardless of the flag used.

  1. Backup alertmanager-config secret

kubectl -n cattle-monitoring-system get secret alertmanager-config -oyaml > alertmanager-config.yaml

  1. Get the relevant config from alertmanager-config secret

kubectl -n cattle-monitoring-system get secret alertmanager-config -ojson | jq -r '.data."alertmanager.yaml"' | base64 -d > alertmanager.yaml

  1. Update the alertmanager.yaml to set require_tls to false

vi alertmanager.yaml

  1. On the require_tls under the email receiver that has been set up, change it from true to false

- name: test

email_configs:

- send_resolved: true

to:

from:

hello: uipath

smarthost: :

auth_username:

auth_password:

require_tls: false

  1. Apply changes to file using :wq!

  1. To apply the change to kubernetes, run the following command

updated_alertmanager_config=$(cat alertmanager.yaml | base64 -w0) kubectl -n cattle-monitoring-system patch secret alertmanager-config --type='json' -p='[{"op" : "replace", "path" : "/data/alertmanager.yaml", "value" : "'"${updated_alertmanager_config}"'"}]'

  1. Run the following command to confirm that the change was successfully applied

kubectl -n cattle-monitoring-system get secret alertmanager-config -ojson | jq -r '.data."alertmanager.yaml"' | base64 -d

  1. Validate that the require-tls setting is set to false.

  1. Validate in logs if alertmanager has alerts enabled by checking logs or if there were issues by checking the alertmanager logs.

kubectl -n cattle-monitoring-system logs alertmanager-rancher-monitoring-alertmanager-0

  1. If there are no errors then this should be set up correctly and alerts should be received via the email receiver.

Note: If still there are errors, capture the errors, gather a support bundle and open a support ticket with UiPath Product Support Team.