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

Notify when you are registering an agent without permissions #3430

Merged
merged 27 commits into from
Jul 21, 2021

Conversation

CPAlejandro
Copy link
Contributor

Hi guys,
In this PR, we have added a notification when it is not possible to change the group for this agent due to lack of permissions and we have hidden the command option when we do not have permission to access the manager's password since this made the command erroneous.

In order to test It:

  • We would have to enter with a user with group permissions and access the manager's password and see that neither of the two posters is shown.

  • Then we would have to enter with a user without both permissions and see that both permissions are activated.

Close #3406

eze9252 and others added 20 commits March 23, 2021 16:31
* First commit added testlog view and menu with navigation to dev console and testlogs.

* Added reducers for tools.

* Added PUT request logtest and pretty json.

* Clear initial value.

* Apply prettier.

* Fixed pined menu selected. Change some files js to ts.
Added updateSelectedToolsSection redux.

* Removed debuggers

* Fix error on render elements

* Fix render items

* Fixed error on tabs

* Updated CHANGELOG

* Added flyout from ruleset edit and fixed styles.

* Added OverlayMask and event to close.

* Changed title of Logtest

* Fixed styles, PR comments.
* fix(health-check): fix creation of default index-pattern

* test(fix): Added getExistingIndexPattern method, fix queryParams of get.

* test(fix): PR comments

* fix(health-check): Added validation before createWazuhIndexPattern.

* bugfix(health-check): Added all section create and refresh index in healthcheck.

* fix: some bad behaviors

* doc(changelog): add fix to changelog

* fix: add missing basePath

* fix: reject promise on error

* feat: refactor required fields

* feat: refactor const

* fix: remove unused import

* fix(health-check): Clear unnecessary returns and imports + prettier.

Co-authored-by: Franco Charriol <francocharriol@gmail.com>
…the agent (#3238)

* feat(frontend): Added a warning message in the command to install and enroll an agent

* changelog: Added PR to changelog

* fix: remove NODE_TLS_REJECT_UNAUTHORIZED warning

* Fix index validation
* fix: default pattern always is set as selected pattern

* doc: update changelog
@CPAlejandro CPAlejandro added the type/bug Bug issue label Jul 2, 2021
@CPAlejandro CPAlejandro self-assigned this Jul 2, 2021
@eze9252 eze9252 self-requested a review July 2, 2021 11:39
Copy link
Contributor

@eze9252 eze9252 left a comment

Choose a reason for hiding this comment

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

LGTM!

@CPAlejandro CPAlejandro changed the base branch from 4.1-7.10 to 4.3-7.10 July 2, 2021 13:51
{(!this.state.needsPassword && this.state.wazuhPassword=== "") ? (
<EuiCallOut
color="warning"
title={<> This section could not be displayed because you do not have permission to get access to the registration service. </>}
Copy link
Contributor

Choose a reason for hiding this comment

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

why registration service? maybe authorization coniguration (?)

Copy link
Member

@Desvelao Desvelao Jul 5, 2021

Choose a reason for hiding this comment

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

response:
Wazuh documentation about the configuration that is requested:
https://documentation.wazuh.com/current/user-manual/reference/ossec-conf/auth.html#auth

image

Copy link
Contributor

Choose a reason for hiding this comment

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

I think to have a relationship with the documentation. we should leave it like this

@@ -473,7 +485,14 @@ export const RegisterAgent = withErrorBoundary(

const guide = (
<div>
{this.state.selectedOS && (
{(!this.state.needsPassword && this.state.wazuhPassword=== "") ? (
Copy link
Member

Choose a reason for hiding this comment

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

thought: I am not sure about this check to display the callout. Maybe we should have a state when the request fails.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm... I'm going to check this

Copy link
Member

@Desvelao Desvelao Jul 5, 2021

Choose a reason for hiding this comment

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

review:

I tested the PR and when there isn't a configurated password, the callout is displaying:
image

@eze9252 eze9252 self-assigned this Jul 5, 2021
registration service info and display the callout
  - Applied the callout to some steps whene there is a error to get the
registratrion service info
  - Changed the callout from warning to danger
  - Fix not reported errors, when the user has not permissions, some
selectors didn't display
@Desvelao
Copy link
Member

Desvelao commented Jul 5, 2021

Changes

  • Applied the callout to some steps where there is an error to get the registration service info
  • Changed the callout from warning to danger
  • Fix not reported errors, when the user has not permissions, some selectors didn't display

@frankeros frankeros merged commit 4e78ef4 into 4.3-7.10 Jul 21, 2021
@frankeros frankeros deleted the fix/3406-notify-register-agent-without-permissions branch July 21, 2021 12:38
@github-actions
Copy link
Contributor

Jest Test Coverage % values
Statements 3.66% ( 1304 / 35655 )
Branches 1.46% ( 409 / 28099 )
Functions 2.56% ( 221 / 8616 )
Lines 3.7% ( 1260 / 34091 )

gabiwassan pushed a commit that referenced this pull request Jul 30, 2021
* fix(frontend_register_agent): Fix when there was an error to get the
registration service info and display the callout
  - Applied the callout to some steps whene there is a error to get the
registratrion service info
  - Changed the callout from warning to danger
  - Fix not reported errors, when the user has not permissions, some
selectors didn't display
gabiwassan pushed a commit that referenced this pull request Aug 5, 2021
* fix(frontend_register_agent): Fix when there was an error to get the
registration service info and display the callout
  - Applied the callout to some steps whene there is a error to get the
registratrion service info
  - Changed the callout from warning to danger
  - Fix not reported errors, when the user has not permissions, some
selectors didn't display
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bug issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attempting to register an agent - no warning to notify that the user does not have the required permissions
6 participants