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

Add Wazuh Analysis plugin files and structure #7242

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
cb12329
Add initial Wazuh Analysis plugin files and structure
guidomodarelli Jan 15, 2025
26231e4
Add wazuh-analysis plugin to dev.yml configuration
guidomodarelli Jan 16, 2025
614fee5
Set server option to false in Wazuh Analysis plugin configuration
guidomodarelli Jan 16, 2025
453d147
Add initial implementation of the Wazuh Analysis plugin
guidomodarelli Jan 16, 2025
a850954
Enforce no-empty-object-type rule in TypeScript files for Wazuh Analy…
guidomodarelli Jan 16, 2025
269ed79
Refactor AnalysisApp component to use EUI layout components
guidomodarelli Jan 16, 2025
85d627f
Enable TTY for OSD development environment in dev.yml
guidomodarelli Jan 17, 2025
07dffbb
Add TypeScript types for React and ReactDOM as dev dependencies
guidomodarelli Jan 17, 2025
7ba426b
Add translation messages and application categories for Wazuh Analysi…
guidomodarelli Jan 17, 2025
48c45ae
Refactor AnalysisPlugin to use constants for plugin and category IDs
guidomodarelli Jan 17, 2025
72cc11b
Add navigation links for security categories in AnalysisPlugin
guidomodarelli Jan 17, 2025
5d3d345
Fix indentation in translation messages for analysis categories in Wa…
guidomodarelli Jan 17, 2025
a09696d
Refactor translation keys in AnalysisPlugin to use plugin ID for cons…
guidomodarelli Jan 20, 2025
4253b06
Add translation messages for new categories in AnalysisPlugin
guidomodarelli Jan 20, 2025
65f972f
Refactor AnalysisPlugin to use dynamic keys for application IDs
guidomodarelli Jan 20, 2025
5fd61ce
Add navigation links for configuration assessment, malware detection,…
guidomodarelli Jan 20, 2025
ce4b49d
Add function to navigate to the first app in a navigation group
guidomodarelli Jan 20, 2025
7139c25
Update application IDs in AnalysisPlugin to include endpoint security…
guidomodarelli Jan 20, 2025
fbb9911
Remove category assignment from threat intelligence application in An…
guidomodarelli Jan 20, 2025
f187e2f
Add description for endpoint security category in AnalysisPlugin
guidomodarelli Jan 20, 2025
4f8ef8c
Remove category assignment from endpoint security application in Anal…
guidomodarelli Jan 20, 2025
9ede900
Fix navigation to the first app in the endpoint security group and up…
guidomodarelli Jan 20, 2025
027ea30
Refactor sub-application ID generation in AnalysisPlugin for improved…
guidomodarelli Jan 20, 2025
2de10c2
Add JSDoc comments for generateSubAppId function in plugin.ts
guidomodarelli Jan 20, 2025
38151dc
Refactor mount functions in AnalysisPlugin to use arrow function synt…
guidomodarelli Jan 20, 2025
e294a62
Implement app startup subject in AnalysisPlugin for navigation handling
guidomodarelli Jan 20, 2025
5f52469
Add getCurrentNavGroup function to retrieve the current navigation group
guidomodarelli Jan 20, 2025
2cedfc1
Refactor navigateToFirstAppInNavGroup function to improve parameter h…
guidomodarelli Jan 20, 2025
4d08390
Refactor app startup subscription to set current navigation group and…
guidomodarelli Jan 20, 2025
174bc12
Add navigation link status management for endpoint security applications
guidomodarelli Jan 20, 2025
d048aa6
Refactor endpoint security applications to streamline mount logic and…
guidomodarelli Jan 20, 2025
aa5923a
Refactor application registration to use an array for better structur…
guidomodarelli Jan 20, 2025
7592b79
Refactor translationMessages to use Object.freeze for immutability
guidomodarelli Jan 20, 2025
c0ac199
Refactor AnalysisPlugin setup to improve app registration structure
guidomodarelli Jan 20, 2025
f857c70
Refactor AnalysisPlugin to use Object.freeze for navigation groups
guidomodarelli Jan 20, 2025
5759572
Refactor AnalysisPlugin to separate navigation group registration int…
guidomodarelli Jan 20, 2025
42650db
Refactor AnalysisPlugin to extract app startup subscription into a se…
guidomodarelli Jan 20, 2025
fca4fba
Refactor AnalysisPlugin to use Object.freeze for CATEGORY definition
guidomodarelli Jan 20, 2025
47789f4
Refactor AnalysisPlugin to consolidate endpoint security apps into a …
guidomodarelli Jan 20, 2025
4cc41fc
Refactor AnalysisPlugin to improve code organization and maintainability
guidomodarelli Jan 20, 2025
8ab6027
Refactor AnalysisPlugin to assign CATEGORY to endpoint security and t…
guidomodarelli Jan 21, 2025
3e31c74
Refactor AnalysisPlugin to update appStatusUpdater type to AppUpdater
guidomodarelli Jan 21, 2025
1644441
Refactor AnalysisPlugin to conditionally update appStatusUpdater base…
guidomodarelli Jan 21, 2025
5e3961c
Refactor AnalysisPlugin to ensure unmount function returns a boolean …
guidomodarelli Jan 21, 2025
55ff576
Refactor AnalysisPlugin to simplify appStatusUpdater initialization a…
guidomodarelli Jan 21, 2025
7ce935c
Refactor package.json to remove unused React type definitions from de…
guidomodarelli Jan 21, 2025
c46b157
Refactor yarn.lock to remove unused React type definitions and csstyp…
guidomodarelli Jan 21, 2025
1489da3
Refactor AnalysisPlugin to add threat intelligence sub-apps and updat…
guidomodarelli Jan 21, 2025
d780630
Refactor AnalysisPlugin to add new sub-apps for regulatory compliance…
guidomodarelli Jan 21, 2025
8dd71d2
Refactor AnalysisPlugin to improve app mount logic and enhance app st…
guidomodarelli Jan 21, 2025
0b391e1
Refactor AnalysisPlugin to streamline app mount logic using a loop fo…
guidomodarelli Jan 21, 2025
059d801
Refactor AnalysisPlugin to register applications directly in setupApp…
guidomodarelli Jan 22, 2025
87e39c8
Refactor AnalysisPlugin to rename navigation link visibility function…
guidomodarelli Jan 22, 2025
9c2e331
Add global search functionality for navigation pages in AnalysisPlugin
guidomodarelli Jan 22, 2025
858e601
Rename global search command ID in AnalysisPlugin for consistency
guidomodarelli Jan 22, 2025
503f9b1
Rename search pages command file for improved organization and clarity
guidomodarelli Jan 22, 2025
630dcb4
Move search pages command import to global search directory for impro…
guidomodarelli Jan 22, 2025
7b01f9b
Rename function generateSubAppId to buildSubAppId for improved clarity
guidomodarelli Jan 22, 2025
6ddf2c0
Add internationalization support for Analysis Plugin title
guidomodarelli Jan 22, 2025
b131df7
Add constants file and export PLUGIN_ID for analysis plugin
guidomodarelli Jan 22, 2025
ee1c2ad
Remove redundant PLUGIN_ID constant from analysis plugin
guidomodarelli Jan 22, 2025
4705206
Add CATEGORY constant for analysis plugin with internationalization s…
guidomodarelli Jan 22, 2025
07e20dd
Add Endpoint Security application with internationalization support
guidomodarelli Jan 22, 2025
6e51e5c
Refactor analysis plugin constants and remove redundant i18n file
guidomodarelli Jan 22, 2025
8d186b6
Add description constant for Endpoint Security and update references
guidomodarelli Jan 22, 2025
8bb9efd
Add Threat Intelligence application with internationalization support
guidomodarelli Jan 22, 2025
1ba9e2b
Add Threat Intelligence application implementation and registration
guidomodarelli Jan 22, 2025
b0c2062
rename application files to group directory
guidomodarelli Jan 22, 2025
f194838
Refactor plugin imports to group directory structure
guidomodarelli Jan 22, 2025
9bde1db
Add Security Operations application implementation and registration
guidomodarelli Jan 22, 2025
684bae9
Add Cloud Security application implementation and internationalizatio…
guidomodarelli Jan 22, 2025
61eb709
Add GroupsId type definition for security applications
guidomodarelli Jan 22, 2025
de10475
Add navigation groups for security applications
guidomodarelli Jan 22, 2025
daa566b
Add Cloud Security application structure and integration
guidomodarelli Jan 22, 2025
cfe3b47
Enable new home page feature in OpenSearch Dashboards configuration
guidomodarelli Jan 22, 2025
991b350
Refactor buildSubAppId function into utils for better modularity
guidomodarelli Feb 3, 2025
febcf7d
Move navigateToFirstAppInNavGroup function to utils and update imports
guidomodarelli Feb 3, 2025
5bd0480
Rename `generateSubAppId` function to `buildSubAppId` for consistency
guidomodarelli Feb 3, 2025
0fc0b52
Add endpoint security and threat intelligence applications
guidomodarelli Feb 3, 2025
6488393
Export application IDs and titles for endpoint security and threat in…
guidomodarelli Feb 3, 2025
0b1901c
Add security operations applications with IDs and titles
guidomodarelli Feb 3, 2025
a952ab8
Add cloud security applications with IDs and titles
guidomodarelli Feb 3, 2025
2744413
Refactor app ID handling to use GroupsId type for improved consistency
guidomodarelli Feb 3, 2025
3bed755
Add endpoint security navigation group and refactor registration of n…
guidomodarelli Feb 3, 2025
02a0c8f
Refactor navigation group handling and improve utility functions for …
guidomodarelli Feb 3, 2025
3a4f6ea
Refactor endpoint security navigation group setup for improved organi…
guidomodarelli Feb 3, 2025
42ca3ae
Refactor application management by introducing ApplicationService for…
guidomodarelli Feb 3, 2025
2861e81
Refactor AnalysisPlugin to streamline app updater registration using …
guidomodarelli Feb 3, 2025
476fad2
Refactor endpoint security group by consolidating app registration an…
guidomodarelli Feb 3, 2025
c625e3e
Refactor cloud security group by consolidating navigation and applica…
guidomodarelli Feb 3, 2025
3d973c5
Refactor security operations group by consolidating navigation and ap…
guidomodarelli Feb 3, 2025
b5d79bf
Refactor Group interface to use generic type for improved type safety
guidomodarelli Feb 3, 2025
1bbfa18
Refactor threat intelligence group by consolidating application logic…
guidomodarelli Feb 3, 2025
2e83a06
Refactor cloud security application import for improved clarity
guidomodarelli Feb 3, 2025
3a02a62
Refactor navigation groups by removing obsolete nav-groups file
guidomodarelli Feb 3, 2025
783626d
Refactor navigation groups to use generic types for improved type safety
guidomodarelli Feb 3, 2025
62ab753
Refactor AnalysisPlugin to use nav group classes for improved organiz…
guidomodarelli Feb 3, 2025
b302ac0
Refactor AnalysisPlugin to simplify subApps initialization by removin…
guidomodarelli Feb 3, 2025
884ebe4
Refactor AnalysisPlugin and ApplicationService to streamline nav link…
guidomodarelli Feb 4, 2025
92b7768
Refactor AnalysisPlugin to change subApps type from App[] to App[][] …
guidomodarelli Feb 4, 2025
2187cff
Refactor ApplicationService to encapsulate navigation logic in naviga…
guidomodarelli Feb 4, 2025
dc66174
Refactor ApplicationService to enhance documentation with detailed JS…
guidomodarelli Feb 4, 2025
a563860
Refactor nav-group utility to remove navigateToFirstAppInNavGroup fun…
guidomodarelli Feb 4, 2025
ef24122
Refactor ApplicationService to enhance unmount logic for improved res…
guidomodarelli Feb 4, 2025
f789b0a
Refactor ApplicationService to rename appOperations methods for impro…
guidomodarelli Feb 4, 2025
382fdc4
Refactor AnalysisPlugin to move app updater registration to the start…
guidomodarelli Feb 4, 2025
0485847
Refactor DashboardSecurityService types to enhance typing for higher …
guidomodarelli Feb 4, 2025
2966c24
Refactor DashboardSecurityService to improve type safety and error ha…
guidomodarelli Feb 4, 2025
ac4ac01
Refactor LifecycleService to make dependency parameters optional for …
guidomodarelli Feb 4, 2025
68de578
Add NoopLogger implementation for logging interface compliance
guidomodarelli Feb 4, 2025
9e0f53c
Add logging to ApplicationService for improved debugging and traceabi…
guidomodarelli Feb 4, 2025
987736f
Refactor application.service.ts to streamline imports and enhance cod…
guidomodarelli Feb 4, 2025
6c7fe6e
Refactor security-related groups to centralize constants and improve …
guidomodarelli Feb 4, 2025
a6c6d4a
Refactor WazuhCorePlugin to implement NoopLogger for improved logging…
guidomodarelli Feb 4, 2025
8fc978e
Refactor ApplicationService to use navGroupId for improved navigation…
guidomodarelli Feb 4, 2025
e183fc3
Remove unused navigation group handling from ApplicationService unmou…
guidomodarelli Feb 4, 2025
005e735
Refactor WazuhCorePlugin and ApplicationService for improved navigati…
guidomodarelli Feb 5, 2025
55ace2d
Remove unused getCurrentNavGroup utility function from nav-group.ts
guidomodarelli Feb 5, 2025
03a87b7
Refactor WazuhCorePlugin and AnalysisPlugin to use applicationService…
guidomodarelli Feb 5, 2025
76709d3
Refactor AnalysisPlugin to streamline imports and enhance type defini…
guidomodarelli Feb 5, 2025
7adbe1e
Add createSideNavItems function to generate side navigation items for…
guidomodarelli Feb 5, 2025
c3695c7
Add createEndpointSecurityNavItems function to generate navigation it…
guidomodarelli Feb 5, 2025
026ed91
Add Layout component for structured page layout with sidebar navigation
guidomodarelli Feb 5, 2025
4b737e8
Add new endpoint security applications: Configuration Assessment, FIM…
guidomodarelli Feb 5, 2025
2aca4ab
Update endpoint security applications imports for configuration asses…
guidomodarelli Feb 5, 2025
31dc58b
Update Layout component to accept a single child or an array of children
guidomodarelli Feb 6, 2025
6fd31a9
feat: implement navigation to the first endpoint security app on mount
guidomodarelli Feb 6, 2025
6831abe
feat: add plugin services for core getter and setter in Wazuh analysi…
guidomodarelli Feb 6, 2025
684abfc
feat: update side navigation to use core application navigation
guidomodarelli Feb 6, 2025
7d4bda9
feat: add opensearchDashboardsUtils as a required plugin for Wazuh an…
guidomodarelli Feb 6, 2025
d8d9129
refactor: remove order property from navigation groups in Wazuh analy…
guidomodarelli Feb 6, 2025
eb51dc6
feat: implement navigation to the first endpoint security app in the …
guidomodarelli Feb 6, 2025
0f14727
feat: conditionally render side navigation based on nav group settings
guidomodarelli Feb 6, 2025
b77d72e
refactor: update import paths for endpoint security apps to use new f…
guidomodarelli Feb 6, 2025
3204df4
feat: add conditional navigation to the first endpoint security app b…
guidomodarelli Feb 6, 2025
6b1b4ab
refactor: make updater$ parameter optional in getApps method across n…
guidomodarelli Feb 6, 2025
5eaf627
refactor: replace createEndpointSecurityNavItems with createSideNavIt…
guidomodarelli Feb 6, 2025
4651cbf
feat: implement regulatory compliance app with dedicated rendering an…
guidomodarelli Feb 6, 2025
7098c8d
feat: add IT hygiene application with dedicated rendering and integra…
guidomodarelli Feb 6, 2025
1d64a9b
refactor: remove TODO comments for unimplemented applications in endp…
guidomodarelli Feb 6, 2025
303bab4
refactor: remove TODO comments for incident response application and …
guidomodarelli Feb 6, 2025
5608cf5
feat: implement incident response application with rendering logic an…
guidomodarelli Feb 6, 2025
e89412d
fix: update SECURITY_OPERATIONS_ID to SECURITY_OPERATIONS_TITLE in IT…
guidomodarelli Feb 6, 2025
b707ae0
feat: implement MITRE ATT&CK application with rendering logic and int…
guidomodarelli Feb 6, 2025
d122b16
feat: enhance threat intelligence nav group to navigate to app based …
guidomodarelli Feb 6, 2025
09d9a86
Fix import path and update title for MITRE attack app
guidomodarelli Feb 6, 2025
273c8f0
Add threat-hunting application to threat intelligence group
guidomodarelli Feb 6, 2025
1c75521
Implement vulnerability detection application structure
guidomodarelli Feb 6, 2025
1bda38c
Refactor app props naming for consistency across incident response, i…
guidomodarelli Feb 6, 2025
32f2f88
Enhance Cloud Security navigation by conditionally redirecting based …
guidomodarelli Feb 6, 2025
c57c1b5
Implement AWS application for cloud security group
guidomodarelli Feb 6, 2025
b3540d7
Add Docker application implementation and render logic for cloud secu…
guidomodarelli Feb 6, 2025
5c90483
Implement Google Cloud application and render logic for cloud securit…
guidomodarelli Feb 6, 2025
cca2d57
Add GitHub application implementation and render logic for cloud secu…
guidomodarelli Feb 6, 2025
97b0417
Implement Office 365 application and render logic for cloud security …
guidomodarelli Feb 6, 2025
1128132
Remove unused appBasePath prop from AnalysisApp component in Wazuh an…
guidomodarelli Feb 6, 2025
491a539
Enhance ApplicationService with detailed documentation and refine met…
guidomodarelli Feb 7, 2025
686df30
refactor: rename match function to hasMatch for clarity
guidomodarelli Feb 7, 2025
9e56a58
refactor: remove unused Group interface and related methods for clean…
guidomodarelli Feb 7, 2025
4440a8b
refactor: update Group import path for consistency and remove unused …
guidomodarelli Feb 7, 2025
bde4bf1
refactor: enhance Group interface with detailed methods for navigatio…
guidomodarelli Feb 7, 2025
b04a41a
refactor: enrich debug logging in registerAppUpdater with appId for b…
guidomodarelli Feb 7, 2025
75c4af4
refactor: reorganize application service methods for clearer structur…
guidomodarelli Feb 7, 2025
e4313f8
refactor: streamline application initialization and navigation group …
guidomodarelli Feb 7, 2025
92c3701
refactor: rename method and streamline navigation group assignment fo…
guidomodarelli Feb 7, 2025
6bebaa0
refactor: simplify app registration and enhance navigation group hand…
guidomodarelli Feb 7, 2025
4c4d67e
refactor: rename and simplify sub-app mounting logic for improved cla…
guidomodarelli Feb 7, 2025
66f95f0
feat: add global search page item and search pages command components…
guidomodarelli Feb 7, 2025
fa0cf39
refactor: enhance application setup and search command registration f…
guidomodarelli Feb 7, 2025
4b98efc
refactor: simplify application startup method for improved clarity an…
guidomodarelli Feb 7, 2025
77e6c04
refactor: streamline application mount logic for improved clarity and…
guidomodarelli Feb 7, 2025
a73eb48
refactor: replace getCoreStart with getCore for improved consistency …
guidomodarelli Feb 7, 2025
7229b20
refactor: update ApplicationService to use coreSetup for improved mod…
guidomodarelli Feb 7, 2025
8cba859
refactor: enhance logging in ApplicationService for improved traceabi…
guidomodarelli Feb 7, 2025
009bb3a
refactor: enhance debug logging in AnalysisPlugin for improved tracea…
guidomodarelli Feb 7, 2025
7b2f5e8
refactor: change method visibility to private in ApplicationService f…
guidomodarelli Feb 7, 2025
277266a
refactor: remove coreSetup parameter from ApplicationService methods …
guidomodarelli Feb 7, 2025
58b1633
Refactor ApplicationService documentation and methods
guidomodarelli Feb 8, 2025
5ac419f
refactor: add NavGroupType to security-related navigation groups for …
guidomodarelli Feb 11, 2025
ccabc8a
fix: correct translation key for analysis plugin title
guidomodarelli Feb 12, 2025
cbb2928
refactor: update import paths for constants in cloud security apps
guidomodarelli Feb 12, 2025
c492efb
refactor: move configuration assessment constants to a separate file …
guidomodarelli Feb 12, 2025
bf584c3
refactor: streamline ANALYSIS_PLUGIN_TITLE translation and ensure con…
guidomodarelli Feb 12, 2025
9690fe3
refactor: reorganize import paths for constants in configuration asse…
guidomodarelli Feb 12, 2025
490af12
refactor: move FIM constants to a dedicated file for better organization
guidomodarelli Feb 12, 2025
ce8a74c
refactor: move malware detection constants to a dedicated file for be…
guidomodarelli Feb 12, 2025
530e3ab
refactor: move incident response constants to a dedicated file for be…
guidomodarelli Feb 12, 2025
e1fe336
refactor: move IT hygiene constants to a dedicated file for better or…
guidomodarelli Feb 12, 2025
1a716fe
refactor: move regulatory compliance constants to a dedicated file fo…
guidomodarelli Feb 12, 2025
c2593fe
refactor: move MITRE ATT&CK constants to a dedicated file for better …
guidomodarelli Feb 12, 2025
72a3ed1
refactor: move threat hunting constants to a dedicated file for bette…
guidomodarelli Feb 12, 2025
641f55f
refactor: move vulnerability detection constants to a dedicated file …
guidomodarelli Feb 12, 2025
07c850b
Add tasks to initialize index patterns (#7262)
Desvelao Jan 27, 2025
10895ad
Remove .scheduled-commands index pattern creation (#7263)
Desvelao Jan 27, 2025
6bb13ee
Change master branch references to main (#7288)
asteriscos Feb 12, 2025
cec1357
refactor: remove unused UI settings from opensearch_dashboards.yml
guidomodarelli Feb 12, 2025
c466b13
refactor: update Group import path for better module resolution
guidomodarelli Feb 12, 2025
8498f6f
refactor: update PLUGIN_ID for consistency in analysis plugin
guidomodarelli Feb 12, 2025
6688fee
refactor: remove NavGroupType from navigation groups for cleaner code
guidomodarelli Feb 13, 2025
91889ea
docs: add README for ApplicationService with method explanations and …
guidomodarelli Feb 13, 2025
9235a7f
refactor: simplify mount functions in navigation groups and update Ap…
guidomodarelli Feb 13, 2025
a352598
docs: update README for ApplicationService with new plugin example an…
guidomodarelli Feb 13, 2025
e9aa704
docs: add README for plugin structure and example application
guidomodarelli Feb 13, 2025
c6e6086
docs: enhance README with detailed plugin structure and examples for …
guidomodarelli Feb 13, 2025
aa6bb63
docs: add README for Wazuh Analysis plugin with structure and applica…
guidomodarelli Feb 13, 2025
599c6b9
refactor: rename onAppStartup to start in ApplicationService and upda…
guidomodarelli Feb 14, 2025
a1ebc85
refactor: rename setup to register in ApplicationService and update r…
guidomodarelli Feb 14, 2025
2f63799
refactor: simplify app mount and cleanup logic in ApplicationService
guidomodarelli Feb 14, 2025
62371c4
refactor: move layout and createSideNavItems into applicationService …
guidomodarelli Feb 14, 2025
a88d3a1
docs: update README for modifyAppGroupMount method to include subApps…
guidomodarelli Feb 14, 2025
f44aec7
refactor: enhance documentation for getApps method in Group interface
guidomodarelli Feb 14, 2025
bffbe2f
refactor: update getApps and renderApp to utilize ApplicationService …
guidomodarelli Feb 14, 2025
553fdbb
Merge branch 'main' into enhancement/484-create-the-analysis-plugin-a…
guidomodarelli Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ module.exports = {
/* -------------------------------------------------------------------------- */
/* @typescript-eslint */
/* -------------------------------------------------------------------------- */
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
Expand Down Expand Up @@ -359,6 +361,7 @@ module.exports = {
},
},
],
'react/prop-types': 'off',
},
},
{
Expand Down
2 changes: 2 additions & 0 deletions docker/osd-dev/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,15 @@ services:
- ${OSD_PORT}:5601
environment:
- 'LOGS=/proc/1/fd/1'
tty: true
volumes:
- osd_cache:/home/node/.cache
- '${SRC}/main:/home/node/kbn/plugins/main'
- '${SRC}/wazuh-core:/home/node/kbn/plugins/wazuh-core'
- '${SRC}/wazuh-check-updates:/home/node/kbn/plugins/wazuh-check-updates'
- '${SRC}/wazuh-engine:/home/node/kbn/plugins/wazuh-engine'
- '${SRC}/wazuh-fleet:/home/node/kbn/plugins/wazuh-fleet'
- '${SRC}/wazuh-analysis:/home/node/kbn/plugins/wazuh-analysis'
- wd_certs:/home/node/kbn/certs/
- ${WAZUH_DASHBOARD_CONF}:/home/node/kbn/config/opensearch_dashboards.yml
- ./config/${OSD_MAJOR}/osd/wazuh.yml:/home/node/kbn/data/wazuh/config/wazuh.yml
Expand Down
7 changes: 7 additions & 0 deletions plugins/wazuh-analysis/.i18nrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"prefix": "wazuhAnalysis",
"paths": {
"wazuhAnalysis": "."
},
"translations": ["translations/en-US.json"]
}
252 changes: 252 additions & 0 deletions plugins/wazuh-analysis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
# **General Plugin Structure and Functionality**

A **plugin** in this context follows a **modular and organized structure**, dividing its functionalities into **thematic groups**. Each group contains specific applications, each with its own logic and components.

Here’s a step-by-step guide on how to **create a new plugin** with **groups and applications**, using snippets based on the provided structure.

---

## **1️⃣ Creating the Plugin Structure**

```
📂 **`plugins/my-security-plugin/`** _(Root directory of the plugin)_
│── 📂 `public/` _(Frontend-related code)_
│ │── 📂 `groups/` _(Contains the different security-related groups)_
│ │ │── 📂 `network-security/` _(New group: Network Security)_
│ │ │ │── 📂 `apps/` _(Contains the individual applications in this group)_
│ │ │ │ │── 📂 `firewall-monitoring/` _(First app: Firewall Monitoring)_
│ │ │ │ │ │── 📄 `application.tsx` _(App entry point and rendering logic)_
│ │ │ │ │ │── 📄 `firewall-monitoring-app.tsx` _(Main React component for the app)_
│ │ │ │ │ │── 📄 `constants.ts` _(App-specific constants, titles, and IDs)_
│ │ │ │ │── 📂 `network-anomaly-detection/` _(Second app: Network Anomaly Detection)_
│ │ │ │ │ │── 📄 `application.tsx`
│ │ │ │ │ │── 📄 `network-anomaly-detection-app.tsx`
│ │ │ │ │ │── 📄 `constants.ts`
│ │ │ │── 📄 `applications.ts` _(Registers all apps in this group)_
│ │ │ │── 📄 `constants.ts` _(Defines the group ID, title, and description)_
│ │ │ │── 📄 `index.ts` _(Registers the group and navigation details)_
│ │── 📄 `category.ts` _(Defines categories for grouping apps in UI)_
```

---

## **2️⃣ Creating a Group: `network-security`**

A **group** represents a **category** of related applications.

📌 **File:** `public/groups/network-security/constants.ts`

```ts
import { i18n } from '@osd/i18n';
import { PLUGIN_ID } from '../../../common/constants';

export const NETWORK_SECURITY_ID = 'network_security';
export const NETWORK_SECURITY_TITLE = i18n.translate(
`${PLUGIN_ID}.category.${NETWORK_SECURITY_ID}`,
{ defaultMessage: 'Network Security' },
);
export const NETWORK_SECURITY_DESCRIPTION = i18n.translate(
`${PLUGIN_ID}.category.${NETWORK_SECURITY_ID}.description`,
{ defaultMessage: 'Monitor and secure your network infrastructure.' },
);
```

📌 **File:** `public/groups/network-security/index.ts`

```ts
import { Subject } from 'rxjs';
import {
App,
AppMountParameters,
AppUpdater,
ChromeNavGroup,
ChromeRegistrationNavLink,
} from '../../../../../src/core/public';
import { CATEGORY } from '../category';
import { Group } from '../../../../wazuh-core/public/services/application/types';
import { getNetworkSecurityApps } from './applications';
import {
NETWORK_SECURITY_DESCRIPTION,
NETWORK_SECURITY_ID,
NETWORK_SECURITY_TITLE,
} from './constants';

export const NetworkSecurityNavGroup: Group<typeof NETWORK_SECURITY_ID> = {
getId: () => NETWORK_SECURITY_ID,
getTitle: () => NETWORK_SECURITY_TITLE,
getDescription: () => NETWORK_SECURITY_DESCRIPTION,

getNavGroup(): ChromeNavGroup {
return {
id: NETWORK_SECURITY_ID,
title: NETWORK_SECURITY_TITLE,
description: NETWORK_SECURITY_DESCRIPTION,
};
},

getAppGroup(): App {
return {
id: NETWORK_SECURITY_ID,
title: NETWORK_SECURITY_TITLE,
category: CATEGORY,
mount: async (_params: AppMountParameters) => () => {},
};
},

getGroupNavLink(): ChromeRegistrationNavLink {
return {
id: NETWORK_SECURITY_ID,
title: NETWORK_SECURITY_TITLE,
category: CATEGORY,
};
},

getAppsNavLinks(): ChromeRegistrationNavLink[] {
return getNetworkSecurityApps().map(app => ({
id: app.id,
title: app.title,
}));
},

getApps(
applicationService: ApplicationService,
updater$: Subject<AppUpdater>,
): App[] {
return getNetworkSecurityApps(applicationService, updater$);
},
};
```

---

## **3️⃣ Creating an Application: `firewall-monitoring`**

📌 **File:** `public/groups/network-security/apps/firewall-monitoring/constants.ts`

```ts
import { i18n } from '@osd/i18n';
import { PLUGIN_ID } from '../../../../../common/constants';
import { buildSubAppId } from '../../../../utils';
import { NETWORK_SECURITY_ID } from '../../constants';

export const FIREWALL_MONITORING_ID = buildSubAppId(
NETWORK_SECURITY_ID,
'firewall-monitoring',
);
export const FIREWALL_MONITORING_TITLE = i18n.translate(
`${PLUGIN_ID}.category.${FIREWALL_MONITORING_ID}`,
{
defaultMessage: 'Firewall Monitoring',
},
);
```

📌 **File:** `public/groups/network-security/apps/firewall-monitoring/firewall-monitoring-app.tsx`

```tsx
import React from 'react';
import { AppMountParameters } from 'opensearch-dashboards/public';
import { FIREWALL_MONITORING_TITLE } from './constants';

interface FirewallMonitoringProps {
params: AppMountParameters;
}

export const FirewallMonitoringApp = (_props: FirewallMonitoringProps) => (
<>{FIREWALL_MONITORING_TITLE} App</>
);
```

📌 **File:** `public/groups/network-security/apps/firewall-monitoring/application.tsx`

```tsx
import React from 'react';
import { AppMountParameters } from 'opensearch-dashboards/public';
import ReactDOM from 'react-dom';
import { NetworkSecurityNavGroup } from '../..';
import { Layout } from '../../../layout';
import { createSideNavItems } from '../../../side-nav';
import { NETWORK_SECURITY_TITLE } from '../../constants';
import { FirewallMonitoringApp } from './firewall-monitoring-app';
import { FIREWALL_MONITORING_ID } from './constants';

export const renderApp = async (
params: AppMountParameters,
{ Layout }: AppProps,
) => {
ReactDOM.render(
<Layout>
<FirewallMonitoringApp params={params} />
</Layout>,
params.element,
);

return () => ReactDOM.unmountComponentAtNode(params.element);
};
```

---

## **4️⃣ Registering Applications in the Group**

📌 **File:** `public/groups/network-security/applications.ts`

```ts
import { Subject } from 'rxjs';
import {
App,
AppMountParameters,
AppNavLinkStatus,
AppUpdater,
} from '../../../../../src/core/public';
import { ApplicationService } from '../../../../wazuh-core/public/services/application/application';
import {
FIREWALL_MONITORING_ID,
FIREWALL_MONITORING_TITLE,
} from './apps/firewall-monitoring/constants';
import { NetworkSecurityNavGroup } from '.';

export function getNetworkSecurityApps(
applicationService?: ApplicationService,
updater$?: Subject<AppUpdater>,
): App[] {
const networkSecurityLayout = applicationService?.createLayout(
NetworkSecurityNavGroup,
);

return [
{
id: FIREWALL_MONITORING_ID,
title: FIREWALL_MONITORING_TITLE,
navLinkStatus: AppNavLinkStatus.hidden,
updater$,
mount: async (params: AppMountParameters) => {
const { renderApp } = await import(
'./apps/firewall-monitoring/application'
);

return await renderApp(params, {
Layout: networkSecurityLayout!(FIREWALL_MONITORING_ID),
});
},
},
];
}
```

---

## **5️⃣ Updating `category.ts` to Include the New Group**

📌 **File:** `public/groups/category.ts`

```ts
import { AppCategory } from 'opensearch-dashboards/public';
import { PLUGIN_TITLE, PLUGIN_ID } from '../../common/constants';

export const CATEGORY: AppCategory = Object.freeze({
id: PLUGIN_ID,
label: PLUGIN_TITLE,
order: 5000,
});
```
6 changes: 6 additions & 0 deletions plugins/wazuh-analysis/common/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { i18n } from '@osd/i18n';

export const PLUGIN_ID = 'wazuhAnalysis';
export const ANALYSIS_PLUGIN_TITLE = i18n.translate(`${PLUGIN_ID}.title`, {
defaultMessage: 'Analysis',
});
8 changes: 8 additions & 0 deletions plugins/wazuh-analysis/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "wazuhAnalysis",
"version": "5.0.0-00",
"opensearchDashboardsVersion": "opensearchDashboards",
"server": false,
"ui": true,
"requiredPlugins": ["opensearchDashboardsUtils", "wazuhCore"]
}
25 changes: 25 additions & 0 deletions plugins/wazuh-analysis/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "wazuh-analysis",
"version": "5.0.0",
"revision": "00",
"pluginPlatform": {
"version": "2.18.0"
},
"description": "Wazuh Analysis",
"private": true,
"scripts": {
"build": "yarn plugin-helpers build --opensearch-dashboards-version=$OPENSEARCH_DASHBOARDS_VERSION",
"plugin-helpers": "node ../../scripts/plugin_helpers",
"osd": "node ../../scripts/osd",
"test:ui:runner": "node ../../scripts/functional_test_runner.js",
"test:server": "plugin-helpers test:server",
"test:browser": "plugin-helpers test:browser",
"test:jest": "node scripts/jest --runInBand",
"test:jest:runner": "node scripts/runner test"
},
"dependencies": {},
"devDependencies": {
"@testing-library/user-event": "^14.5.2",
"@types/": "testing-library/user-event"
}
}
19 changes: 19 additions & 0 deletions plugins/wazuh-analysis/public/application.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { AppMountParameters } from 'opensearch-dashboards/public';
import {
AnalysisApp,
AnalysisAppDependencies,
} from './components/analysis-app';

export const renderApp = async (
{ history, element }: AppMountParameters,
dependencies: AnalysisAppDependencies,
) => {
ReactDOM.render(
<AnalysisApp dependencies={dependencies} history={history} />,
element,
);

return () => ReactDOM.unmountComponentAtNode(element);
};
18 changes: 18 additions & 0 deletions plugins/wazuh-analysis/public/components/analysis-app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import { EuiPage, EuiPageBody, EuiPageContentBody } from '@elastic/eui';
import { AppMountParameters } from '../../../../src/core/public';

export interface AnalysisAppDependencies {}

interface AnalysisAppProps {
history: AppMountParameters['history'];
dependencies: AnalysisAppDependencies;
}

export const AnalysisApp = (_props: AnalysisAppProps) => (
<EuiPage>
<EuiPageBody>
<EuiPageContentBody>AnalysisApp</EuiPageContentBody>
</EuiPageBody>
</EuiPage>
);
8 changes: 8 additions & 0 deletions plugins/wazuh-analysis/public/groups/category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { AppCategory } from 'opensearch-dashboards/public';
import { ANALYSIS_PLUGIN_TITLE, PLUGIN_ID } from '../../common/constants';

export const CATEGORY: AppCategory = Object.freeze({
id: PLUGIN_ID,
label: ANALYSIS_PLUGIN_TITLE,
order: 5000,
});
Loading
Loading