Hi.
Wazuh manager version 4.4.0(so are wazuh-indexer, wazuh-dashboard).
My lab's agents versions:
- 4.3.1(linux) - 001;
- 4.2.5(solaris - not upgradable, I know) - 003;
- 4.2.5(windows) - 004
So I've tried to do remote upgrade(on manager side) with both variants(cli & rest).
Cli(001, linux):
# /var/ossec/bin/agent_upgrade -l
ID Name Version
001 linux-test-1 Wazuh v4.3.1
003 solaris-test-1 Wazuh v4.2.5
004 PC1 Wazuh v4.2.5
Total outdated agents: 3
# /var/ossec/bin/agent_upgrade -a 001
Upgrading...
Failed upgrades:
Agent 001 status: The repository is not reachable
REST(001, linux):
curl -k -X PUT "https://localhost:55000/agents/upgrade?agents_list=001&pretty=true" -H "Authorization: Bearer $TOKEN"
{
"data": {
"affected_items": [
{
"agent": "001",
"task_id": 18
}
],
"total_affected_items": 1,
"total_failed_items": 0,
"failed_items": []
},
"message": "All upgrade tasks were created",
"error": 0
}
curl -k -X GET "https://localhost:55000/agents/upgrade_result?agents_list=001&pretty=true" -H "Authorization: Bearer $TOKEN"
{
"data": {
"affected_items": [
{
"message": "Success",
"agent": "001",
"task_id": 18,
"node": "worker-node-1",
"module": "upgrade_module",
"command": "upgrade",
"status": "Error",
"error_msg": "The repository is not reachable",
"create_time": "2022-06-20T10:59:44Z",
"update_time": "2022-06-20T11:00:02Z"
}
],
"total_affected_items": 1,
"total_failed_items": 0,
"failed_items": []
},
"message": "All upgrade tasks were returned",
"error": 0
}
I have no corresponding logs for that event, neither manager nor agent's side in ossec.log.
Shared conf of , for example, linux is default:
<agent_config>
<!-- Shared agent configuration here -->
<agent-upgrade>
<enabled>yes</enabled>
<notification_wait_start>60s</notification_wait_start>
<notification_wait_factor>4</notification_wait_factor>
<notification_wait_max>2h</notification_wait_max>
<ca_verification>
<enabled>yes</enabled>
<ca_store>etc/wpk_root.pem</ca_store>
</ca_verification>
</agent-upgrade>
...
Manager and worker conf of is default:
...
<agent-upgrade>
<chunk_size>16384</chunk_size>
<wpk_repository>packages.wazuh.com/4.x/wpk/</wpk_repository>
<max_threads>16</max_threads>
</agent-upgrade>
...
I know that agent-upgrade is not neccessary for default conf, but it doesn't work either way.
I use proxy(http/HTTP/https/HTTPS) in my /etc/environment of manager host and have no issues with curl/dnf/wget.
Below is curl output from manger's side to packages.wazuh.com/4.x/wpk:
curl -i https://packages.wazuh.com/4.x/wpk
HTTP/1.1 200 Connection established
HTTP/2 404
content-type: application/xml
date: Tue, 28 Jun 2022 03:13:26 GMT
server: AmazonS3
x-cache: Error from cloudfront
via: 1.1 e3d7e26a5df51c85de01773b18b95a58.cloudfront.net (CloudFront)
x-amz-cf-pop: HEL51-P1
x-amz-cf-id: uvb-ZW4R0dRCiPqyalnY9Kno89-HlMuIS8e47U5-4tT9eWsvoShDXw==
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>4.x/wpk</Key><RequestId>GCSEHWHWK2QHHDJG</RequestId><HostId>tju/bWrQR/w/9gW34Taqt8DiEUHsla9i9BWMCdIpnCAHPsduX2bZlSlVANYHD2ork+NghKlkmM4=</HostId></Error>
Need help.
четверг, 26 января 2023 г. в 20:07:32 UTC+6, Christian Borla: