Skip to content

Commit 26a7bc9

Browse files
committed
Merge branch 'release/v10.8.1' of https://github.com/utmstack/UTMStack into release/v10.8.1
2 parents e7456b8 + 3104a3d commit 26a7bc9

33 files changed

Lines changed: 391 additions & 85 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@
55
- Added support for RedHat; UTMStack can now be installed on both Ubuntu and RedHat.
66
- Improved log delivery from ARM-based agents on Windows, now sending native system logs.
77
- Added support for macOS ARM64; agents can now be installed on that platform.
8-
- Improved agent information displayed in the Sources panel, providing more accurate OS details and agent versions.
8+
- Improved agent information displayed in the Sources panel, providing more accurate OS details and agent versions.
9+
10+
11+
### Bug Fixes
12+
-- Compliance Report Scheduling: Improved the stability of the selection process when creating new report schedules.
13+
-- Improved field rendering in Log Explorer by consolidating list-based fields into a single entry for better readability and consistency.
14+
-- Improved field rendering for tags and note fields in Alerts.

aws/configuration/const.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package configuration
33
import "github.com/utmstack/UTMStack/aws/utils"
44

55
const (
6-
CORRELATIONURL = "http://correlation:8080/v1/newlog"
76
URL_CHECK_CONNECTION = "https://sts.amazonaws.com"
7+
LogstashEndpoint = "http://%s:%s"
8+
UTMLogSeparator = "<utm-log-separator>"
89
)
910

1011
func GetInternalKey() string {
@@ -14,3 +15,11 @@ func GetInternalKey() string {
1415
func GetPanelServiceName() string {
1516
return utils.Getenv("PANEL_SERV_NAME")
1617
}
18+
19+
func GetLogstashHost() string {
20+
return utils.Getenv("UTM_LOGSTASH_HOST")
21+
}
22+
23+
func GetLogstashPort() string {
24+
return utils.Getenv("UTM_LOGSTASH_PORT")
25+
}

aws/processor/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func PullLogs(startTime time.Time, endTime time.Time, group types.ModuleGroup) *
1818
return err
1919
}
2020

21-
err = SendToCorrelation(logs)
21+
err = SendToLogstash(logs)
2222
if err != nil {
2323
return err
2424
}

aws/processor/sendData.go

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,71 @@
11
package processor
22

33
import (
4+
"bytes"
5+
"crypto/tls"
46
"encoding/json"
7+
"fmt"
58
"net/http"
9+
"strings"
10+
"time"
611

712
"github.com/threatwinds/logger"
813
"github.com/utmstack/UTMStack/aws/configuration"
914
"github.com/utmstack/UTMStack/aws/utils"
1015
)
1116

12-
func SendToCorrelation(data []TransformedLog) *logger.Error {
17+
var transport = &http.Transport{
18+
MaxIdleConns: 100,
19+
IdleConnTimeout: 2 * time.Second,
20+
ResponseHeaderTimeout: 2 * time.Second,
21+
ForceAttemptHTTP2: true,
22+
TLSClientConfig: &tls.Config{
23+
InsecureSkipVerify: true,
24+
},
25+
}
26+
27+
var client = &http.Client{Transport: transport, Timeout: 2 * time.Second}
28+
29+
func SendToLogstash(data []TransformedLog) *logger.Error {
30+
var logStrings []string
1331
for _, log := range data {
1432
body, err := json.Marshal(log)
1533
if err != nil {
1634
utils.Logger.ErrorF("error encoding log to JSON: %v", err)
1735
continue
1836
}
37+
logStrings = append(logStrings, string(body))
38+
}
1939

20-
_, status, e := utils.DoReq[map[string]interface{}](configuration.CORRELATIONURL, body, http.MethodPost, map[string]string{})
21-
if e != nil {
22-
utils.Logger.ErrorF("error sending log to correlation engine: %v", e)
23-
continue
24-
} else if status != http.StatusOK && status != http.StatusCreated {
25-
utils.Logger.ErrorF("error sending log to correlation engine: status %v", status)
26-
continue
40+
if len(logStrings) == 0 {
41+
return nil
42+
}
43+
44+
var logs string
45+
for _, str := range logStrings {
46+
logs += str + configuration.UTMLogSeparator
47+
}
48+
49+
url := fmt.Sprintf(configuration.LogstashEndpoint, configuration.GetLogstashHost(), configuration.GetLogstashPort())
50+
51+
req, err := http.NewRequest("POST", url, bytes.NewBufferString(logs))
52+
if err != nil {
53+
return utils.Logger.ErrorF("error creating request: %v", err.Error())
54+
}
55+
56+
resp, err := client.Do(req)
57+
if err != nil {
58+
if !strings.Contains(err.Error(), "Client.Timeout exceeded while awaiting headers") {
59+
utils.Logger.ErrorF("error sending logs with error: %v", err.Error())
2760
}
61+
return utils.Logger.ErrorF("error sending logs: %v", err.Error())
62+
}
63+
defer resp.Body.Close()
2864

65+
if resp.StatusCode != http.StatusOK {
66+
return utils.Logger.ErrorF("error sending logs with http code %d", resp.StatusCode)
2967
}
3068

69+
utils.Logger.Info("successfully sent %d logs to Logstash", len(logStrings))
3170
return nil
3271
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
6+
7+
<changeSet id="20250507001" author="Manuel">
8+
<sql dbms="postgresql" splitStatements="true" stripComments="true">
9+
10+
INSERT INTO utm_logstash_pipeline (id, pipeline_id, pipeline_name, parent_pipeline, pipeline_status, module_name, system_owner, pipeline_description, pipeline_internal, events_in, events_filtered, events_out, reloads_successes, reloads_failures, reloads_last_failure_timestamp, reloads_last_error, reloads_last_success_timestamp)
11+
VALUES (55, 'aws', 'AWS', null, 'up', 'AWS', true, null, false, 0, 0, 0, 0, 0, null, null, null);
12+
13+
INSERT INTO utm_group_logstash_pipeline_filters (filter_id, pipeline_id, relation)
14+
VALUES (101, 55, 'PIPELINE_FILTER');
15+
16+
INSERT INTO utm_logstash_input (id, pipeline_id, input_pretty_name, input_plugin, input_with_ssl, system_owner)
17+
VALUES (68, 55, 'HTTP', 'http', false, true);
18+
19+
INSERT INTO utm_logstash_input_configuration (id, input_id, conf_key, conf_value, conf_type, conf_required, conf_validation_regex, system_owner)
20+
VALUES (68, 68, 'http_port', '10048', 'port', true, '^((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$', true);
21+
22+
23+
</sql>
24+
</changeSet>
25+
</databaseChangeLog>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
6+
7+
<changeSet id="20250507002" author="Manuel">
8+
<sql dbms="postgresql" splitStatements="true" stripComments="true">
9+
10+
INSERT INTO utm_logstash_pipeline (id, pipeline_id, pipeline_name, parent_pipeline, pipeline_status, module_name, system_owner, pipeline_description, pipeline_internal, events_in, events_filtered, events_out, reloads_successes, reloads_failures, reloads_last_failure_timestamp, reloads_last_error, reloads_last_success_timestamp)
11+
VALUES (56, 'sophos-central', 'Sophos Central', null, 'up', 'AWS', true, null, false, 0, 0, 0, 0, 0, null, null, null);
12+
13+
INSERT INTO utm_group_logstash_pipeline_filters (filter_id, pipeline_id, relation)
14+
VALUES (102, 56, 'PIPELINE_FILTER');
15+
16+
INSERT INTO utm_logstash_input (id, pipeline_id, input_pretty_name, input_plugin, input_with_ssl, system_owner)
17+
VALUES (69, 56, 'HTTP', 'http', false, true);
18+
19+
INSERT INTO utm_logstash_input_configuration (id, input_id, conf_key, conf_value, conf_type, conf_required, conf_validation_regex, system_owner)
20+
VALUES (69, 69, 'http_port', '10049', 'port', true, '^((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$', true);
21+
22+
23+
24+
</sql>
25+
</changeSet>
26+
</databaseChangeLog>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
6+
7+
<changeSet id="20250507003" author="Manuel">
8+
<sql dbms="postgresql" splitStatements="true" stripComments="true">
9+
10+
INSERT INTO utm_logstash_pipeline (id, pipeline_id, pipeline_name, parent_pipeline, pipeline_status, module_name, system_owner, pipeline_description, pipeline_internal, events_in, events_filtered, events_out, reloads_successes, reloads_failures, reloads_last_failure_timestamp, reloads_last_error, reloads_last_success_timestamp)
11+
VALUES (57, 'o365', 'Office 365', null, 'up', 'AWS', true, null, false, 0, 0, 0, 0, 0, null, null, null);
12+
13+
INSERT INTO utm_group_logstash_pipeline_filters (filter_id, pipeline_id, relation)
14+
VALUES (103, 57, 'PIPELINE_FILTER');
15+
16+
INSERT INTO utm_logstash_input (id, pipeline_id, input_pretty_name, input_plugin, input_with_ssl, system_owner)
17+
VALUES (70, 57, 'HTTP', 'http', false, true);
18+
19+
INSERT INTO utm_logstash_input_configuration (id, input_id, conf_key, conf_value, conf_type, conf_required, conf_validation_regex, system_owner)
20+
VALUES (70, 70, 'http_port', '10050', 'port', true, '^((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$', true);
21+
22+
23+
24+
</sql>
25+
</changeSet>
26+
</databaseChangeLog>

backend/src/main/resources/config/liquibase/master.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,11 @@
9191

9292
<include file="/config/liquibase/changelog/20250418001_add_options_module_group_config.xml" relativeToChangelogFile="false"/>
9393

94+
<include file="/config/liquibase/changelog/20250507001_add_aws_pipeline.xml" relativeToChangelogFile="false"/>
95+
96+
<!--<include file="/config/liquibase/changelog/20250507002_add_sophos_central_pipeline.xml" relativeToChangelogFile="false"/>
97+
98+
<include file="/config/liquibase/changelog/20250507003_add_o365_pipeline.xml" relativeToChangelogFile="false"/>-->
99+
94100

95101
</databaseChangeLog>

frontend/src/app/app-module/guides/guide-macos-agent/guide-macos-agent.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h4 class="card-title mb-0 text-primary">
2121
<div [innerHtml]="step.name"></div>
2222
<ng-container *ngIf="step.content">
2323

24-
<ng-template [ngIf]="step.content.id === 'stepContent2'">
24+
<ng-template [ngIf]="step.content.id === 'stepContent3'">
2525
<app-agent-install-selector [platforms]="architectures" [_selectedPlatform]="architectures[0]"></app-agent-install-selector>
2626
</ng-template>
2727
</ng-container>

frontend/src/app/app-module/guides/guide-macos-agent/guide-macos-agent.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ export class GuideMacosAgentComponent implements OnInit {
4242
getCommandARM(installerName: string): string {
4343
const ip = window.location.host.includes(':') ? window.location.host.split(':')[0] : window.location.host;
4444

45-
return `sudo bash -c "./${installerName} ${ip} <secret>${this.token}</secret> yes"`;
45+
return `sudo bash -c "/opt/utmstack/${installerName} ${ip} <secret>${this.token}</secret> yes"`;
4646
}
4747

4848

4949
getUninstallCommand(installerName: string): string {
50-
return `sudo bash -c "./utmstack_agent_service uninstall"`;
50+
// tslint:disable-next-line:max-line-length
51+
return `sudo bash -c "/opt/utmstack/${installerName} uninstall; launchctl bootout system /Library/LaunchDaemons/UTMStackAgent.plist 2>/dev/null; rm /Library/LaunchDaemons/UTMStackAgent.plist; rm -rf /opt/utmstack"`;
5152
}
5253

54+
5355
private loadArchitectures() {
5456
this.architectures = [
5557
{

0 commit comments

Comments
 (0)