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

Fix UI crash on retrieving log collection configuration for macos agent #6104

Conversation

jbiset
Copy link
Member

@jbiset jbiset commented Nov 7, 2023

Description

This pull request fix UI cash on retrieving log collection configuration for macOS agent. The issue occurs when you go to the settings of a macOS agent and navigate to the Log Collection section. The reason for this error is described in this comment.

Issues Resolved

Evidence

Log Collection section (UI)

evidence_macos_response

Log Collection test

evidence_run_test

Test

  1. To be able to reproduce the context you must have an agent on macOS or you can modify the imposter to emulate the response.
Emulate agent response on macOS with the imposter

You must go to the file ~/docker/imposter/agents/configuration/logcollector-localfile.json and change the default response to the following and restart the imposter:

{
	"data": {
		"localfile": [
			{
				"logformat": "full_command",
				"command": "netstat -an | awk '{if ((/^(tcp|udp)/) && ($4 != \".\") && ($5 == \".\")) {print $1\" \"$4\" \"$5}}' | sort -u",
				"alias": "netstat listening ports",
				"ignore_binaries": "no",
				"target": [
					"agent"
				],
				"frequency": 360
			}
		]
	},
	"error": 0
}
  1. Go to the agents section, then select the Configuration tab and go to Log Collection within the Log Data analysis section

  2. You should no longer see the error described in the issue and should see what is shown in the evidence.

  3. Leave the imposter back as it was originally and verify that it works normally when it is not a macOS agent.

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@jbiset jbiset self-assigned this Nov 7, 2023
@jbiset jbiset requested a review from a team as a code owner November 7, 2023 16:01
@jbiset jbiset linked an issue Nov 7, 2023 that may be closed by this pull request
yenienserrano
yenienserrano previously approved these changes Nov 8, 2023
Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

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

LGTM

MacOS
image

Another agent
image

@lucianogorza lucianogorza self-requested a review November 8, 2023 14:14
@lucianogorza
Copy link
Member

lucianogorza commented Nov 8, 2023

MacOS Agent

image

Another Agent

image

LGTM

lucianogorza
lucianogorza previously approved these changes Nov 8, 2023
Copy link
Contributor

github-actions bot commented Nov 8, 2023

Code coverage (Jest) % values
Statements 11.73% ( 4048 / 34494 )
Branches 7.95% ( 1853 / 23289 )
Functions 11.27% ( 930 / 8251 )
Lines 11.91% ( 3937 / 33034 )

@asteriscos asteriscos merged commit 226f7bb into 4.7.1 Nov 8, 2023
2 checks passed
@asteriscos asteriscos deleted the fix/ui-crash-on-retrieving-log-collection-configuration-for-macos-agent-6088 branch November 8, 2023 18:06
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.

UI crash on retrieving Log Collection Configuration for macOS Agent
4 participants