-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New plugin wazuh-fleet * Implement wazuh-fleet sidebar and fleet list components * Add agents grid * Add fields to script * Add visualizations in agents summary * Improve agent list * Add agent details page and flyout * Add groups index script * Add groups data source * Add groups components to router * Add group table * Add command index script * Add commands list in fleet management * Fix get agent details * Improve and fix minor issues * Add host and networks to script and improve agent view * Apply prettier * Apply prettier * Upgrade axios dependency * Prettier * Fix agent.id field in commands columns --------- Co-authored-by: Luciano Gorza <[email protected]> Co-authored-by: Federico Rodriguez <[email protected]>
- Loading branch information
1 parent
1b0c94e
commit a1fc490
Showing
91 changed files
with
4,510 additions
and
23 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...onents/common/data-source/pattern/fleet/commands/fleet-commands-data-source-repository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { PatternDataSourceRepository } from '../../pattern-data-source-repository'; | ||
import { tParsedIndexPattern } from '../../../index'; | ||
|
||
export class FleetCommandsDataSourceRepository extends PatternDataSourceRepository { | ||
constructor() { | ||
super(); | ||
} | ||
|
||
async get(id: string) { | ||
const dataSource = await super.get(id); | ||
if (this.validate(dataSource)) { | ||
return dataSource; | ||
} else { | ||
throw new Error('Fleet index pattern not found'); | ||
} | ||
} | ||
|
||
async getAll() { | ||
const indexs = await super.getAll(); | ||
return indexs.filter(this.validate); | ||
} | ||
|
||
validate(dataSource): boolean { | ||
const stringToSearch = 'commands'; //always in lower case | ||
return ( | ||
dataSource.id?.toLowerCase().includes(stringToSearch) || | ||
dataSource.attributes?.title?.toLowerCase().includes(stringToSearch) | ||
); | ||
} | ||
|
||
getDefault() { | ||
return Promise.resolve(null); | ||
} | ||
|
||
setDefault(dataSource: tParsedIndexPattern) { | ||
return; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...public/components/common/data-source/pattern/fleet/commands/fleet-commands-data-source.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { | ||
DATA_SOURCE_FILTER_CONTROLLED_CLUSTER_MANAGER, | ||
FLEET_IMPLICIT_CLUSTER_MODE_FILTER, | ||
} from '../../../../../../../common/constants'; | ||
import { tFilter, PatternDataSourceFilterManager } from '../../../index'; | ||
import { PatternDataSource } from '../../pattern-data-source'; | ||
|
||
export class FleetCommandsDataSource extends PatternDataSource { | ||
constructor(id: string, title: string) { | ||
super(id, title); | ||
} | ||
|
||
getFixedFilters(): tFilter[] { | ||
return [...this.getClusterManagerFilters(), ...super.getFixedFilters()]; | ||
} | ||
|
||
getClusterManagerFilters() { | ||
return PatternDataSourceFilterManager.getClusterManagerFilters( | ||
this.id, | ||
DATA_SOURCE_FILTER_CONTROLLED_CLUSTER_MANAGER, | ||
FLEET_IMPLICIT_CLUSTER_MODE_FILTER, | ||
); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
plugins/main/public/components/common/data-source/pattern/fleet/commands/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './fleet-commands-data-source'; | ||
export * from './fleet-commands-data-source-repository'; |
38 changes: 38 additions & 0 deletions
38
...s/main/public/components/common/data-source/pattern/fleet/fleet-data-source-repository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { PatternDataSourceRepository } from '../pattern-data-source-repository'; | ||
import { tParsedIndexPattern } from '../../index'; | ||
|
||
export class FleetDataSourceRepository extends PatternDataSourceRepository { | ||
constructor() { | ||
super(); | ||
} | ||
|
||
async get(id: string) { | ||
const dataSource = await super.get(id); | ||
if (this.validate(dataSource)) { | ||
return dataSource; | ||
} else { | ||
throw new Error('Fleet index pattern not found'); | ||
} | ||
} | ||
|
||
async getAll() { | ||
const indexs = await super.getAll(); | ||
return indexs.filter(this.validate); | ||
} | ||
|
||
validate(dataSource): boolean { | ||
const stringToSearch = 'fleet-agents'; //always in lower case | ||
return ( | ||
dataSource.id?.toLowerCase().includes(stringToSearch) || | ||
dataSource.attributes?.title?.toLowerCase().includes(stringToSearch) | ||
); | ||
} | ||
|
||
getDefault() { | ||
return Promise.resolve(null); | ||
} | ||
|
||
setDefault(dataSource: tParsedIndexPattern) { | ||
return; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
plugins/main/public/components/common/data-source/pattern/fleet/fleet-data-source.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { | ||
DATA_SOURCE_FILTER_CONTROLLED_CLUSTER_MANAGER, | ||
FLEET_IMPLICIT_CLUSTER_MODE_FILTER, | ||
} from '../../../../../../common/constants'; | ||
import { tFilter, PatternDataSourceFilterManager } from '../../index'; | ||
import { PatternDataSource } from '../pattern-data-source'; | ||
|
||
export class FleetDataSource extends PatternDataSource { | ||
constructor(id: string, title: string) { | ||
super(id, title); | ||
} | ||
|
||
getFixedFilters(): tFilter[] { | ||
return [...this.getClusterManagerFilters(), ...super.getFixedFilters()]; | ||
} | ||
|
||
getClusterManagerFilters() { | ||
return PatternDataSourceFilterManager.getClusterManagerFilters( | ||
this.id, | ||
DATA_SOURCE_FILTER_CONTROLLED_CLUSTER_MANAGER, | ||
FLEET_IMPLICIT_CLUSTER_MODE_FILTER, | ||
); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...components/common/data-source/pattern/fleet/groups/fleet-groups-data-source-repository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { PatternDataSourceRepository } from '../../pattern-data-source-repository'; | ||
import { tParsedIndexPattern } from '../../../index'; | ||
|
||
export class FleetGroupsDataSourceRepository extends PatternDataSourceRepository { | ||
constructor() { | ||
super(); | ||
} | ||
|
||
async get(id: string) { | ||
const dataSource = await super.get(id); | ||
if (this.validate(dataSource)) { | ||
return dataSource; | ||
} else { | ||
throw new Error('Fleet index pattern not found'); | ||
} | ||
} | ||
|
||
async getAll() { | ||
const indexs = await super.getAll(); | ||
return indexs.filter(this.validate); | ||
} | ||
|
||
validate(dataSource): boolean { | ||
const stringToSearch = 'fleet-groups'; //always in lower case | ||
return ( | ||
dataSource.id?.toLowerCase().includes(stringToSearch) || | ||
dataSource.attributes?.title?.toLowerCase().includes(stringToSearch) | ||
); | ||
} | ||
|
||
getDefault() { | ||
return Promise.resolve(null); | ||
} | ||
|
||
setDefault(dataSource: tParsedIndexPattern) { | ||
return; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ain/public/components/common/data-source/pattern/fleet/groups/fleet-groups-data-source.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { | ||
DATA_SOURCE_FILTER_CONTROLLED_CLUSTER_MANAGER, | ||
FLEET_IMPLICIT_CLUSTER_MODE_FILTER, | ||
} from '../../../../../../../common/constants'; | ||
import { tFilter, PatternDataSourceFilterManager } from '../../../index'; | ||
import { PatternDataSource } from '../../pattern-data-source'; | ||
|
||
export class FleetGroupsDataSource extends PatternDataSource { | ||
constructor(id: string, title: string) { | ||
super(id, title); | ||
} | ||
|
||
getFixedFilters(): tFilter[] { | ||
return [...this.getClusterManagerFilters(), ...super.getFixedFilters()]; | ||
} | ||
|
||
getClusterManagerFilters() { | ||
return PatternDataSourceFilterManager.getClusterManagerFilters( | ||
this.id, | ||
DATA_SOURCE_FILTER_CONTROLLED_CLUSTER_MANAGER, | ||
FLEET_IMPLICIT_CLUSTER_MODE_FILTER, | ||
); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
plugins/main/public/components/common/data-source/pattern/fleet/groups/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './fleet-groups-data-source'; | ||
export * from './fleet-groups-data-source-repository'; |
4 changes: 4 additions & 0 deletions
4
plugins/main/public/components/common/data-source/pattern/fleet/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './fleet-data-source-repository'; | ||
export * from './fleet-data-source'; | ||
export * from './groups'; | ||
export * from './commands'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.