wazuh / wazuh-agent

The Wazuh agent for endpoints.
https://wazuh.com
GNU Affero General Public License v3.0
32 stars 19 forks source link

Prevent Object Nesting in Agent Registration #312

Closed vikman90 closed 6 days ago

vikman90 commented 1 week ago
Related issue
Closes #311

This PR aims to undo object nesting in the agent registration request.

New behavior

Agent registration

{
    "groups": [],
    "host": {
        "architecture": "x86_64",
        "hostname": "Rocket",
        "ip": [
            "172.28.54.98",
            "fe80::215:5dff:feb2:94ca"
        ],
        "os": {
            "name": "Ubuntu",
            "platform": "Linux"
        }
    },
    "id": "7b565a01-8df4-4943-9fb1-6d347ab21853",
    "key": "XTsM35bqCfVGJCBJvvOiButIRMa835Xk",
    "name": "dummy",
    "type": "Endpoint",
    "version": "5.0.0"
}

Unchanged behavior

Stateless message

{"agent":{"groups":[],"host":{"architecture":"x86_64","hostname":"Rocket","ip":["172.28.54.98","fe80::215:5dff:feb2:94ca"],"os":{"name":"Ubuntu","platform":"Linux"}},"id":"7b565a01-8df4-4943-9fb1-6d347ab21853","name":"dummy","type":"Endpoint","version":"5.0.0"}}
{"module":"logcollector","type":"file"}
{"event":{"ingested":"2024-11-18T16:37:43.109Z","module":"logcollector","original":"2024-11-18T17:37:42.822166+01:00 Rocket kernel: docker0: port 1(vethb6c8536) entered disabled state","provider":"syslog"},"log":{"file":{"path":"/var/log/syslog"}},"tags":["mvp"]}