Merge pull request #635 from Icinga:feature/add_configuration_arg_for_agent_cipher_list

Feature: Adds support to allow Agent cipher list configuration

Adds support for `Write-IcingaAgentApiConfig` function to configure the Icinga Agent TLS cipher list setting.
This commit is contained in:
Lord Hepipud 2023-07-11 12:10:51 +02:00 committed by GitHub
commit 1db93896f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -22,6 +22,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
### Enhancements
* [#623](https://github.com/Icinga/icinga-powershell-framework/issues/623) Adds support to provide the Icinga service user written as `user@domain`
* [#635](https://github.com/Icinga/icinga-powershell-framework/pull/635) Adds support for `Write-IcingaAgentApiConfig` function to configure the Icinga Agent TLS cipher list setting by new argument `-CipherList`
### Enhancements

View file

@ -1,7 +1,8 @@
function Write-IcingaAgentApiConfig()
{
param(
[int]$Port = 5665
param (
[int]$Port = 5665,
[string]$CipherList = $null
);
[string]$ApiConf = '';
@ -11,6 +12,9 @@ function Write-IcingaAgentApiConfig()
$ApiConf = [string]::Format('{0} accept_config = true;{1}', $ApiConf, "`r`n");
$ApiConf = [string]::Format('{0} bind_host = "::";{1}', $ApiConf, "`r`n");
$ApiConf = [string]::Format('{0} bind_port = {1};{2}', $ApiConf, $Port, "`r`n");
if ([string]::IsNullOrEmpty($CipherList) -eq $FALSE) {
$ApiConf = [string]::Format('{0} cipher_list = "{1}";{2}', $ApiConf, $CipherList, "`r`n");
}
$ApiConf = [string]::Format('{0}{1}{2}{2}', $ApiConf, '}', "`r`n");
$ApiConf = $ApiConf.Substring(0, $ApiConf.Length - 4);