Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
2eb71ee
feat(pfsense): update pfsense filter
mjabascal10 Jan 29, 2026
fe30f0b
fix: update query suggestions to remove redundant log prefix
mjabascal10 Jan 29, 2026
8b0ab99
Merge remote-tracking branch 'origin/release/v11.2.2' into release/v1…
mjabascal10 Jan 29, 2026
f9491e7
feat: replace hardcoded search limit with MAX_SEARCH_RESULTS constant
mjabascal10 Jan 30, 2026
9b7cf31
feat: replace hardcoded search limit with MAX_SEARCH_RESULTS constant
mjabascal10 Jan 30, 2026
2ba7785
feat: replace hardcoded search limit with MAX_SEARCH_RESULTS constant
mjabascal10 Jan 30, 2026
060eed0
docs(README): fix broken tags, improve clarity, and correct grammar
osmontero Feb 2, 2026
667e65d
feat: add Linux Auditing Daemon update to changelog
mjabascal10 Feb 2, 2026
3cbd12b
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
mjabascal10 Feb 2, 2026
2544d91
feat: update architecture names for clarity in Linux agent guide
mjabascal10 Feb 2, 2026
2433faa
feat: enhance version info handling in API documentation component
mjabascal10 Feb 2, 2026
232adfd
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
mjabascal10 Feb 2, 2026
77b61fd
feat: add Crowdstrike filter update to changelog
mjabascal10 Feb 2, 2026
74525f7
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
mjabascal10 Feb 2, 2026
175e4e6
feat: update layout styles for API documentation component
mjabascal10 Feb 2, 2026
f8e049b
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
mjabascal10 Feb 2, 2026
6f3e0e8
feat: comment out security scheme definitions in OpenApiConfiguration
mjabascal10 Feb 2, 2026
f3aa9c2
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
mjabascal10 Feb 2, 2026
acf3ead
feat: update alert field type to string and adjust sorting logic in a…
mjabascal10 Feb 2, 2026
c82b4de
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
mjabascal10 Feb 2, 2026
4d3d3f9
chore(plugins): update dependencies across plugins
osmontero Feb 2, 2026
76563e3
Merge branch 'release/v11.2.2' into release/v11.2.3
osmontero Feb 2, 2026
2b6bb5b
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
osmontero Feb 2, 2026
36ccf38
Merge branch 'v11' into release/v11.2.3
osmontero Feb 2, 2026
2eb5741
docs(README): enhance formatting and improve badge layout
osmontero Feb 2, 2026
ace8513
fix(notification): improve email sending logic and error handling
mjabascal10 Feb 3, 2026
1ef7e24
feat(config): add state change detection for dynamic updates
osmontero Feb 3, 2026
b007fed
refactor(alerts): streamline `AlertFields` struct and initialization
osmontero Feb 3, 2026
6fbc0fa
chore(tests): remove integration tests and update SDK to v1.1.11
osmontero Feb 3, 2026
d27805e
docs(README): add detailed plugin overviews for alerts and config com…
osmontero Feb 3, 2026
bf64621
feat(alerts): add `Timestamp` field to `AlertFields` struct
osmontero Feb 3, 2026
1ec490c
feat(adversary-alerts): enhance chart rendering logic with dynamic co…
mjabascal10 Feb 3, 2026
d3b2dd9
feat(log-analyzer): update SQL editor container styles for responsive…
mjabascal10 Feb 3, 2026
24299da
fix(package): restore package.json
mjabascal10 Feb 3, 2026
29debbc
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
mjabascal10 Feb 3, 2026
5b08e52
feat: update last update timestamp when activating or deactivating a …
mjabascal10 Feb 3, 2026
de47895
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
mjabascal10 Feb 3, 2026
39360d8
refactor(alerts): update `ParentId` initialization to handle nullable…
osmontero Feb 3, 2026
2ee1e05
fix: update timestamp handling in correlation rules and logstash filt…
mjabascal10 Feb 3, 2026
b3ac04a
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
mjabascal10 Feb 3, 2026
0ca5bfb
fix[ci/cd]: solved multiple instance problem in actions
Kbayero Feb 3, 2026
576874f
feat(rule-view): enhance YAML export functionality and improve UI layout
mjabascal10 Feb 4, 2026
f4bf30e
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
mjabascal10 Feb 4, 2026
ad0da80
fix: rename assetIpMacName to searchQuery in agent sidebar data loading
mjabascal10 Feb 4, 2026
6002ad7
fix: clean up alert detail view logic and HTML formatting
mjabascal10 Feb 4, 2026
4a2f429
feat: add constructors to ComplianceFileResponse for improved object …
mjabascal10 Feb 4, 2026
6784002
refactor: improve ComplianceMailService and PdfService for better err…
mjabascal10 Feb 4, 2026
723c82c
refactor(o365-filter): improve the office365 filter to properly compl…
JocLRojas Feb 4, 2026
1a226a5
refactor(sonic_wall-filter): improve the sonic_wall filter to correct…
JocLRojas Feb 4, 2026
e5877af
fix: enhance target validation in alert label retrieval
mjabascal10 Feb 4, 2026
ee7345f
fix: improve isEmpty checks for alert target and log objects
mjabascal10 Feb 4, 2026
2ab8afe
feat: update integration filters for Microsoft 365 and SonicWall
mjabascal10 Feb 4, 2026
5f02b0b
feat: add error handling and response mapping for module configuratio…
mjabascal10 Feb 5, 2026
a2ca1a6
fix: add property node to constraint violation for better error repor…
mjabascal10 Feb 5, 2026
1ae95e2
fix(crowdstrike-plugin): handle cloud region URL parsing to prevent w…
JocLRojas Feb 5, 2026
7bf9918
fix(modules-config): add cloud region URL parsing for CrowdStrike con…
JocLRojas Feb 5, 2026
ac1ffc9
refactor(import-rule): enhance step indicators and improve rule displ…
mjabascal10 Feb 5, 2026
2e5e6bc
refactor(import-rule): enhance step indicators and improve rule displ…
mjabascal10 Feb 5, 2026
baa72be
feat(netflow-filter): enhance Netflow log parsing capabilities
JocLRojas Feb 6, 2026
67a33ff
feat(VMware-filter): enhance VMware log parsing capabilities
JocLRojas Feb 6, 2026
e7f6892
refactor(dashboard): streamline component logic and enhance error han…
mjabascal10 Feb 6, 2026
ed1afc0
refactor(modals): adjust modal heights and improve layout for better …
mjabascal10 Feb 6, 2026
3cad800
chore(go.mod): upgrade dependencies and adjust index method
osmontero Feb 6, 2026
afc16f3
Merge remote-tracking branch 'origin/release/v11.2.3' into release/v1…
osmontero Feb 6, 2026
1d89c6e
chore(indexing): replace `BuildCurrentIndex` with `BuildCurrentDayInd…
osmontero Feb 6, 2026
1df4b15
chore(go.sum): remove unused dependencies and update versions
osmontero Feb 6, 2026
d02215b
chore(alerts): add timestamp-based filtering for the last 7 days
osmontero Feb 6, 2026
9ee7898
feat(integration): add VMware and Netflow filter updates for enhanced…
mjabascal10 Feb 6, 2026
19ca2c6
feat(integration): add VMware and Netflow filter updates for enhanced…
mjabascal10 Feb 6, 2026
b23c9ac
refactor: Update filter configurations to use new expression function…
osmontero Feb 9, 2026
2462e5f
refactor: Migrate filter configurations from .conf to .yml format.
osmontero Feb 9, 2026
d43b73d
feat(correlation): add updates for correlation rules and system owner…
mjabascal10 Feb 9, 2026
89d829f
update versions of the filters for multiple integrations
JocLRojas Feb 9, 2026
5afb43a
fix: update UTMStack filter version to 1.0.1 and refine JSON parsing …
yllada Feb 9, 2026
356cbf6
feat(correlation): update correlation rules and system owner configur…
mjabascal10 Feb 9, 2026
cf62f57
refactor(correlation): remove deprecated correlation rules and clean …
mjabascal10 Feb 9, 2026
571c6e4
refactor(correlation): remove deprecated correlation rules and clean …
mjabascal10 Feb 9, 2026
7fc5ee8
bugfix (agent): fixes to agent/utils/download.go and agent/utils/req.…
osmontero Feb 10, 2026
79e4892
feat(utm): update UTMStack filter update to version 3.0.5 in XML conf…
mjabascal10 Feb 10, 2026
58c2788
increase agent and updater versions
osmontero Feb 10, 2026
33a0c51
Merge branch 'release/v11.2.3' of https://github.com/utmstack/UTMStac…
osmontero Feb 10, 2026
7c9b1d1
fix (filters) multiple filters using mother overloads that are null a…
osmontero Feb 10, 2026
15c1120
chore: bump agent and updater versions and add idle connection closin…
osmontero Feb 10, 2026
f301c1a
feat(azure-plugin): improve Event Hub partition processing with grace…
JocLRojas Feb 10, 2026
2aadeec
refactor(aws-plugins): remove sensitive config data from log message
JocLRojas Feb 10, 2026
0257c02
refactor(azure-plugins): remove sensitive config data from log message
JocLRojas Feb 10, 2026
c52dba2
refactor(bitdefender-plugins): remove sensitive config data from log …
JocLRojas Feb 10, 2026
b9d0914
refactor(crowdstrike-plugins): remove sensitive config data from log …
JocLRojas Feb 10, 2026
17f7580
refactor(gcp-plugins): remove sensitive config data from log message
JocLRojas Feb 10, 2026
a0690fc
refactor(o365-plugins): remove sensitive config data from log message
JocLRojas Feb 10, 2026
094e702
refactor(soc-ai-plugins): remove sensitive config data from log message
JocLRojas Feb 10, 2026
4d427bf
refactor(sophos-plugins): remove sensitive config data from log message
JocLRojas Feb 10, 2026
e030ea8
feat(utm): update UTMStack filter configuration for version 3.0.5
mjabascal10 Feb 10, 2026
1d5064a
feat(utm): enhance configuration encryption to support file data type
mjabascal10 Feb 10, 2026
dab2aec
refactor(assets-view): improve last input display logic and remove de…
mjabascal10 Feb 10, 2026
6e2feba
refactor(int-generic-group-config): update file upload logic to simpl…
mjabascal10 Feb 10, 2026
13fe2fc
refactor(guide-linux-agent): update installation steps for clarity an…
mjabascal10 Feb 10, 2026
ceafb52
refactor: use crypto/rand for cryptographically secure secret generat…
osmontero Feb 10, 2026
ab89814
refactor: deduplication and grouping now only apply when non-null fie…
osmontero Feb 10, 2026
5c7c0a8
feat(utm): add Cisco ASA, Switch, Firepower, and Meraki filter update…
mjabascal10 Feb 10, 2026
84547c9
feat(utm): add Cisco Deceptive Bytes and IBM AIX filter updates for v…
mjabascal10 Feb 10, 2026
0614c6f
feat(utm): update Microsoft 365 filter update for version 1.0.3 and r…
mjabascal10 Feb 10, 2026
ada9702
feat(utm): update Windows Events filter update for version 1.0.0
mjabascal10 Feb 10, 2026
1453120
refactor(UtmDataInputStatusService): improve handling of last process…
mjabascal10 Feb 10, 2026
4c6bb1c
feat(UtmModuleService): update filter activation logic to include tim…
mjabascal10 Feb 10, 2026
51d45a2
feat(azure-plugin): configure Event Hub processor to read from earlie…
JocLRojas Feb 10, 2026
efc1cd2
feat(azure-plugin): add processor initialization timeout and improve …
JocLRojas Feb 10, 2026
b3b411b
feat(UtmDataInputStatusRepository): enhance query to normalize dataTy…
mjabascal10 Feb 10, 2026
96d8d3b
feat(add-type): enhance validation and search functionality for data …
mjabascal10 Feb 11, 2026
257fec7
refactor(azure-plugin): implement persistent Event Hub processor life…
JocLRojas Feb 11, 2026
b21fdc0
feat(assets-view): update sorting to prioritize asset status and add …
mjabascal10 Feb 11, 2026
eab3e3d
feat(azure-plugin): add JSON parsing and records array handling for E…
JocLRojas Feb 11, 2026
b4a7201
fix(vmware.steps): correct loghost syntax in syslog configuration com…
mjabascal10 Feb 11, 2026
0865792
feat(bitdefender_gz): update filter version to 3.0.2 and enhance grok…
yllada Feb 11, 2026
be153b2
feat: update update bit defender filter
mjabascal10 Feb 11, 2026
3fb01f3
feat: update update bit defender filter
mjabascal10 Feb 11, 2026
fc75297
fix(bitdefender_gz): update log severity field and add additional tra…
yllada Feb 11, 2026
c37d76b
Merge branch 'release/v11.2.3' of github.com:utmstack/UTMStack into r…
yllada Feb 11, 2026
fa23d4d
update netflow filter
JocLRojas Feb 11, 2026
326c4da
feat: update update bit defender filter
mjabascal10 Feb 11, 2026
49872b0
feat: update Netflow filter update and modify Bit Defender filter con…
mjabascal10 Feb 11, 2026
54c33da
feat: update Netflow filter update and modify Bit Defender filter con…
mjabascal10 Feb 11, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/v11-deployment-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ jobs:
-H "Content-Type: application/json" \
-H "id: $auth_id" \
-H "key: $auth_key" \
-d "{\"instance_id\": \"$instance_id\", \"version\": \"$TAG\"}")
-d "{\"instances_ids\": [\"$instance_id\"], \"version\": \"$TAG\"}")

http_code=$(echo "$response" | tail -n1)
body=$(echo "$response" | sed '$d')
Expand Down
52 changes: 28 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
<h1 align="center">
<br>
<a href="https://utmstack.com"><img src="https://utmstack.com/wp-content/uploads/2023/02/utmstack-logo-favicon.png?v=2" width="200px" alt="UTMStack"></a>
</h1>
# UTMStack

<p align="center">
<a href="https://github.com/utmstack/UTMStack/graphs/contributors"><img src="https://img.shields.io/github/contributors-anon/utmstack/utmstack">
<a href="https://github.com/utmstack/UTMStack/releases/"><img src="https://img.shields.io/github/release/utmstack/utmstack">
<a href="https://github.com/utmstack/UTMStack/issues"><img src="https://img.shields.io/github/issues-raw/utmstack/utmstack">
<a href="https://github.com/utmstack/UTMStack/commits/main"><img src="https://img.shields.io/github/commit-activity/m/utmstack/utmstack">
<a href="https://github.com/utmstack/UTMStack/blob/master/LICENSE"><img src="https://img.shields.io/github/license/ad-aures/castopod?color=blue">
<a href="https://discord.gg/ZznvZ8xcHh"><img src="https://img.shields.io/discord/1154016563775672400.svg?logo=discord">
<a href="https://utmstack.com">
<img src="https://utmstack.com/wp-content/uploads/2023/02/utmstack-logo-favicon.png?v=2" alt="UTMStack" width="150px">
</a>
</p>

<h4 align="center">Enterprise-ready SIEM and XDR powered by Real-Time correlation and Threat Intelligence</h4>
[![Contributors](https://img.shields.io/github/contributors-anon/utmstack/utmstack)](https://github.com/utmstack/UTMStack/graphs/contributors)
[![Release](https://img.shields.io/github/release/utmstack/utmstack)](https://github.com/utmstack/UTMStack/releases/)
[![Issues](https://img.shields.io/github/issues-raw/utmstack/utmstack)](https://github.com/utmstack/UTMStack/issues)
[![Commit Activity](https://img.shields.io/github/commit-activity/m/utmstack/utmstack)](https://github.com/utmstack/UTMStack/commits/main)
[![License](https://img.shields.io/github/license/ad-aures/castopod?color=blue)](https://github.com/utmstack/UTMStack/blob/master/LICENSE)
[![Discord](https://img.shields.io/discord/1154016563775672400.svg?logo=discord)](https://discord.gg/ZznvZ8xcHh)

## Introduction
#### Enterprise-ready SIEM and XDR powered by Real-Time correlation and Threat Intelligence

Welcome to the UTMStack open-source project! UTMStack is a unified threat management platform that merges SIEM (Security Information and Event Management) and XDR (Extended Detection and Response) technologies. Our unique approach allows real-time correlation of log data, threat intelligence, and malware activity patterns from multiple sources, enabling the identification and halting of complex threats that use stealthy techniques. Visit an [online demo here.](https://utmstack.com/demo)
## Introduction

We have a [dedicated repository](https://github.com/utmstack/rules) for correlation rules, contributors are welcome to submit a pull request.
Welcome to the UTMStack open-source project! UTMStack is a unified threat management platform that merges SIEM (Security Information and Event Management) and XDR (Extended Detection and Response) technologies. Our unique approach allows real-time correlation of log data, threat intelligence, and malware activity patterns from multiple sources, enabling the identification and halting of complex threats that use stealthy techniques. Visit an [online demo here.](https://utmstack.com/demo)

<h1 align="center">
<a href="https://utmstack.com"><img src="https://utmstack.com/wp-content/uploads/2023/07/dashboard-two.gif?v=2" width="400px" alt="UTMStack"></a> <a href="https://utmstack.com"><img src="https://utmstack.com/wp-content/uploads/2023/07/dashboard-one.gif?v=2" width="372px" alt="UTMStack"></a> </h1>
<p align="center">
<a href="https://utmstack.com">
<img src="https://utmstack.com/wp-content/uploads/2023/07/dashboard-two.gif?v=2" alt="UTMStack" width="45%">
</a>
<a href="https://utmstack.com">
<img src="https://utmstack.com/wp-content/uploads/2023/07/dashboard-one.gif?v=2" alt="UTMStack" width="45%">
</a>
</p>

## Features

Expand All @@ -33,7 +38,6 @@ We have a [dedicated repository](https://github.com/utmstack/rules) for correla
- SOC AI-Powered Analysis
- Security Compliance


## Why UTMStack?

UTMStack stands out in threat prevention by surpassing the boundaries of traditional systems. Our software platform can swiftly analyze log data to identify and halt threats at their source in real-time, even if the threat was not directly detected on the server itself. This seamless integration of SIEM and XDR capabilities sets UTMStack apart from competitors, providing organizations with an effective, holistic cybersecurity suite that enhances threat detection, response, and remediation across clients’ valuable digital infrastructure. Correlation happens before data ingestion, reducing workload and improving response times.
Expand Down Expand Up @@ -80,7 +84,7 @@ Definitions:
- Cold log storage: archived data that should be restored before accessing it.
- Data source: any individual source of logs, for example, devices, agents, SaaS integrations.

Resources needed for one month of hot log storage.
Required resources for one month of hot log storage.
- For 50 data sources (120 GB) of hot log storage you will need 4 Cores, 16 GB RAM, 150 GB Disk Space
- For 120 data sources (250 GB) of hot log storage you will need 8 Cores, 16 GB RAM, 250 GB Disk Space
- For 240 data sources (500 GB) of hot log storage you will need 16 Cores, 32 GB RAM, 500 GB Disk Space
Expand Down Expand Up @@ -109,16 +113,16 @@ Once UTMStack is installed, use admin as the user and the password generated dur
Note: Use HTTPS in front of your server name or IP to access the login page.

### Required ports
- 22/TCP Secure Shell (We recommend to create a firewall rule to allow it only from admin workstation)
- 80/TCP UTMStack Web-based Graphical User Interface Redirector (We recommend to create a firewall rule to allow it only from admin and security analyst workstations)
- 443/TCP UTMStack Web-based Graphical User Interface (We recommend to create a firewall rule to allow it only from admin and security analyst workstations)
- 9090/TCP Cockpit Web-based Graphical Interface for Servers (We recommend to create a firewall rule to allow it only from admin workstation)
- Others ports will be required during the configuration of UTMStack's integrations in order to receive logs. (Please follow the security recommendations given on the integration guide if exists)
- 22/TCP Secure Shell (We recommend creating a firewall rule to allow it only from admins workstations)
- 80/TCP UTMStack Web-based Graphical User Interface Redirector (We recommend creating a firewall rule to allow it only from admin and security analyst workstations)
- 443/TCP UTMStack Web-based Graphical User Interface (We recommend creating a firewall rule to allow it only from admin and security analyst workstations)
- 9090/TCP Cockpit Web-based Graphical Interface for Servers (We recommend creating a firewall rule to allow it only from admin workstation)
- Others ports will be required during the configuration of UTMStack's integrations to receive logs. (Please follow the security recommendations given on the integration guide if exists)

# FAQ
- Is this based on Grafana, Kibana, or a similar reporting tool?
Answer: It is not. UTMStack has been built from the ground up to be a simple and intuitive SIEM/XDR.
- Does UTMStack use ELK for log correlation?
Answer: It does not. UTMStack correlation engine was built from scratch to analyze data before ingestion and maximize real-time correlation.
- What is the difference between the Open Source and Enterprise version?
- What is the difference between the Open Source and Enterprise versions?
The enterprise version includes features that would typically benefit enterprises and MSPs. For example, support, faster correlation, frequent threat intelligence updates, and Artificial Intelligence.
5 changes: 3 additions & 2 deletions agent/updater/utils/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ func DownloadFile(url string, headers map[string]string, fileName string, path s
req.Header.Add(key, value)
}

client := &http.Client{}
client.Transport = &http.Transport{
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: skipTlsVerification},
DisableCompression: true,
}
client := &http.Client{Transport: tr}
defer tr.CloseIdleConnections()

resp, err := client.Do(req)
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions agent/utils/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ func DownloadFile(url string, headers map[string]string, fileName string, path s
req.Header.Add(key, value)
}

client := &http.Client{}
client.Transport = &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: skipTlsVerification},
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: skipTlsVerification},
DisableCompression: true,
}
client := &http.Client{Transport: tr}
defer tr.CloseIdleConnections()

resp, err := client.Do(req)
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions agent/utils/req.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ func DoReq[response any](url string, data []byte, method string, headers map[str
req.Header.Add(k, v)
}

client := &http.Client{}
client.Transport = &http.Transport{
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: skipTlsVerification},
}
client := &http.Client{Transport: tr}
defer tr.CloseIdleConnections()

resp, err := client.Do(req)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions agent/version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "11.1.1",
"updater_version": "1.0.0"
"version": "11.1.3",
"updater_version": "1.0.2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public OpenAPI customOpenAPI() {
.addList(securitySchemeApiInternalKey)
.addList(securitySchemeApiKey))
.components(new Components()
.addSecuritySchemes(securitySchemeBearer,
/*.addSecuritySchemes(securitySchemeBearer,
new SecurityScheme()
.name(securitySchemeBearer)
.type(SecurityScheme.Type.HTTP)
Expand All @@ -43,7 +43,7 @@ public OpenAPI customOpenAPI() {
.addSecuritySchemes(securitySchemeApiInternalKey, new SecurityScheme()
.name("Utm-Internal-Key")
.type(SecurityScheme.Type.APIKEY)
.in(SecurityScheme.In.HEADER))
.in(SecurityScheme.In.HEADER))*/
.addSecuritySchemes(securitySchemeApiKey, new SecurityScheme()
.name(Constants.API_KEY_HEADER)
.type(SecurityScheme.Type.APIKEY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -44,7 +45,7 @@ public RestTemplate rawRestTemplate() {
RestTemplate rest = new RestTemplate();
rest.setErrorHandler(new DefaultResponseErrorHandler() {
@Override
public boolean hasError(ClientHttpResponse response) {
public boolean hasError(@NotNull ClientHttpResponse response) {
return false;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public boolean isValid(GroupConfigurationDTO dto, ConstraintValidatorContext con
return module.validateConfiguration(utmModule, dto.getKeys());
} catch (Exception e) {
context.disableDefaultConstraintViolation();
context.buildConstraintViolationWithTemplate("Invalid configuration for selected module.")
context.buildConstraintViolationWithTemplate(e.getMessage())
.addPropertyNode("keys")
.addConstraintViolation();
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,19 @@ public interface UtmDataInputStatusRepository extends JpaRepository<UtmDataInput
* Extract data sources that are not already configured
* @return A list of ${@link UtmDataInputStatus}
*/
@Query("select distinct ds.dataType from UtmDataInputStatus ds where ds.dataType not in (select dt.dataType from UtmDataTypes dt) and ds.dataType != :dataType")

@Query("""
select distinct lower(trim(ds.dataType))
from UtmDataInputStatus ds
where lower(trim(ds.dataType)) not in (
select lower(trim(dt.dataType)) from UtmDataTypes dt
)
and lower(trim(ds.dataType)) != lower(trim(:dataType))
""")
List<String> findDataSourcesToConfigure(@Param("dataType") String dataType);



Optional<UtmDataInputStatus> findByDataType(String dataType);
Optional<UtmDataInputStatus> findBySourceAndDataType(String source, String dataType);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,14 @@ private Map<String, StatisticDocument> getLatestStatisticsByDataSource() {
}
});

Instant lastTimestamp = result.values().stream()
Optional<Instant> maybeLastTimestamp = result.values().stream()
.map(doc -> Instant.parse(doc.getTimestamp()))
.max(Instant::compareTo)
.orElse(Instant.now());
.max(Instant::compareTo);

checkpoint.setLastProcessedTimestamp(lastTimestamp);

this.checkpointRepository.save(checkpoint);
if (maybeLastTimestamp.isPresent()) {
checkpoint.setLastProcessedTimestamp(maybeLastTimestamp.get());
this.checkpointRepository.save(checkpoint);
}

return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public UtmModule updateConfigurationKeys(Long moduleId, List<UtmModuleGroupConfi
for (UtmModuleGroupConfiguration key : keys) {
if (key.getConfRequired() && !StringUtils.hasText(key.getConfValue()))
throw new Exception(String.format("No value was found for required configuration: %1$s (%2$s)", key.getConfName(), key.getConfKey()));
if (key.getConfDataType().equals("password"))
if (key.getConfDataType().equals("password") || key.getConfDataType().equals("file"))
key.setConfValue(CipherUtil.encrypt(key.getConfValue(), System.getenv(Constants.ENV_ENCRYPTION_KEY)));
}
moduleConfigurationRepository.saveAll(keys);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import java.time.Instant;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Optional;
Expand Down Expand Up @@ -128,7 +129,10 @@ private void enableDisableModuleFilter(ModuleName nameShort, Boolean activationS
if ((!activationStatus && moduleInstancesActives > 0) || (activationStatus && moduleInstancesActives > 1))
return;

filters.forEach(filter -> filter.setActive(activationStatus));
filters.forEach(filter -> {
filter.setActive(activationStatus);
filter.setUpdatedAt(Instant.now());
});
logstashFilterService.saveAll(filters);
} else {
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.park.utmstack.service.application_modules.connectors;

import com.fasterxml.jackson.databind.JsonNode;
import com.park.utmstack.config.Constants;
import com.park.utmstack.service.dto.application_modules.ModuleConfigValidationErrorMapper;
import com.park.utmstack.service.dto.application_modules.ModuleConfigValidationErrorResponse;
import com.park.utmstack.service.dto.application_modules.UtmModuleGroupConfWrapperDTO;
import com.park.utmstack.service.web_clients.rest_template.RestTemplateService;
import com.park.utmstack.util.exceptions.ApiException;
Expand All @@ -24,44 +27,61 @@ public class ModuleConfigurationValidationService {

public boolean validateModuleConfiguration(String module, UtmModuleGroupConfWrapperDTO configurations) {
final String ctx = CLASSNAME + ".ModuleConfigurationValidationService";

HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
headers.add("Accept", "*/*");
headers.set(Constants.EVENT_PROCESSOR_INTERNAL_KEY_HEADER, System.getenv(Constants.ENV_INTERNAL_KEY));

String baseUrl = "http://" + System.getenv(Constants.ENV_EVENT_PROCESSOR_HOST) + ":" + System.getenv(Constants.ENV_EVENT_PROCESSOR_PORT);
String baseUrl = "http://" + System.getenv(Constants.ENV_EVENT_PROCESSOR_HOST) + ":" + System.getenv(Constants.ENV_EVENT_PROCESSOR_PORT);
String endPoint = baseUrl + "/api/v1/modules-config/validate?nameShort=" + module;
try{
ResponseEntity<String> response = restTemplateService.post(
endPoint,
configurations,
String.class,
headers
);

if (!response.getStatusCode().is2xxSuccessful()) {
List<String> errors = response.getHeaders().get("X-UtmStack-error");
String errorMessage = (errors != null && !errors.isEmpty())
? String.join(", ", errors)
: "Unknown error occurred during module configuration validation.";

log.error("{}: Module configuration validation failed for module: {} with status: {}. Cause: {}",
ctx, module, response.getStatusCode(), errorMessage);
throw new ApiException(
String.format("Module configuration validation failed for module: %s. Cause: %s", module, errorMessage),
response.getStatusCode()
);

ResponseEntity<JsonNode> response = restTemplateService.postRaw(
endPoint,
configurations,
JsonNode.class,
headers
);

JsonNode body = response.getBody();

if (response.getStatusCode().is2xxSuccessful() && body != null && body.has("status")) {
return true;
}

if (body != null && body.has("error")) {
String errorText = body.get("error").asText();

if (errorText.contains("{\"meta\"")) {
ModuleConfigValidationErrorResponse structured = ModuleConfigValidationErrorMapper.parse(errorText);

if (structured != null) {
String traceId = structured.getMeta().getTraceId();
String message = structured.getErrors().get(0).getMessage();

log.error("{}: External provider validation failed for module {}. TraceId: {}. Message: {}",
ctx, module, traceId, message);

throw new ApiException(
"External provider validation failed: " + message + " (traceId=" + traceId + ")",
HttpStatus.UNAUTHORIZED
);
}
}

return true;
log.error("{}: Module configuration validation failed for module {}. Cause: {}",
ctx, module, errorText);

} catch (ApiException e) {
throw e;
} catch (Exception e) {
log.error("{}: An error occurred while validating module configuration for module: {}. Cause: {}",
ctx, module, e.getMessage(), e);
throw new ApiException("An error occurred while validating module configuration", HttpStatus.INTERNAL_SERVER_ERROR);
throw new ApiException(errorText, HttpStatus.BAD_REQUEST);
}

log.error("{}: Unexpected response validating module {}.", ctx, module);
throw new ApiException(
String.format("%s: Unexpected response validating module %s.", ctx, module),
HttpStatus.INTERNAL_SERVER_ERROR
);
}


}

Loading
Loading