Skip to content

Commit f23aab5

Browse files
committed
Merge branch 'release/v10.8.1' of github.com:utmstack/UTMStack into release/v10.8.1
2 parents eb3ea52 + db73c5b commit f23aab5

27 files changed

Lines changed: 294 additions & 72 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.

agent/collectors/macos.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package collectors
55

66
import (
77
"bufio"
8+
"os"
89
"os/exec"
910
"path/filepath"
1011

@@ -29,6 +30,11 @@ func getCollectorsInstances() []Collector {
2930
func (d Darwin) SendLogs() {
3031
path := utils.GetMyPath()
3132
collectorPath := filepath.Join(path, "utmstack-collector-mac")
33+
host, err := os.Hostname()
34+
if err != nil {
35+
utils.Logger.ErrorF("error getting hostname: %v", err)
36+
host = "unknown"
37+
}
3238

3339
cmd := exec.Command(collectorPath)
3440

@@ -62,9 +68,11 @@ func (d Darwin) SendLogs() {
6268
continue
6369
}
6470

71+
messageWithHost := config.GetMessageFormated(host, validatedLog)
72+
6573
logservice.LogQueue <- logservice.LogPipe{
6674
Src: string(config.DataTypeMacOs),
67-
Logs: []string{validatedLog},
75+
Logs: []string{messageWithHost},
6876
}
6977
}
7078

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
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393

9494
<include file="/config/liquibase/changelog/20250507001_add_aws_pipeline.xml" relativeToChangelogFile="false"/>
9595

96-
<include file="/config/liquibase/changelog/20250507002_add_sophos_central_pipeline.xml" relativeToChangelogFile="false"/>
96+
<!--<include file="/config/liquibase/changelog/20250507002_add_sophos_central_pipeline.xml" relativeToChangelogFile="false"/>
9797
98-
<include file="/config/liquibase/changelog/20250507003_add_o365_pipeline.xml" relativeToChangelogFile="false"/>
98+
<include file="/config/liquibase/changelog/20250507003_add_o365_pipeline.xml" relativeToChangelogFile="false"/>-->
9999

100100

101101
</databaseChangeLog>

frontend/src/app/compliance/compliance-schedule/compliance-schedule.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import {
1818
UtmComplianceScheduleDeleteComponent
1919
} from '../shared/components/utm-compliance-schedule-delete/utm-compliance-schedule-delete.component';
2020
import {ComplianceScheduleService} from '../shared/services/compliance-schedule.service';
21+
import {CronDescriptionGeneratorService} from '../shared/services/cron-description-generator.service';
2122
import {ComplianceScheduleFilterType} from '../shared/type/compliance-schedule-filter.type';
2223
import {ComplianceScheduleType} from '../shared/type/compliance-schedule.type';
2324
import {ComplianceStandardType} from '../shared/type/compliance-standard.type';
24-
import {CronDescriptionGeneratorService} from "../shared/services/cron-description-generator.service";
2525

2626

2727
@Component({

frontend/src/app/compliance/shared/components/utm-compliance-select/utm-compliance-select.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
placeholder="Standard"
1919
style="width: 50%"
2020
></ng-select>
21-
<ng-select (change)="filterBySelect($event,'type')"
21+
<ng-select (change)="getDashboardList()"
2222
[(ngModel)]="section"
2323
[clearable]="true"
2424
[items]="standardSections"
@@ -47,7 +47,7 @@
4747
class="cursor-pointer text-blue-800 d-flex justify-content-between align-items-center">
4848
<span class="span-small-icon">
4949
<i [ngClass]="idReport === report.id?'icon-radio-checked':'icon-radio-unchecked'"></i>
50-
<span class="text-blue-800 ml-2">{{report.associatedDashboard.name}}</span>
50+
<span class="text-blue-800 ml-2">{{report.configReportName ? report.configReportName :report.associatedDashboard.name}}</span>
5151
</span>
5252
<span class="span-small-icon">
5353
<i *ngIf="report.associatedDashboard.description" [ngbTooltip]="report.associatedDashboard.description"
@@ -80,7 +80,7 @@
8080
</tbody>
8181
</table>
8282
</div>
83-
<div *ngIf="complianceReports && complianceReports.length>0" class="mb-4 mt-2">
83+
<div [hidden]="complianceReports && complianceReports.length === 0" class="mb-4 mt-2">
8484
<div class="row justify-content-center">
8585
<ngb-pagination
8686
(pageChange)="loadPage($event)"

frontend/src/app/compliance/shared/components/utm-compliance-select/utm-compliance-select.component.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class UtmComplianceSelectComponent implements OnInit {
2929
section: number;
3030
loading = true;
3131
totalItems: any;
32-
page = 1;
32+
page = 0;
3333
itemsPerPage = 10;
3434
complianceReports: ComplianceReportType[] = [];
3535
searching = false;
@@ -42,8 +42,8 @@ export class UtmComplianceSelectComponent implements OnInit {
4242

4343
ngOnInit() {
4444
this.requestParams = {
45-
page: this.page - 1,
46-
size: this.itemsPerPage,
45+
page: 0,
46+
size: 1000,
4747
sort: this.sortBy,
4848
'name.contains': null
4949
};
@@ -61,14 +61,14 @@ export class UtmComplianceSelectComponent implements OnInit {
6161
}
6262

6363
loadPage(page: any) {
64-
this.requestParams.page = page - 1;
64+
this.page = page > 0 ? page - 1 : page;
6565
this.getDashboardList();
6666
}
6767

6868
getDashboardList() {
6969
const query = {
70-
page: this.page - 1,
71-
size: 1000,
70+
page: this.page,
71+
size: this.itemsPerPage,
7272
sort: 'id,asc',
7373
'standardSectionId.equals': this.section,
7474
'configSolution.contains': this.solution
@@ -81,15 +81,15 @@ export class UtmComplianceSelectComponent implements OnInit {
8181

8282
getSections() {
8383
const query = {
84-
page: this.page - 1,
84+
page: 0,
8585
size: 1000,
8686
sort: 'id,asc',
8787
'standardId.equals': this.standard,
8888
'standardSectionName.contains': this.solution
8989
};
9090
this.cpStandardSectionService.query(query).subscribe(response => {
9191
this.standardSections = response.body;
92-
this.section = !!this.section ? this.section : this.standardSections[0].id;
92+
this.section = this.standardSections.length > 0 ? this.standardSections[0].id : null;
9393
this.getDashboardList();
9494
if (this.idReport) {
9595
this.getSelectedDashboard(this.idReport);
@@ -98,7 +98,8 @@ export class UtmComplianceSelectComponent implements OnInit {
9898
}
9999

100100
getStandardList() {
101-
this.cpStandardService.query({page: 0, size: 1000}).subscribe(
101+
this.cpStandardService.query({page: 0, size: 1000})
102+
.subscribe(
102103
(res: HttpResponse<any>) => {
103104
this.standards = res.body;
104105
this.standard = !!this.standard ? this.standard : this.standards[0].id;

frontend/src/app/data-management/alert-management/alert-view/alert-view.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ <h5 class="card-title mb-0 text-uppercase label-header">
160160
*ngIf="(td.visible)">
161161
<app-data-field-render (refreshData)="onRefreshData($event)" [data]="alert"
162162
[field]="td"
163+
[tags]="tags"
163164
[dataType]="dataType"
164165
[showStatusChange]="true"></app-data-field-render>
165166
</td>

0 commit comments

Comments
 (0)