Skip to content

Conversation

@jajeffries
Copy link
Contributor

This pull request introduces support for integrating the Fleet-based secrets manager with the Fleet configuration manager, enabling secure secrets distribution over MQTT. It adds new types and message schemas for secrets management, updates the Fleet configuration manager to bind and handle secrets, and refactors several types and methods for consistency and extensibility. The changes also include improvements to topic handling in the MQTT connection and add necessary configuration fields for secrets management.

Fleet secrets manager integration

  • Added logic in agent/agent.go to bind the Fleet secrets manager to the Fleet configuration manager when both are active, ensuring secrets can be resolved during configuration.
  • Implemented BindSecretsManager in FleetConfigManager to register MQTT topic handlers and bind the secrets manager for secure communication.

Secrets message schema and configuration

  • Introduced new message types and error codes for secrets operations in agent/configmgr/fleet/messages/secrets_messages.go, defining request, response, and update notification structures.
  • Added FleetSecretsManager type and related configuration fields to support Fleet secrets manager options in agent/config/types.go.

MQTT connection enhancements

  • Added topic handler registration and dispatching to MQTTConnection, allowing dynamic handling of secrets-related MQTT topics. [1] [2] [3] [4] [5]
  • Updated topic templates and TokenResponseTopics to include secrets request, response, and update topics for proper routing. [1] [2] [3]

Refactoring and consistency

  • Renamed fleetConfigManager to FleetConfigManager and updated related constructors and methods for clarity and adherence to Go naming conventions. [1] [2] [3] [4] [5] [6] [7]
  • Updated test utilities to dynamically find available ports for more robust testing in agent/configmgr/fleet_test.go. [1] [2]

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

Go test coverage

STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟢 PASS 1.05s github.com/netboxlabs/orb-agent/agent 43.8% 6 0 0
🟢 PASS 31.89s github.com/netboxlabs/orb-agent/agent/backend 75.2% 40 0 0
🟢 PASS 6.03s github.com/netboxlabs/orb-agent/agent/backend/devicediscovery 67.3% 4 0 0
🟢 PASS 0.96s github.com/netboxlabs/orb-agent/agent/backend/mocks 0.0% 0 0 0
🟢 PASS 6.03s github.com/netboxlabs/orb-agent/agent/backend/networkdiscovery 59.0% 4 0 0
🟢 PASS 4.02s github.com/netboxlabs/orb-agent/agent/backend/opentelemetryinfinity 45.2% 2 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/pktvisor 67.0% 2 0 0
🟢 PASS 6.04s github.com/netboxlabs/orb-agent/agent/backend/snmpdiscovery 59.0% 4 0 0
🟢 PASS 7.04s github.com/netboxlabs/orb-agent/agent/backend/worker 68.2% 5 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/config 100.0% 6 0 0
🟢 PASS 1.37s github.com/netboxlabs/orb-agent/agent/configmgr 48.2% 32 0 0
🟢 PASS 2.71s github.com/netboxlabs/orb-agent/agent/configmgr/fleet 64.1% 141 0 0
🟢 PASS 1.02s github.com/netboxlabs/orb-agent/agent/otlpbridge 42.2% 8 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/policies 98.9% 18 0 0
🟢 PASS 1.03s github.com/netboxlabs/orb-agent/agent/policymgr 71.6% 11 0 0
🟢 PASS 18.68s github.com/netboxlabs/orb-agent/agent/secretsmgr 47.5% 65 0 0
🟢 PASS 1.02s github.com/netboxlabs/orb-agent/agent/telemetry 81.7% 19 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/version 100.0% 1 0 0

Total coverage: 58.5%

}

// Bind fleet secrets manager to fleet config manager if both are fleet-based
// This needs to happen before SolveConfigSecrets so secrets can be resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we need to discuss the agent design and the order that process happens. We bind and execute ConfigManager logic event before it was started.

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.

3 participants