Skip to content

feat(asset): report HOST category and send asset-scoped network fields on registration (#207)#208

Merged
SamuelHassine merged 2 commits into
mainfrom
feature/asset-category-host
Jul 17, 2026
Merged

feat(asset): report HOST category and send asset-scoped network fields on registration (#207)#208
SamuelHassine merged 2 commits into
mainfrom
feature/asset-category-host

Conversation

@SamuelHassine

@SamuelHassine SamuelHassine commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

Adapts the agent registration payload to the OpenAEV asset taxonomy remodel:

  • Network fields renamed to the asset level: endpoint_ips -> asset_ips, endpoint_hostname -> asset_hostname, endpoint_mac_addresses -> asset_mac_addresses.
  • Platform / arch / agent_version stay endpoint-scoped; asset_name / asset_external_reference / asset_category (HOST) are asset_*.
  • The hostname is now computed once and reused for asset_name and asset_hostname (review feedback: avoids a redundant syscall and any inconsistency between the two fields), and the payload keys are grouped by scope (asset_, endpoint_, agent_*) for readability. Wire format unchanged.

The backend keeps a JsonAlias on the legacy endpoint_* names so already-deployed agents keep registering until they self-update; this aligns the agent source with the new canonical wire names used by the platform, injectors, collectors and the Python client.

The implant needs no change (it sends no endpoint_* asset fields).

Closes #207

Test plan

  • CI green on all platforms (fmt, audit, clippy on ubuntu/windows/macos, tests and builds on all six targets, coverage, installer script packaging).
  • Build the agent and register against an OpenAEV backend that includes the asset taxonomy remodel; confirm the endpoint is created with hostname / IPs / MAC addresses populated.

Copilot AI review requested due to automatic review settings July 17, 2026 07:46
@github-actions github-actions Bot added the filigran team Item from the Filigran team. label Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the agent registration payload (src/api/register_agent.rs) to align with the OpenAEV asset taxonomy remodel by emitting canonical asset_* network fields and reporting the asset category as HOST.

Changes:

  • Renamed network registration fields from endpoint_* to asset_* (asset_ips, asset_hostname, asset_mac_addresses).
  • Added asset_category: "HOST" to the registration payload.
  • Kept endpoint-scoped fields unchanged (endpoint_platform, endpoint_arch, endpoint_agent_version).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/api/register_agent.rs Outdated
@SamuelHassine

Copy link
Copy Markdown
Member Author

Review-and-fix pass complete:

  • Addressed the Copilot review comment: hostname::get() is now called once and reused for asset_name and asset_hostname (commit 5737151). The payload keys were also grouped by scope (asset_, endpoint_, agent_*); the wire format is unchanged.
  • Independent review of src/api/register_agent.rs and its caller (keep_alive.rs ping loop) found no further issues: registration errors are logged and retried on the next 2-minute ping, list_jobs in manage_jobs.rs sends no renamed field, and the backend keeps JsonAlias compatibility for legacy endpoint_* names.
  • All review threads are resolved and all CI checks are green on the latest commit (fmt + audit, clippy and tests/builds on ubuntu/windows/macos x86_64 + arm64, coverage, installer packaging, signed commits, PR title validation, CLA).
  • PR description updated to reflect the final state.

Remaining (non-CI) blocker: the branch protection requires one approving review, and the PR author cannot self-approve - a maintainer approval is the only step left before merge.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

…scope (#207)

Resolve the review comment about hostname::get() being called twice in the
registration payload (redundant syscall, potential inconsistency between
asset_name and asset_hostname if one call fails). Compute it once and reuse it.

Also group the payload keys by scope (asset_*, endpoint_*, agent_*) for
readability; the wire format is unchanged.
@SamuelHassine
SamuelHassine force-pushed the feature/asset-category-host branch from 8d796a0 to 9dd0b83 Compare July 17, 2026 18:59
@SamuelHassine
SamuelHassine merged commit 243a532 into main Jul 17, 2026
22 checks passed
@SamuelHassine
SamuelHassine deleted the feature/asset-category-host branch July 17, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(registration): adapt agent registration to the OpenAEV asset taxonomy remodel (asset_* network fields)

2 participants