Skip to content

feat: add config option to set service explorer attributes #202

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

Merged
merged 2 commits into from
May 9, 2025

Conversation

obs-gh-mattcotter
Copy link
Collaborator

Description

OB-44816 Add config option to set generic attributes or resource attributes. This is needed to configure service explorer attributes when running on a host.

Checklist

  • Created tests which fail without the change (if possible)
  • Extended the README / documentation, if necessary

Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@obs-gh-mattcotter obs-gh-mattcotter force-pushed the mc/agent-attributes branch 2 times, most recently from 608d253 to 2644953 Compare May 6, 2025 21:39
@u.print_test_decorator
def run_test_windows(remote_host: u.Host, env_vars: dict) -> None:
init_command = r'Set-Location "C:\Program Files\Observe\observe-agent"; ./observe-agent init-config --token {} --observe_url {} --cloud_resource_detectors ec2'.format(
def init_config_command(env_vars: dict) -> str:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change sets a resource attribute in the config for all tests. I had some yaml spacing issues in my diff originally, so I added extra logging; that is why the test files have other changes.

@@ -65,7 +66,7 @@ def run_test_windows(remote_host: u.Host, env_vars: dict) -> None:
# status
start_command = r".\start_agent_windows.ps1"
status_command = r'Get-Service ObserveAgent;Set-Location "${Env:Programfiles}\Observe\observe-agent"; ./observe-agent status'
start_timeout = 30 # how long to wait for observe-agent to start
start_timeout = 10 # how many times to check for the running agent
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this how many times we check? is start_timeout not a correct variable name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I renamed this and added/used a default value at the call sites.

{{- range $key, $value := .Attributes }}
- key: {{ $key }}
value: {{ $value }}
action: insert
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think maybe this might need to be overrideable as well, upsert is potentially a desired value

@obs-gh-mattcotter obs-gh-mattcotter merged commit 4ecb8af into main May 9, 2025
12 checks passed
@obs-gh-mattcotter obs-gh-mattcotter deleted the mc/agent-attributes branch May 9, 2025 22:39
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.

2 participants