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

Fixed access to forbidden agents #2918

Merged
merged 3 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ All notable changes to the Wazuh app project will be documented in this file.

- Support new fields of Windows Registry at FIM inventory panel [#2679](https://github.com/wazuh/wazuh-kibana-app/issues/2679)
- Added on FIM Inventory Windows Registry registry_key and registry_value items from syscheck [#2908](https://github.com/wazuh/wazuh-kibana-app/issues/2908)
- Uncheck agents afeter an actions in agentes groups [#2907](https://github.com/wazuh/wazuh-kibana-app/pull/2907)
- Uncheck agents after an action in agents groups management [#2907](https://github.com/wazuh/wazuh-kibana-app/pull/2907)

### Fixed

- Fix server error Invalid token specified: Cannot read property 'replace' of undefined [#2899](https://github.com/wazuh/wazuh-kibana-app/issues/2899)
- Fixed wrong hover texts in CDB lists actions [#2929](https://github.com/wazuh/wazuh-kibana-app/pull/2929)
- Fixed access to forbidden agents information when exporting agents listt [2918](https://github.com/wazuh/wazuh-kibana-app/pull/2918)

## Wazuh v4.0.4 - Kibana 7.10.0 , 7.10.2 - Revision 4017

Expand Down
6 changes: 2 additions & 4 deletions server/controllers/wazuh-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,6 @@ export class WazuhApiCtrl {

const filters = Array.isArray(((request || {}).body || {}).filters) ? request.body.filters : [];

const config = await this.manageHosts.getHostById(request.body.id);

let tmpPath = request.body.path;

if (tmpPath && typeof tmpPath === 'string') {
Expand All @@ -756,7 +754,7 @@ export class WazuhApiCtrl {

let itemsArray = [];

const output = await context.wazuh.api.client.asInternalUser.request(
const output = await context.wazuh.api.client.asCurrentUser.request(
'GET',
`/${tmpPath}`,
{ params: params },
Expand All @@ -772,7 +770,7 @@ export class WazuhApiCtrl {
itemsArray.push(...output.data.data.affected_items);
while (itemsArray.length < totalItems && params.offset < totalItems) {
params.offset += params.limit;
const tmpData = await context.wazuh.api.client.asInternalUser.request(
const tmpData = await context.wazuh.api.client.asCurrentUser.request(
'GET',
`/${tmpPath}`,
{ params: params },
Expand Down