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

Granular options for agent configuration reports #1518

Closed
jesusgn90 opened this issue Jun 7, 2019 · 6 comments
Closed

Granular options for agent configuration reports #1518

jesusgn90 opened this issue Jun 7, 2019 · 6 comments
Assignees
Labels
component/reports Things related to the reporting module request/operational Operational requests

Comments

@jesusgn90
Copy link
Contributor

In #1340 we've created a new kind of reports for the Wazuh app, the agent configuration reports, with this ticket we are improving this new feature.

When the user clicks the PDF button, we want to show a dropdown with the one check per component, this way the user can customize the report.

Example:

I want a document where I can see the FIM configuration for the agent 003.

Something like this:

image

Related EUI components:

@jesusgn90 jesusgn90 added frontend request/operational Operational requests component/reports Things related to the reporting module labels Jun 7, 2019
@juankaromo juankaromo self-assigned this Jun 7, 2019
@juankaromo
Copy link
Contributor

Update

I have been having problems to load a list of options in the selectable, cause when I instantiate the options list in the state (how is explained in eui docs), in this way:

    this.state = {
      options: ['option1', 'option2', 'option3'] as Option[],
      isPopoverOpen: false,
    };

I get the next error:

'type assertion expressions' can only be used in a .ts file. [import Option]

@juankaromo
Copy link
Contributor

juankaromo commented Jun 10, 2019

Update 10/06

Front-end

After being researching how to import EuiSelectable, I realized that the version of eui that Kibana uses doesn't support it. At this point, I decided to implement by myself a selectable-like component using EuiCheckboxGroup.

I've splitted the list of options according to the type of configuration we want to export; if we want to export an Agent configuration, the list of options is the list of possible components and modules that one agent could have. 44d85f8 This is shown below:

image

On the other hand, if we want to export a Group configuration, the options are two; the possibility of export the configuration with their filters, or the possibility to export the list of agents in the group. 33c76fe This is shown below:

image

When we clicked on Generate PDF report, the Popover disappears, and a load ring appears in the button place, avoiding the user to clicking again.

react-report

It is missing to introduce a button that allows the user to easily select or deselect all the elements of the list.

Back-end

We have had to adapt the report generation modules to disable the requests and rendering of the components if they have been marked as not to show.

@juankaromo
Copy link
Contributor

Update

Select all and unselect all buttons have been added to the component 8e23e2a. This is shown below:

image

@juankaromo
Copy link
Contributor

juankaromo commented Jun 11, 2019

Update

Generate PDF report button now is disabled if any component/module in the list is checked, with the aim of not export empty reports. 44a79a9

image

@juankaromo
Copy link
Contributor

Update

The component selector to export now takes into account those components or modules that are not supported by the operating system of the agent and hides them from the list preventing the user to select them, because they will not appear in the report because they are not configurable for that agent.

e.g:

image

@juankaromo
Copy link
Contributor

juankaromo commented Jun 14, 2019

Update

The importable object that represents the compatibility matrix and through which extensions compatible with the agent's operating system are hidden or shown has been modified (by @jesusgn90 suggestion) by exchanging the values (before components) for the operating systems, and the values for the components (before operating systems).

Now it looks like this:


export const UnsupportedComponents = {
  'linux': [],
  'windows': ['audit', 'oscap', 'vuls', 'docker'],
  'darwin': ['audit', 'oscap', 'vuls', 'docker'],
  'other': ['audit', 'oscap', 'vuls', 'docker']
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/reports Things related to the reporting module request/operational Operational requests
Projects
None yet
Development

No branches or pull requests

3 participants