2024-08-25 23:00:54 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# Copyright (C) 2024 Spearhead Systems SRL
|
|
|
|
|
|
|
|
import cmk.utils.password_store
|
|
|
|
|
|
|
|
def agent_azure_args(params, hostname, ipaddress):
|
|
|
|
# Extract password either from params, or from password store:
|
|
|
|
# ('password', '<some password>'): password is in params directly
|
|
|
|
# ('store', '<password name>'): password must be looked up in store by name
|
|
|
|
password_info = params["password"]
|
|
|
|
if password_info[0] == "password":
|
|
|
|
password = password_info[1]
|
|
|
|
else:
|
|
|
|
password = cmk.utils.password_store.extract(password_info[1])
|
|
|
|
|
|
|
|
return [
|
|
|
|
params["tenant"],
|
|
|
|
params["username"],
|
2024-11-07 15:54:45 +01:00
|
|
|
password,
|
|
|
|
params.get("proxy") or "" # optional
|
2024-08-25 23:00:54 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
special_agent_info["azure_keyvault"] = agent_azure_args
|
|
|
|
special_agent_info["azure_firewall"] = agent_azure_args
|
|
|
|
special_agent_info["azure_defender"] = agent_azure_args
|