Skip to content

Conversation

@jajeffries
Copy link
Contributor

@jajeffries jajeffries commented Oct 23, 2025

This pull request introduces a new method to safely serialize the agent configuration for fleet management, ensuring that sensitive information such as the client secret is masked before being transmitted or logged. The changes also include comprehensive unit tests to verify the masking behavior and ensure the original configuration object remains unmodified.

Sensitive data handling improvements:

  • Added the configToSafeString method to fleetConfigManager, which replaces the ClientSecret field with "******" before serializing the configuration to YAML, preventing accidental exposure of secrets.
  • Updated the Start method to use configToSafeString instead of direct YAML marshaling, improving security when connecting to the fleet backend.

Testing enhancements:

  • Added TestFleetConfigManager_configToSafeString unit test to verify that the client secret is properly masked in the YAML output and that the original secret value is not present.
  • Added TestFleetConfigManager_configToSafeString_DoesNotModifyOriginal unit test to ensure that the original configuration object is not altered by the masking process.

@github-actions
Copy link

Go test coverage

STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent 0.0% 0 0 0
🟢 PASS 1.11s github.com/netboxlabs/orb-agent/agent/backend 33.3% 30 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/devicediscovery 67.1% 2 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/backend/mocks 0.0% 0 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/networkdiscovery 59.0% 2 0 0
🟢 PASS 4.02s github.com/netboxlabs/orb-agent/agent/backend/opentelemetryinfinity 46.3% 2 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/pktvisor 67.0% 2 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/snmpdiscovery 58.5% 2 0 0
🟢 PASS 5.03s github.com/netboxlabs/orb-agent/agent/backend/worker 68.1% 3 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/config 100.0% 6 0 0
🟢 PASS 31.19s github.com/netboxlabs/orb-agent/agent/configmgr 50.8% 18 0 0
🟢 PASS 4.54s github.com/netboxlabs/orb-agent/agent/configmgr/fleet 71.3% 126 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/policies 100.0% 15 0 0
🟢 PASS 1.03s github.com/netboxlabs/orb-agent/agent/policymgr 71.2% 10 0 0
🟢 PASS 27.41s github.com/netboxlabs/orb-agent/agent/secretsmgr 48.9% 54 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: 57.5%

@jajeffries jajeffries marked this pull request as ready for review October 23, 2025 14:52
@jajeffries jajeffries merged commit 529c9ba into develop Oct 24, 2025
5 checks passed
@jajeffries jajeffries deleted the fix/OBS-1529-sanitize-config branch October 24, 2025 11:12
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

🎉 This PR is included in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

🎉 This PR is included in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants