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

Adds agent information in requests to the server #277

Merged
merged 28 commits into from
Nov 8, 2024

Conversation

Nicogp
Copy link
Member

@Nicogp Nicogp commented Nov 6, 2024

Related issue
#256

Description

This PR adds the ability for the agent to obtain OS, platform and IP information and report it to the server on requests.

  • Headers:
    • Authorization: Bearer token
    • User_agent:
      • version: VERSION
      • type: Endpoint
      • arch: ARCH
      • platform: PLATFORM

Example: WazuhXDR/5.0.0 (Endpoint; x86_64; Linux)

  • Body: json
    • os: OS
    • platform: PLATFORM
    • arch: ARCH
    • ip: IP (primary)
    • type: Endpoint
    • version: VERSION
    • groups: [GROUPS] (optional)
    • uuid: UUID

Example:

{
    "agent": {
        "groups": [],
        "host": {
            "architecture": "aarch64",
            "hostname": "tomas",
            "ip": "172.20.0.1",
            "os": {
                "name": "Ubuntu",
                "platform": "Linux"
            }
        },
        "id": "sldkfjoqwvnskdsoif",
        "key": "oiefsakjndwreoguiweo",
        "type": "Endpoint",
        "version": "5.0.0"
    }
}

Tests

  • Compilation without warnings in every supported platform
    • Linux
    • Windows
    • MAC OS X

Evidence using the mock server (#282)

  • Registration

image

  • Authentication & commands

image

  • Stateful

image

  • Stateless

image

@TomasTurina TomasTurina linked an issue Nov 6, 2024 that may be closed by this pull request
@TomasTurina TomasTurina force-pushed the feat/256-add-agent-information branch 3 times, most recently from 9377016 to 62c568d Compare November 6, 2024 20:46
@TomasTurina TomasTurina marked this pull request as ready for review November 6, 2024 20:47
@TomasTurina TomasTurina requested review from jr0me, aritosteles and sdvendramini and removed request for jr0me and aritosteles November 6, 2024 20:47
Copy link
Contributor

@aritosteles aritosteles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TomasTurina TomasTurina force-pushed the feat/256-add-agent-information branch from 9dc22b1 to 6149e3a Compare November 6, 2024 22:54
@TomasTurina TomasTurina force-pushed the feat/256-add-agent-information branch 3 times, most recently from 0f61919 to 0d36b23 Compare November 7, 2024 15:32
@TomasTurina TomasTurina requested a review from jr0me November 7, 2024 15:33
Copy link
Member

@jr0me jr0me left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's create an issue to break the dependency between AgentInfo and SysInfo for the feature complete.

Other than that, LGTM.

@TomasTurina TomasTurina force-pushed the feat/256-add-agent-information branch 2 times, most recently from 066825e to 43da8fb Compare November 7, 2024 19:24
@jr0me jr0me force-pushed the feat/256-add-agent-information branch from ccc705d to 7a78696 Compare November 7, 2024 22:14
TomasTurina and others added 24 commits November 8, 2024 19:21
…endpoint needed in the request to the manager. Initially the information is encoded.
@TomasTurina TomasTurina force-pushed the feat/256-add-agent-information branch from 1dce39f to 502c038 Compare November 8, 2024 19:25
@TomasTurina TomasTurina force-pushed the feat/256-add-agent-information branch from 90f0c94 to 5ca60e6 Compare November 8, 2024 20:46
@TomasTurina TomasTurina merged commit 4fb8806 into master Nov 8, 2024
5 checks passed
@TomasTurina TomasTurina deleted the feat/256-add-agent-information branch November 8, 2024 22:26
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.

Attach agent information in communication to the server
5 participants