Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change platform field in header for type #373

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cborla
Copy link
Member

@cborla cborla commented Nov 29, 2024

Related issue
Close #369

This PR suggests changing the type field in the header to the platform field, that way we maintain compatibility with the documentation and the system table, the update would be in the header.

Configuration options

default wazuh-agent.yml

agent:
  server_url: https://localhost:27000
  registration_url: https://localhost:55000
  path.data: /tmp/wazuh-agent-data
  retry_interval: 30s
inventory:
  enabled: false
  interval: 1h
  scan_on_start: true
  hardware: true
  system: true
  networks: true
  packages: true
  ports: true
  ports_all: true
  processes: true
  hotfixes: true
logcollector:
  enabled: false
  localfiles:
    - /var/log/auth.log
  reload_interval: 1m
  file_wait: 500ms

Proposed Solution

{
    "agent":
    {
        "groups":
        [],
        "host":
        {
            "architecture": "x86_64",
            "hostname": "VBox",
            "ip":
            [
                "10.0.2.5",
                "fe80::15c0:9312:3e94:ccc4",
                "192.168.78.102",
                "fe80::f827:ee12:cf2f:e5d4"
            ],
            "os":
            {
                "name": "Ubuntu",
                "type": "Linux",
                "version": "24.04.1 LTS (Noble Numbat)"
            }
        },
        "id": "10c69d6d-a80c-49ac-92ad-ae320fba8b93",
        "name": "",
        "type": "Endpoint",
        "version": "5.0.0"
    }
}

Tests

19: Test timeout computed to be: 10000000
19: [==========] Running 12 tests from 1 test suite.
19: [----------] Global test environment set-up.
19: [----------] 12 tests from AgentInfoTest
19: [ RUN      ] AgentInfoTest.TestDefaultConstructorDefaultValues
19: [       OK ] AgentInfoTest.TestDefaultConstructorDefaultValues (40 ms)
19: [ RUN      ] AgentInfoTest.TestPersistedValues
19: [       OK ] AgentInfoTest.TestPersistedValues (36 ms)
19: [ RUN      ] AgentInfoTest.TestSetName
19: [       OK ] AgentInfoTest.TestSetName (26 ms)
19: [ RUN      ] AgentInfoTest.TestSetKey
19: [       OK ] AgentInfoTest.TestSetKey (26 ms)
19: [ RUN      ] AgentInfoTest.TestSetBadKey
19: [       OK ] AgentInfoTest.TestSetBadKey (34 ms)
19: [ RUN      ] AgentInfoTest.TestSetEmptyKey
19: [       OK ] AgentInfoTest.TestSetEmptyKey (19 ms)
19: [ RUN      ] AgentInfoTest.TestSetUUID
19: [       OK ] AgentInfoTest.TestSetUUID (25 ms)
19: [ RUN      ] AgentInfoTest.TestSetGroups
19: [       OK ] AgentInfoTest.TestSetGroups (22 ms)
19: [ RUN      ] AgentInfoTest.TestLoadMetadataInfoNoSysInfo
19: [       OK ] AgentInfoTest.TestLoadMetadataInfoNoSysInfo (29 ms)
19: [ RUN      ] AgentInfoTest.TestLoadMetadataInfoRegistration
19: [       OK ] AgentInfoTest.TestLoadMetadataInfoRegistration (16 ms)
19: [ RUN      ] AgentInfoTest.TestLoadMetadataInfoConnected
19: [       OK ] AgentInfoTest.TestLoadMetadataInfoConnected (22 ms)
19: [ RUN      ] AgentInfoTest.TestLoadHeaderInfo
19: [       OK ] AgentInfoTest.TestLoadHeaderInfo (27 ms)
19: [----------] 12 tests from AgentInfoTest (329 ms total)
19: 
19: [----------] Global test environment tear-down
19: [==========] 12 tests from 1 test suite ran. (329 ms total)
19: [  PASSED  ] 12 tests.
1/1 Test #19: AgentInfoTest ....................   Passed    0.33 sec

100% tests passed, 0 tests failed out of 1

@cborla cborla requested a review from vikman90 November 29, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standardize platform Field in Header and Inventory Messages
1 participant