From 8d87fe2811085024488aa27edec50ba76657d29d Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Thu, 30 May 2024 12:58:05 +0200 Subject: [PATCH 1/2] Fix cronjob max seconds interval (#6730) * Fix cronjob max seconds interval * Add changelog --- CHANGELOG.md | 2 +- plugins/main/server/lib/parse-cron.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bdbe5577a..eb7cecc17c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,6 @@ All notable changes to the Wazuh app project will be documented in this file. ### Changed - Removed embedded discover [#6120](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6120) [#6235](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6235) [#6254](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6254) [#6285](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6285) [#6288](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6288) [#6290](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6290) [#6289](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6289) [#6286](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6286) [#6275](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6275) [#6287](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6287) [#6297](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6297) [#6291](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6287) [#6459](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6459) [#6434](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6434) [#6504](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6504) [#6649](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6649) [#6506](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6506) [#6537](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6537) [#6528](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6528) [#6675](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6675) [#6674](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6674) [#6558](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6558) [#6685](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6685) [#6691](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6691) -- Develop logic of a new index for the fim module [#6227](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6227) - Allow editing groups for an agent from Endpoints Summary [#6250](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6250) - Change how the configuration is managed in the backend side [#6337](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6337) [#6519](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6519) [#6573](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6573) - Change the view of API is down and check connection to Server APIs application [#6337](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6337) @@ -48,6 +47,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Fixed the scripted fields disappear when the fields of the events index pattern was refreshed [#6237](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6237) - Fixed an error of malformed table row on the generation of PDF reports [#6558](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6558) - Fixed the sample alerts scripts to generate valid IP ranges and file hashes [#6667](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6667) +- Fixed cronjob max seconds interval validation [#6730](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6730) ### Removed diff --git a/plugins/main/server/lib/parse-cron.ts b/plugins/main/server/lib/parse-cron.ts index 45927118e7..395441aa84 100644 --- a/plugins/main/server/lib/parse-cron.ts +++ b/plugins/main/server/lib/parse-cron.ts @@ -25,7 +25,7 @@ export function parseCron(interval: string) { // 60 seconds / 1 minute throw new Error('Interval too low'); } - if (intervalToNumber >= 84600) { + if (intervalToNumber >= 86400) { throw new Error('Interval too high'); } From 42ca3306f36f2dfd3ef19f3d7fbf6642266a4a61 Mon Sep 17 00:00:00 2001 From: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> Date: Thu, 30 May 2024 13:46:23 +0200 Subject: [PATCH 2/2] Change key prop in rule.mitre.id column render (#6715) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Chantal Belén kelm <99441266+chantal-kelm@users.noreply.github.com> Co-authored-by: Federico Rodriguez --- .../common/wazuh-discover/render-columns.tsx | 103 ++++++++++-------- 1 file changed, 57 insertions(+), 46 deletions(-) diff --git a/plugins/main/public/components/common/wazuh-discover/render-columns.tsx b/plugins/main/public/components/common/wazuh-discover/render-columns.tsx index 483b056a85..b428b62735 100644 --- a/plugins/main/public/components/common/wazuh-discover/render-columns.tsx +++ b/plugins/main/public/components/common/wazuh-discover/render-columns.tsx @@ -12,70 +12,81 @@ const navigateTo = (ev, section, params) => { AppNavigate.navigateToModule(ev, section, params); }; -const renderMitreTechnique = (technique: string) => - navigateTo(e, 'overview', { - tab: 'mitre', - tabView: 'intelligence', - tabRedirect: 'techniques', - idToRedirect: technique, - }) - } -> - {technique} - +const renderMitreTechnique = (technique: string) => ( + + navigateTo(e, 'overview', { + tab: 'mitre', + tabView: 'intelligence', + tabRedirect: 'techniques', + idToRedirect: technique, + }) + } + > + {technique} + +); export const wzDiscoverRenderColumns: tDataGridRenderColumn[] = [ { id: 'agent.id', - render: (value) => { - if (value === '000') return value + render: value => { + if (value === '000') return value; - return - - {value} - - - } + return ( + + + {value} + + + ); + }, }, { id: 'agent.name', render: (value, row) => { - if (row.agent.id === '000') return value + if (row.agent.id === '000') return value; - return - - {value} - - - } + return ( + + + {value} + + + ); + }, }, { id: 'rule.id', - render: (value) => - - {value} - - + render: value => ( + + + {value} + + + ), }, { id: 'rule.mitre.id', - render: (value) => Array.isArray(value) ?
- {value?.map(technique => ( -
- {renderMitreTechnique(technique)} + render: value => + Array.isArray(value) ? ( +
+ {value?.map((technique, index) => ( +
+ {renderMitreTechnique(technique)} +
+ ))}
- ))} -
:
- {renderMitreTechnique(value)} -
+ ) : ( +
{renderMitreTechnique(value)}
+ ), }, { id: 'timestamp', - render: (value) => formatUIDate(value) + render: value => formatUIDate(value), }, -] \ No newline at end of file +];