Skip to content

Commit d0c3f49

Browse files
mjabascal10KbayeroJocLRojasCopilotelmilan06
authored
Release/v11.1.1 (#1509)
* feat: update placement attribute to support multiple positions in alert action select component Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: condition builder visibility based on fields availability Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add system owner field to alert response rules and update related logic * feat: add systemOwner filter to playbooks component Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add system owner field to alert response rules and update related logic * feat: enhance playbook component with improved layout and functionality Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: enhance playbook component with improved layout and functionality Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: enhance playbook component with improved layout and functionality Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add system owner field to alert response rules and update related logic * feat: enhance playbook component with improved layout and functionality Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: update agent handling strategy description for clarity and context Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: update agent handling strategy description for clarity and context Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix: change PostgreSQL logger level from WARN to ERROR * feat: update log handling and display logic for improved clarity and consistency Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: update log filter selection to improve user experience Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix: handle potential null value in audits length check Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix: update filterBySelect method to accept a generic field type Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: update workflows and send to new cm in gcp * feat: include script to compile installer * fix: resolve workflow errors and improve cross-platform compatibility * fix problem with agent SIGN KEY * feat: implement service to automatically assign asset groups to alerts * feat: add asset group fields to alert constants and configuration Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(agent/syslog): add RFC 5424 octet counting framing support and improve message handling * fix: always update pending versions * improve v11 changelog * feat: enhance playbook UI and loading behavior, add new alert fields Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(oauth2): implement corporate authentication with OAuth2 support * feat(identity-provider): add OAuth2/OpenID Connect provider management Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(identity-provider): add OAuth2/OpenID Connect provider management Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: implement service to automatically assign asset groups to alerts * feat(identity-provider): add OAuth2/OpenID Connect provider management Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(oauth2): enhance corporate authentication with additional fields and event handling * feat: add CrowdStrike plugin core implementation * feat: add gRPC configuration management for CrowdStrike * feat(oauth2): enhance corporate authentication with additional fields and event handling * feat(oauth2): enhance corporate authentication with additional fields and event handling * feat(identity-provider): add OAuth2/OpenID Connect provider management Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(oauth2): enhance corporate authentication with additional fields and event handling * feat(identity-provider): add OAuth2/OpenID Connect provider management Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * refactor: update version info handling and clean up community module display Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * Update frontend/src/app/shared/components/auth/login/login.component.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update frontend/src/app/shared/components/auth/login-providers/login-providers.component.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update backend/src/main/java/com/park/utmstack/config/SecurityConfiguration.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update backend/src/main/java/com/park/utmstack/service/idp_provider/IdentityProviderService.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update frontend/src/app/app-management/identity-provider/shared/components/provider-form/provider-form.component.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat(oauth2): enhance corporate authentication with additional fields and event handling * refactor: simplify request structure and improve provider toggle logic Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(oauth2): implement enterprise version handling for identity providers Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add adversary view menu and associated authorities to database * feat: add adversary management module with routing and view components Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * refactor: remove deprecated standalone plugin architecture * feat: add adversary management module with routing and view components Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: implement adversary alerts management with new DTOs and service * feat: add SQL query support to LogExplorer via OpenSearch * feat: add SQL query support to LogExplorer via OpenSearch * feat: implement adversary alerts graph and service for data retrieval Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: enhance timezone handling by dynamically generating timezone list Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: enhance timezone handling by dynamically generating timezone list Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add adversary management module with routing and view components Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add adversary management module with routing and view components Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add adversary view menu and associated authorities to database * feat: implement adversary alerts graph and service for data retrieval Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: implement adversary alerts management with new DTOs and service * feat: enhance adversary alerts graph layout and styling for improved visualization Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: enhance adversary alerts graph layout and styling for improved visualization Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix[bitdefender-plugin]: make StartServer blocking and remove retry loop * update macos guide * feat: enhance adversary alerts graph layout and styling for improved visualization Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: enhance adversary alerts graph layout and styling for improved visualization Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: implement adversary alerts management with new DTOs and service * fix: adjust TFA expiration time to use configurable constant * feat: conditionally render module card based on module name Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add application version info retrieval functionality * feat: add application version info retrieval functionality Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: compliance report view component * feat: add SQL query support to LogExplorer via OpenSearch * feat: add SQL query support to LogExplorer via OpenSearch * feat(saml): implement SAML authentication support with identity provider configuration * feat(saml): implement SAML authentication support with identity provider configuration Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add application version info retrieval functionality * fix: remove conditional rendering for AS_400 module and filter out in module retrieval Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(saml): enhance SAML authentication success handler to include role-based authorities * feat(o365-plugin): add multi-cloud environment support for Microsoft Cloud (Commercial, GCC, GCC High, DoD) * feat: add exception handling for MethodArgumentNotValidException and update UtmModuleConfigValidator logic * fix(o365-plugin): Remove invalid field check and add multi-cloud support - Implement cloud-aware connection checking per authority - Use correct endpoints and scopes for each cloud environment * feat: add SQL query support to LogExplorer via OpenSearch * feat(o365-plugin): add Office 365 cloud environment configuration options * Update backend/src/main/resources/config/liquibase/changelog/20251125001_add_environment_o365_integration.xml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update backend/src/main/java/com/park/utmstack/domain/application_modules/factory/impl/ModuleO365.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update backend/src/main/java/com/park/utmstack/domain/application_modules/UtmModuleGroupConfiguration.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat: add SQL query support to LogExplorer via OpenSearch * feat: add SQL query support to LogExplorer via OpenSearch * feat: add SQL query support to LogExplorer via OpenSearch * feat: add SQL query support to LogExplorer via OpenSearch * feat: add SQL query support to LogExplorer via OpenSearch * fix: update file permissions from 777 to 755 for security improvements * feat(azure plugin): enhance Azure cloud detection and connection validation * feat(o365_validation-modules-config): add Management API validation and multi-cloud endpoint support * feat(header): integrate version info display and update logic Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * refactor: rename UtmStackConnectionService to ModuleConfigurationValidationService and enhance validation logic * feat(exception-handling): add ApiException class and global exception handler * feat: add SQL query support to LogExplorer via OpenSearch * feat: add SQL query support to LogExplorer via OpenSearch * feat(int-generic-group-config): improve searchable option based on config options length Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(int-generic-group-config): improve searchable option based on config options length Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix(modules-config): disable CROWDSTRIKE module not implemented in backend. * refactor(plugins): standardize logging with catcher * feat(saml): update identity provider configuration to include metadata URL and remove deprecated fields * style(dashboard): adjust padding and layout for improved UI consistency Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix: optimize cloud detection logic in connection string parsing * feat(elastic-filter-time): enhance time filter functionality and update UI interactions Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(azure): extract individual records from Azure Event Hub logs Parse Azure logs with 'records' array structure and send each record as a separate log entry for better indexing and security analysis. Maintains backward compatibility for logs without records array. * fix(modules-config): remove gin default logger middleware to eliminate non-standardized HTTP logs while maintaining catcher logging standard and panic protection. * refactor(azure-filter): deleted 'Expand log.records' data to improve parsing * refactor(gcp-filter): deleted 'Expand jsonPayload.structuredRdata' data to improve parsing * update the version of the Azure and GCP filters * feat(saml): update identity provider configuration to include metadata URL and remove deprecated fields * feat(provider): add SAML 2.0 support with metadata URL and service provider configuration Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(saml): enhance identity provider creation with multipart form data and encryption for private key * feat(provider): add SAML 2.0 support with metadata URL and service provider configuration Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix(totp): prevent potential error by checking subscription before unsubscribe Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * style(totp): comment out unused email resend container for cleaner code Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * style(utm-code-view): add word-break class to code element for better text handling Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(filters): add Azure and GCP filters with updated field mappings and severity handling * refactor(ModuleSocAi): remove unused getName method for cleaner code * fix(deployment-pipeline): update tag pattern for v10 to support semantic versioning * chore(changelog): update release notes for UTMStack v11.0.3 with fixed issues and performance improvements * chore(changelog): update release notes for UTMStack v11.0.3 with fixed issues and performance improvements * feat(authentication): add SAML and OIDC support with validation for private keys and certificates * chore(master.xml): remove outdated environment integration and filter update changelogs * feat(identity-provider): enhance provider management with file uploads and validation Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(authentication): enhance SAML and OIDC support with file validation and metadata URL checks * feat(identity-provider): enhance provider management with file uploads and validation Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(identity-provider): enhance provider management with file uploads and validation Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * Refactor adversary alerts graph component and update no data display Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * Remove redundant getName() method override in ModuleSocAi * Update frontend/src/app/data-management/alert-management/shared/components/filters/alert-generic-filter/alert-generic-filter.component.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat: add SQL query support to LogExplorer via OpenSearch * feat: add SQL query support to LogExplorer via OpenSearch * feat: enhance LogExplorer with SQL query support and custom keyword suggestions * Update backend/src/main/java/com/park/utmstack/service/dto/elastic/SqlSearchDto.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat: enhance identity provider management with role requirements and UI improvements Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: update login components for improved styling and provider text Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add loading screen with spinner and enhance app initialization Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(agents): update agent guide with Kali Linux tab and enhance installation command structure * feat: add SAML OIDC corporate authentication configuration fields * feat: add SAML OIDC corporate authentication support with SP entity ID and ACS URL Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat(api-keys): implement API key management with creation, retrieval, update, and deletion functionalities * feat: integrate app version management and enterprise feature directive Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: enhance SAML2 login handlers with role validation and logging * feat: enhance SAML2 login handlers with role validation and logging * feat: enhance SAML2 login handlers with role validation and logging * feat: integrate app version management and enterprise feature directive Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: update API route for version checking to check-for-updates Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: remove client secret display from provider details Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix: update application version file path and improve pagination offset calculation * fix: update application version file path and improve pagination offset calculation * fix: update opensearch-connector version to 1.0.4 * feat: enhance enterprise module directive to support dynamic menu names and icons Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix: streamline loading state management in playbook service and clean up filter parameters in playbooks component Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix: update UtmModuleRepository and UtmModuleService to use Optional for findByServerIdAndModuleName method * feat: add detail view for alerts in echoes component and improve alert display Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * fix: improve error handling in CleanCountedLogs to create default data retention file if retrieval fails * feat: enhance adversary alerts graph with dynamic graphic elements and improved chart container styling Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * Update frontend/src/app/data-management/alert-management/shared/components/alert-echoes/alert-echoes.component.html Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update frontend/src/app/data-management/alert-management/shared/components/alert-echoes/alert-echoes.component.html Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat: enhance detail view for alerts in echoes component and improve data handling Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: enhance adversary alerts graph with dynamic graphic elements and improved chart container styling Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: enhance adversary alerts graph with dynamic graphic elements and improved chart container styling Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * refactor: reorganize imports in adversary alerts graph component for improved readability Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * refactor: reorganize imports in adversary alerts graph component for improved readability Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * chore: update changelog for UTMStack v11.1.1 release, add fixes and features * fix: handle version info loading error gracefully Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: refactor module update process to use ModuleDTO and enhance decryption handling * feat: enhance adversary alerts graph with improved event handling and child alert metadata Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> * feat: add SAML2 login endpoint to front-end configuration --------- Signed-off-by: Manuel Abascal <mjabascal10@gmail.com> Co-authored-by: Yorjander Hernandez Vergara <yorjaKbayero@gmail.com> Co-authored-by: JocLRojas <joc.l.rojas02@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Elena Lopez Milan <elopez@utmstack.com> Co-authored-by: Osmany Montero <osmontero@icloud.com> Co-authored-by: Yadian Llada Lopez <yadian.llada@gmail.com>
1 parent cf3813e commit d0c3f49

File tree

18 files changed

+280
-103
lines changed

18 files changed

+280
-103
lines changed

CHANGELOG.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# UTMStack 11.1.0
1+
# UTMStack 11.1.1
22

3-
These are the release notes for **UTMStack v11.1.0**, highlighting new features, bug fixes, and performance improvements.
3+
These are the release notes for **UTMStack v11.1.1**, highlighting new features, bug fixes, and performance improvements.
44

5-
## Features
5+
## Fixes
6+
- Improved the module activation and deactivation process to handle missing modules more robustly and prevent errors when activating integrations.
67

7-
- Introduced SQL query support in LogExplorer, enabling users to execute SQL queries on OpenSearch indices directly from the user interface.
8-
- Added an interactive Adversary View to the Threat Management module, providing a graphical, filterable visualization of relationships between Adversaries, their generated Alerts, and associated Echoes.
8+
## Features
9+
- Enabled inline expand/collapse functionality for alert echo rows.

agent/logservice/processor.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,16 @@ func (l *LogProcessor) CleanCountedLogs() {
174174
for range ticker.C {
175175
dataRetention, err := GetDataRetention()
176176
if err != nil {
177-
utils.Logger.ErrorF("error getting data retention: %s", err)
178-
continue
177+
utils.Logger.ErrorF("error getting data retention: %s, creating default retention file", err)
178+
if err := SetDataRetention(""); err != nil {
179+
utils.Logger.ErrorF("error creating default data retention: %s", err)
180+
continue
181+
}
182+
dataRetention, err = GetDataRetention()
183+
if err != nil {
184+
utils.Logger.ErrorF("error reading newly created data retention: %s", err)
185+
continue
186+
}
179187
}
180188
l.db.Lock()
181189
_, err = l.db.DeleteOld(&models.Log{}, dataRetention)

backend/src/main/java/com/park/utmstack/event_processor/EventProcessorManagerService.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import com.park.utmstack.domain.application_modules.UtmModule;
55
import com.park.utmstack.domain.application_modules.UtmModuleGroup;
66
import com.park.utmstack.domain.application_modules.enums.ModuleName;
7+
import com.park.utmstack.service.dto.application_modules.ModuleDTO;
8+
import com.park.utmstack.service.dto.application_modules.UtmModuleMapper;
79
import com.park.utmstack.service.web_clients.rest_template.RestTemplateService;
810
import com.park.utmstack.util.CipherUtil;
911
import lombok.RequiredArgsConstructor;
@@ -34,7 +36,7 @@ public class EventProcessorManagerService {
3436
System.getenv(Constants.ENV_EVENT_PROCESSOR_HOST) + ":" +
3537
System.getenv(Constants.ENV_EVENT_PROCESSOR_PORT);
3638

37-
public void updateModule(UtmModule module) {
39+
public void updateModule(ModuleDTO module) {
3840
final String ctx = CLASSNAME + ".updateModule";
3941

4042
String url = UriComponentsBuilder
@@ -60,10 +62,19 @@ public void updateModule(UtmModule module) {
6062

6163
public void decryptModuleConfig (UtmModule module){
6264
Set<UtmModuleGroup> groups = module.getModuleGroups();
65+
decryptModuleGroupsConfig(groups, module.getModuleName());
66+
}
67+
68+
public void decryptModuleConfig (ModuleDTO moduleDTO){
69+
Set<UtmModuleGroup> groups = moduleDTO.getModuleGroups();
70+
decryptModuleGroupsConfig(groups, moduleDTO.getModuleName());
71+
}
72+
73+
private void decryptModuleGroupsConfig(Set<UtmModuleGroup> groups, ModuleName moduleName) {
6374
groups.forEach((gp) -> {
6475
gp.getModuleGroupConfigurations().forEach((gpc) -> {
6576
if ((gpc.getConfDataType().equals(Constants.CONF_TYPE_PASSWORD) && StringUtils.hasText(gpc.getConfValue()))
66-
|| (gpc.getConfDataType().equals(Constants.CONF_TYPE_FILE) && StringUtils.hasText(gpc.getConfValue())) && typeFileNeedsDecryptList.contains(module.getModuleName())) {
77+
|| (gpc.getConfDataType().equals(Constants.CONF_TYPE_FILE) && StringUtils.hasText(gpc.getConfValue())) && typeFileNeedsDecryptList.contains(moduleName)) {
6778
gpc.setConfValue(CipherUtil.decrypt(gpc.getConfValue(), System.getenv(Constants.ENV_ENCRYPTION_KEY)));
6879
}
6980
});

backend/src/main/java/com/park/utmstack/repository/application_modules/UtmModuleRepository.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.springframework.stereotype.Repository;
1111

1212
import java.util.List;
13+
import java.util.Optional;
1314

1415

1516
/**
@@ -19,8 +20,8 @@
1920
@Repository
2021
public interface UtmModuleRepository extends JpaRepository<UtmModule, Long>, JpaSpecificationExecutor<UtmModule> {
2122

22-
@EntityGraph(attributePaths = {"moduleGroups", "moduleGroups.moduleGroupConfigurations"})
23-
UtmModule findByServerIdAndModuleName(Long serverId, ModuleName shortName);
23+
@EntityGraph(attributePaths = {"server", "filters", "moduleGroups", "moduleGroups.moduleGroupConfigurations"})
24+
Optional<UtmModule> findByServerIdAndModuleName(Long serverId, ModuleName shortName);
2425

2526
Integer countAllByModuleNameAndModuleActiveIsTrue(ModuleName shortName);
2627

backend/src/main/java/com/park/utmstack/service/application_modules/UtmModuleGroupConfigurationService.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
import com.park.utmstack.repository.application_modules.UtmModuleRepository;
99
import com.park.utmstack.event_processor.EventProcessorManagerService;
1010
import com.park.utmstack.util.CipherUtil;
11+
import com.park.utmstack.util.exceptions.ApiException;
1112
import lombok.RequiredArgsConstructor;
12-
import org.apache.commons.lang3.SerializationUtils;
13+
import org.springframework.http.HttpStatus;
1314
import org.springframework.stereotype.Service;
1415
import org.springframework.transaction.annotation.Transactional;
1516
import org.springframework.util.CollectionUtils;
@@ -53,11 +54,11 @@ public void createConfigurationKeys(List<UtmModuleGroupConfiguration> keys) thro
5354
* @param keys List of configuration keys to save
5455
* @throws Exception In case of any error
5556
*/
56-
public void updateConfigurationKeys(Long moduleId, List<UtmModuleGroupConfiguration> keys) throws Exception {
57+
public UtmModule updateConfigurationKeys(Long moduleId, List<UtmModuleGroupConfiguration> keys) throws Exception {
5758
final String ctx = CLASSNAME + ".updateConfigurationKeys";
5859
try {
5960
if (CollectionUtils.isEmpty(keys))
60-
return;
61+
throw new ApiException("No configuration keys were provided to update", HttpStatus.BAD_REQUEST);
6162
for (UtmModuleGroupConfiguration key : keys) {
6263
if (key.getConfRequired() && !StringUtils.hasText(key.getConfValue()))
6364
throw new Exception(String.format("No value was found for required configuration: %1$s (%2$s)", key.getConfName(), key.getConfKey()));
@@ -67,14 +68,14 @@ public void updateConfigurationKeys(Long moduleId, List<UtmModuleGroupConfigurat
6768
moduleConfigurationRepository.saveAll(keys);
6869

6970
List<ModuleName> needRestartModules = Arrays.asList(ModuleName.AWS_IAM_USER, ModuleName.AZURE,
70-
ModuleName.GCP, ModuleName.SOPHOS);
71+
ModuleName.GCP, ModuleName.SOPHOS);
7172

72-
moduleRepository.findById(moduleId).ifPresent(module -> {
73-
module.setNeedsRestart(needRestartModules.contains(module.getModuleName()));
74-
moduleRepository.save(module);
75-
UtmModule detached = SerializationUtils.clone(module);
76-
eventProcessorManagerService.updateModule(detached);
77-
});
73+
return moduleRepository.findById(moduleId)
74+
.map(module -> {
75+
module.setNeedsRestart(needRestartModules.contains(module.getModuleName()));
76+
return moduleRepository.save(module);
77+
})
78+
.orElseThrow(() -> new ApiException(String.format("Module with ID %1$s not found", moduleId), HttpStatus.NOT_FOUND));
7879
} catch (Exception e) {
7980
throw new Exception(ctx + ": " + e.getMessage());
8081
}

backend/src/main/java/com/park/utmstack/service/application_modules/UtmModuleService.java

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
import com.park.utmstack.repository.UtmModuleGroupRepository;
99
import com.park.utmstack.repository.application_modules.UtmModuleRepository;
1010
import com.park.utmstack.service.UtmMenuService;
11-
import com.park.utmstack.event_processor.EventProcessorManagerService;
1211
import com.park.utmstack.service.dto.application_modules.ModuleActivationDTO;
1312
import com.park.utmstack.service.index_pattern.UtmIndexPatternService;
1413
import com.park.utmstack.service.logstash_filter.UtmLogstashFilterService;
1514
import lombok.RequiredArgsConstructor;
16-
import org.apache.commons.lang3.SerializationUtils;
1715
import org.slf4j.Logger;
1816
import org.slf4j.LoggerFactory;
1917
import org.springframework.data.domain.Page;
@@ -24,7 +22,6 @@
2422

2523
import java.util.List;
2624
import java.util.NoSuchElementException;
27-
import java.util.Objects;
2825
import java.util.Optional;
2926

3027
/**
@@ -43,7 +40,6 @@ public class UtmModuleService {
4340
private final UtmIndexPatternService indexPatternService;
4441
private final UtmLogstashFilterService logstashFilterService;
4542
private final UtmModuleGroupRepository moduleGroupRepository;
46-
private final EventProcessorManagerService eventProcessorManagerService;
4743

4844

4945
/**
@@ -56,30 +52,29 @@ public class UtmModuleService {
5652
public UtmModule activateDeactivate(ModuleActivationDTO moduleActivationDTO) {
5753
final String ctx = CLASSNAME + ".activateDeactivate";
5854

59-
long serverId = moduleActivationDTO.getServerId();
60-
ModuleName nameShort = moduleActivationDTO.getModuleName();
61-
boolean activationStatus = moduleActivationDTO.getActivationStatus();
55+
long serverId = moduleActivationDTO.getServerId();
56+
ModuleName nameShort = moduleActivationDTO.getModuleName();
57+
boolean activationStatus = moduleActivationDTO.getActivationStatus();
6258

63-
UtmModule module = moduleRepository.findByServerIdAndModuleName(serverId, nameShort);
59+
return moduleRepository.findByServerIdAndModuleName(serverId, nameShort)
60+
.map(module -> {
61+
module.setModuleActive(activationStatus);
62+
module = moduleRepository.save(module);
6463

65-
if (Objects.isNull(module))
66-
throw new NoSuchElementException(String.format("Definition of the module %1$s not found for the server ID %2$s", nameShort.name(), serverId));
64+
List<ModuleName> nonRemovableConf = List.of(ModuleName.SOC_AI);
6765

68-
module.setModuleActive(activationStatus);
69-
module = moduleRepository.save(module);
66+
if (!activationStatus && !nonRemovableConf.contains(nameShort))
67+
moduleGroupRepository.deleteAllByModuleId(module.getId());
7068

71-
List<ModuleName> nonRemovableConf = List.of(ModuleName.SOC_AI);
69+
enableDisableModuleMenus(nameShort, activationStatus);
70+
enableDisableModuleIndexPatterns(nameShort, activationStatus);
71+
enableDisableModuleFilter(nameShort, activationStatus);
7272

73-
if (!activationStatus && !nonRemovableConf.contains(nameShort))
74-
moduleGroupRepository.deleteAllByModuleId(module.getId());
75-
76-
enableDisableModuleMenus(nameShort, activationStatus);
77-
enableDisableModuleIndexPatterns(nameShort, activationStatus);
78-
enableDisableModuleFilter(nameShort, activationStatus);
79-
UtmModule detached = SerializationUtils.clone(module);
80-
eventProcessorManagerService.updateModule(detached);
81-
82-
return module;
73+
return module;
74+
})
75+
.orElseThrow(() -> new NoSuchElementException(
76+
String.format("Definition of the module %1$s not found for the server ID %2$s", nameShort.name(), serverId)
77+
));
8378
}
8479

8580
private void enableDisableModuleMenus(ModuleName nameShort, Boolean activationStatus) {
@@ -186,11 +181,12 @@ public Optional<UtmModule> findOne(Long id) {
186181

187182
public UtmModule findByServerIdAndModuleName(Long serverId, ModuleName shortName) {
188183
final String ctx = CLASSNAME + ".findByServerIdAndModuleName";
189-
try {
190-
return moduleRepository.findByServerIdAndModuleName(serverId, shortName);
191-
} catch (Exception e) {
192-
throw new RuntimeException(ctx + ": " + e.getMessage());
193-
}
184+
185+
return moduleRepository.findByServerIdAndModuleName(serverId, shortName)
186+
.orElseThrow(() -> new NoSuchElementException(
187+
String.format("%s: The module %s not found for the server ID %s", ctx, shortName.name(), serverId)
188+
));
189+
194190
}
195191

196192
public boolean isModuleActive(ModuleName shortName) {

backend/src/main/java/com/park/utmstack/web/rest/application_modules/UtmModuleGroupConfigurationResource.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
import com.park.utmstack.aop.logging.AuditEvent;
44
import com.park.utmstack.domain.application_events.enums.ApplicationEventType;
5+
import com.park.utmstack.domain.application_modules.UtmModule;
56
import com.park.utmstack.domain.application_modules.UtmModuleGroupConfiguration;
7+
import com.park.utmstack.event_processor.EventProcessorManagerService;
68
import com.park.utmstack.service.application_events.ApplicationEventService;
79
import com.park.utmstack.service.application_modules.UtmModuleGroupConfigurationService;
810
import com.park.utmstack.service.dto.application_modules.GroupConfigurationDTO;
11+
import com.park.utmstack.service.dto.application_modules.ModuleDTO;
12+
import com.park.utmstack.service.dto.application_modules.UtmModuleMapper;
913
import com.park.utmstack.web.rest.util.HeaderUtil;
1014
import lombok.RequiredArgsConstructor;
1115
import org.slf4j.Logger;
@@ -27,6 +31,8 @@ public class UtmModuleGroupConfigurationResource {
2731
private final Logger log = LoggerFactory.getLogger(UtmModuleGroupConfigurationResource.class);
2832
private final UtmModuleGroupConfigurationService moduleGroupConfigurationService;
2933
private final ApplicationEventService applicationEventService;
34+
private final UtmModuleMapper utmModuleMapper;
35+
private final EventProcessorManagerService eventProcessorManagerService;
3036

3137

3238
@PutMapping("/module-group-configurations/update")
@@ -39,7 +45,10 @@ public class UtmModuleGroupConfigurationResource {
3945
public ResponseEntity<Void> updateConfiguration(@Valid @RequestBody GroupConfigurationDTO body) {
4046
final String ctx = CLASSNAME + ".updateConfiguration";
4147
try {
42-
moduleGroupConfigurationService.updateConfigurationKeys(body.getModuleId(), body.getKeys());
48+
UtmModule module = moduleGroupConfigurationService.updateConfigurationKeys(body.getModuleId(), body.getKeys());
49+
ModuleDTO moduleDTO = utmModuleMapper.toDto(module, false);
50+
eventProcessorManagerService.updateModule(moduleDTO);
51+
4352
return ResponseEntity.ok().build();
4453
} catch (Exception e) {
4554
String msg = ctx + ": " + e.getMessage();

backend/src/main/java/com/park/utmstack/web/rest/application_modules/UtmModuleResource.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@
1313
import com.park.utmstack.service.application_modules.UtmModuleQueryService;
1414
import com.park.utmstack.service.application_modules.UtmModuleService;
1515
import com.park.utmstack.event_processor.EventProcessorManagerService;
16-
import com.park.utmstack.service.dto.application_modules.CheckRequirementsResponse;
17-
import com.park.utmstack.service.dto.application_modules.ModuleActivationDTO;
18-
import com.park.utmstack.service.dto.application_modules.ModuleDTO;
19-
import com.park.utmstack.service.dto.application_modules.UtmModuleCriteria;
16+
import com.park.utmstack.service.dto.application_modules.*;
2017
import com.park.utmstack.util.ResponseUtil;
2118
import com.park.utmstack.web.rest.util.PaginationUtil;
22-
import lombok.Getter;
2319
import lombok.RequiredArgsConstructor;
24-
import lombok.Setter;
2520
import org.slf4j.Logger;
2621
import org.slf4j.LoggerFactory;
2722
import org.springframework.data.domain.Page;
@@ -48,8 +43,8 @@ public class UtmModuleResource {
4843
private final UtmModuleQueryService utmModuleQueryService;
4944
private final ApplicationEventService eventService;
5045
private final UtmServerRepository utmServerRepository;
51-
// List of configurations of type 'file' that needs content decryption
5246
private final EventProcessorManagerService eventProcessorManagerService;
47+
private final UtmModuleMapper utmModuleMapper;
5348

5449

5550

@@ -60,14 +55,19 @@ public class UtmModuleResource {
6055
successMessage = "Module activated/deactivated successfully"
6156
)
6257
@PutMapping("/utm-modules/activateDeactivate")
63-
public ResponseEntity<UtmModule> activateDeactivate(@RequestParam Long serverId,
58+
public ResponseEntity<ModuleDTO> activateDeactivate(@RequestParam Long serverId,
6459
@RequestParam ModuleName nameShort,
6560
@RequestParam Boolean activationStatus) {
66-
return ResponseEntity.ok(moduleService.activateDeactivate(ModuleActivationDTO.builder()
67-
.serverId(serverId)
68-
.moduleName(nameShort)
69-
.activationStatus(activationStatus)
70-
.build()));
61+
62+
UtmModule module = moduleService.activateDeactivate(ModuleActivationDTO.builder()
63+
.serverId(serverId)
64+
.moduleName(nameShort)
65+
.activationStatus(activationStatus)
66+
.build());
67+
ModuleDTO moduleDTO = utmModuleMapper.toDto(module, false);
68+
eventProcessorManagerService.updateModule(moduleDTO);
69+
70+
return ResponseEntity.ok(moduleDTO);
7171
}
7272

7373
/**

frontend/src/app/data-management/adversary-management/adversary-alerts-graph/adversary-alerts-graph.component.html

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="d-flex flex-column h-100 m-h-0 overflow-auto">
1+
<div class="d-flex flex-column h-100 m-h-0 overflow-auto chart-container">
22
<div class="flex-grow-1 h-100">
33
<div echarts
44
[options]="option"
@@ -9,3 +9,26 @@
99
</div>
1010
</div>
1111

12+
<div *ngIf="viewAlertDetail" class="utm-right-container">
13+
<div (click)="closeDetail()" class="overlay overlay-lg col-md-6"></div>
14+
<div class="card utm-right-action utm-right-action-lg">
15+
<div class="title d-flex justify-content-between align-items-center border-bottom-1
16+
border-bottom-grey-100 p-3 ">
17+
<h6 class="card-title pb-0 mb-0 text-blue-800 font-weight-light">
18+
{{ alertDetail.name }}
19+
</h6>
20+
<div class="d-flex flex-row align-items-center gap-2">
21+
<app-alert-logs-related-action [logs]="alertDetail.events"></app-alert-logs-related-action>
22+
<button (click)="closeDetail()" aria-label="Close"
23+
class="" type="button">
24+
<div class="close-icon"></div>
25+
</button>
26+
</div>
27+
</div>
28+
<app-alert-view-detail [alert]="alertDetail"
29+
[isEcho] = "true"
30+
[hideEmptyField]= "true"
31+
[dataType]="EventDataTypeEnum.ALERT">
32+
</app-alert-view-detail>
33+
</div>
34+
</div>

0 commit comments

Comments
 (0)