Skip to content

Commit bf386ad

Browse files
committed
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v11.2.1
2 parents e9b4112 + 0e6bb01 commit bf386ad

File tree

69 files changed

+896
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+896
-243
lines changed

.github/workflows/v11-deployment-pipeline.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
name: Check Go Dependencies
120120
runs-on: ubuntu-24.04
121121
needs: [validations, setup_deployment]
122-
if: ${{ needs.setup_deployment.outputs.tag != '' && needs.setup_deployment.outputs.environment == 'rc' }}
122+
if: ${{ needs.setup_deployment.outputs.environment == 'rc' }}
123123
steps:
124124
- name: Check out code
125125
uses: actions/checkout@v4
@@ -228,7 +228,7 @@ jobs:
228228
build_agent_manager:
229229
name: Build Agent Manager Microservice
230230
needs: [build_agent, build_utmstack_collector, setup_deployment]
231-
if: ${{ needs.setup_deployment.outputs.tag != '' }}
231+
if: ${{ always() && needs.build_agent.result == 'success' && needs.build_utmstack_collector.result == 'success' && needs.setup_deployment.outputs.tag != '' }}
232232
runs-on: ubuntu-24.04
233233
steps:
234234
- name: Check out code into the right branch
@@ -399,6 +399,7 @@ jobs:
399399
build_user_auditor,
400400
build_web_pdf
401401
]
402+
if: ${{ always() && needs.build_agent_manager.result == 'success' && needs.build_event_processor.result == 'success' && needs.build_backend.result == 'success' && needs.build_frontend.result == 'success' && needs.build_user_auditor.result == 'success' && needs.build_web_pdf.result == 'success' }}
402403
runs-on: ubuntu-24.04
403404
steps:
404405
- run: echo "✅ All builds completed successfully."
@@ -432,7 +433,7 @@ jobs:
432433
deploy_installer_dev:
433434
name: Deploy Installer (Dev)
434435
needs: [all_builds_complete, setup_deployment]
435-
if: ${{ needs.setup_deployment.outputs.tag != '' && needs.setup_deployment.outputs.environment == 'dev' }}
436+
if: ${{ always() && needs.all_builds_complete.result == 'success' && needs.setup_deployment.outputs.tag != '' && needs.setup_deployment.outputs.environment == 'dev' }}
436437
uses: ./.github/workflows/installer-release.yml
437438
with:
438439
version: ${{ needs.setup_deployment.outputs.tag }}

agent-manager/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ require (
4444
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4545
github.com/modern-go/reflect2 v1.0.2 // indirect
4646
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
47-
github.com/threatwinds/go-sdk v1.1.4
47+
github.com/threatwinds/go-sdk v1.1.7
4848
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
4949
github.com/ugorji/go/codec v1.3.1 // indirect
5050
golang.org/x/arch v0.23.0 // indirect

agent-manager/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
8989
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
9090
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
9191
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
92-
github.com/threatwinds/go-sdk v1.1.4 h1:RASWY7333hFHqUl5oVDeLrBdS+cOMehZyTUgl/dZfPg=
93-
github.com/threatwinds/go-sdk v1.1.4/go.mod h1:N19iqJPaNAoWwZTCuFvV0hIvT0D1jOR1KkKYgAoPLmw=
92+
github.com/threatwinds/go-sdk v1.1.7 h1:2IJAWTCxZU4BDFiavPjH8MqpA/mam1QyIsjySbZLlRo=
93+
github.com/threatwinds/go-sdk v1.1.7/go.mod h1:N19iqJPaNAoWwZTCuFvV0hIvT0D1jOR1KkKYgAoPLmw=
9494
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
9595
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
9696
github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY=

agent/go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/google/uuid v1.6.0
1010
github.com/kardianos/service v1.2.4
1111
github.com/tehmaze/netflow v0.0.0-20240303214733-8c13bb004068
12-
github.com/threatwinds/go-sdk v1.1.4
12+
github.com/threatwinds/go-sdk v1.1.7
1313
github.com/threatwinds/logger v1.2.3
1414
golang.org/x/sys v0.40.0
1515
google.golang.org/grpc v1.78.0
@@ -48,6 +48,7 @@ require (
4848
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4949
github.com/modern-go/reflect2 v1.0.2 // indirect
5050
github.com/ncruces/go-strftime v1.0.0 // indirect
51+
github.com/opensearch-project/opensearch-go/v4 v4.6.0 // indirect
5152
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
5253
github.com/prometheus/procfs v0.19.2 // indirect
5354
github.com/quic-go/qpack v0.6.0 // indirect

agent/go.sum

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
8787
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
8888
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
8989
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
90+
github.com/opensearch-project/opensearch-go/v4 v4.6.0 h1:Ac8aLtDSmLEyOmv0r1qhQLw3b4vcUhE42NE9k+Z4cRc=
91+
github.com/opensearch-project/opensearch-go/v4 v4.6.0/go.mod h1:3iZtb4SNt3IzaxavKq0dURh1AmtVgYW71E4XqmYnIiQ=
9092
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
9193
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
9294
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -119,8 +121,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
119121
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
120122
github.com/tehmaze/netflow v0.0.0-20240303214733-8c13bb004068 h1:1B+EAUqxEyPByCfk55tB21DtR7WF7Q2w71g7+uVkvIg=
121123
github.com/tehmaze/netflow v0.0.0-20240303214733-8c13bb004068/go.mod h1:QRP5wJOf7gGMGL2fCAfmh/5CMZQspRxT5DqghaPRrjM=
122-
github.com/threatwinds/go-sdk v1.1.4 h1:RASWY7333hFHqUl5oVDeLrBdS+cOMehZyTUgl/dZfPg=
123-
github.com/threatwinds/go-sdk v1.1.4/go.mod h1:N19iqJPaNAoWwZTCuFvV0hIvT0D1jOR1KkKYgAoPLmw=
124+
github.com/threatwinds/go-sdk v1.1.7 h1:2IJAWTCxZU4BDFiavPjH8MqpA/mam1QyIsjySbZLlRo=
125+
github.com/threatwinds/go-sdk v1.1.7/go.mod h1:N19iqJPaNAoWwZTCuFvV0hIvT0D1jOR1KkKYgAoPLmw=
124126
github.com/threatwinds/logger v1.2.3 h1:V2SVAXzbq+/huCvIWOfqzMTH+WBHJxankyBgVG2hy1Y=
125127
github.com/threatwinds/logger v1.2.3/go.mod h1:N+bJKvF4FQNJZLfQpVYWpr6D8iEAFnAQfHYqH5iR1TI=
126128
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
@@ -131,10 +133,14 @@ github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JT
131133
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
132134
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
133135
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
136+
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
137+
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
134138
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
135139
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
136140
github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY=
137141
github.com/ugorji/go/codec v1.3.1/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
142+
github.com/wI2L/jsondiff v0.7.0 h1:1lH1G37GhBPqCfp/lrs91rf/2j3DktX6qYAKZkLuCQQ=
143+
github.com/wI2L/jsondiff v0.7.0/go.mod h1:KAEIojdQq66oJiHhDyQez2x+sRit0vIzC9KeK0yizxM=
138144
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
139145
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
140146
go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=

agent/updater/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.25.5
44

55
require (
66
github.com/kardianos/service v1.2.4
7-
github.com/threatwinds/go-sdk v1.1.4
7+
github.com/threatwinds/go-sdk v1.1.7
88
github.com/threatwinds/logger v1.2.3
99
gopkg.in/yaml.v3 v3.0.1
1010
)

agent/updater/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
7474
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
7575
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
7676
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
77-
github.com/threatwinds/go-sdk v1.1.4 h1:RASWY7333hFHqUl5oVDeLrBdS+cOMehZyTUgl/dZfPg=
78-
github.com/threatwinds/go-sdk v1.1.4/go.mod h1:N19iqJPaNAoWwZTCuFvV0hIvT0D1jOR1KkKYgAoPLmw=
77+
github.com/threatwinds/go-sdk v1.1.7 h1:2IJAWTCxZU4BDFiavPjH8MqpA/mam1QyIsjySbZLlRo=
78+
github.com/threatwinds/go-sdk v1.1.7/go.mod h1:N19iqJPaNAoWwZTCuFvV0hIvT0D1jOR1KkKYgAoPLmw=
7979
github.com/threatwinds/logger v1.2.3 h1:V2SVAXzbq+/huCvIWOfqzMTH+WBHJxankyBgVG2hy1Y=
8080
github.com/threatwinds/logger v1.2.3/go.mod h1:N+bJKvF4FQNJZLfQpVYWpr6D8iEAFnAQfHYqH5iR1TI=
8181
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=

frontend/src/app/dashboard/compliance-export/compliance-export.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</div>
1919

2020

21-
<div *ngIf="!preparingPrint" class="report-loading"></div>
21+
<div *ngIf="!preparingPrint" class="report-loaded"></div>
2222
<div class="d-flex justify-content-center align-items-start w-100 m-0 d-print-block">
2323
<div class="compliance-front-page">
2424

frontend/src/app/dashboard/dashboard-export-pdf/dashboard-export-pdf.component.ts

Lines changed: 86 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import {AfterViewInit, ChangeDetectorRef, Component, OnInit} from '@angular/core';
1+
import {AfterViewInit, ChangeDetectorRef, Component, OnDestroy, OnInit} from '@angular/core';
22
import {DomSanitizer} from '@angular/platform-browser';
33
import {ActivatedRoute} from '@angular/router';
44
import {NgxSpinnerService} from 'ngx-spinner';
5+
import {combineLatest, from, of, Subject} from 'rxjs';
6+
import {filter, map, switchMap, takeUntil, tap} from 'rxjs/operators';
57
import {AccountService} from '../../core/auth/account.service';
68
import {Account} from '../../core/user/account.model';
79
import {DashboardBehavior} from '../../shared/behaviors/dashboard.behavior';
@@ -21,7 +23,7 @@ import {UtmRenderVisualization} from '../shared/services/utm-render-visualizatio
2123
templateUrl: './dashboard-export-pdf.component.html',
2224
styleUrls: ['./dashboard-export-pdf.component.scss']
2325
})
24-
export class DashboardExportPdfComponent implements OnInit, AfterViewInit {
26+
export class DashboardExportPdfComponent implements OnInit, OnDestroy {
2527
dashboardId: number;
2628
dashboardName: string;
2729
visualizationRender: UtmDashboardVisualizationType[];
@@ -36,6 +38,7 @@ export class DashboardExportPdfComponent implements OnInit, AfterViewInit {
3638
filtersValues: ElasticFilterType[] = [];
3739
filterTime: { from: string, to: string };
3840
cover: string;
41+
destroy$ = new Subject<void>();
3942

4043
constructor(private activatedRoute: ActivatedRoute,
4144
private accountService: AccountService,
@@ -48,14 +51,7 @@ export class DashboardExportPdfComponent implements OnInit, AfterViewInit {
4851
private cdr: ChangeDetectorRef) {
4952
}
5053

51-
ngAfterViewInit(): void {
52-
this.cdr.detectChanges();
53-
this.themeChangeBehavior.$themeReportCover.subscribe(img => {
54-
this.cover = img;
55-
});
56-
}
57-
58-
ngOnInit() {
54+
/*ngOnInit() {
5955
this.activatedRoute.queryParams.subscribe(params => {
6056
const queryParams = Object.entries(params).length > 0 ? params : null;
6157
if (queryParams) {
@@ -68,12 +64,7 @@ export class DashboardExportPdfComponent implements OnInit, AfterViewInit {
6864
this.accountService.identity().then(account => {
6965
this.account = account;
7066
});
71-
/*window.addEventListener('beforeprint', (event) => {
72-
this.printFormat = true;
73-
});
74-
window.addEventListener('afterprint', (event) => {
75-
this.printFormat = false;
76-
});*/
67+
7768
this.activatedRoute.params.subscribe(params => {
7869
this.dashboardId = params.id;
7970
if (this.dashboardId) {
@@ -93,8 +84,66 @@ export class DashboardExportPdfComponent implements OnInit, AfterViewInit {
9384
});
9485
}
9586
});
87+
}*/
88+
89+
ngOnInit() {
90+
91+
this.themeChangeBehavior.$themeReportCover
92+
.pipe(takeUntil(this.destroy$))
93+
.subscribe(img => {
94+
this.cover = img;
95+
});
96+
97+
const queryParams$ = this.activatedRoute.queryParams.pipe(
98+
map(params => Object.keys(params).length > 0 ? params : null),
99+
switchMap(params => {
100+
if (!params) { return of(null); }
101+
return from(parseQueryParamsToFilter(params));
102+
}),
103+
tap(filters => {
104+
if (filters && filters.length > 0) {
105+
this.filtersValues = filters;
106+
this.getTimeFilterValue();
107+
}
108+
})
109+
);
110+
111+
const dashboardId$ = this.activatedRoute.params.pipe(
112+
map(params => params.id),
113+
tap(id => this.dashboardId = id)
114+
);
115+
116+
combineLatest([queryParams$, dashboardId$])
117+
.pipe(
118+
filter(([filters, dashboardId]) => !!dashboardId),
119+
switchMap(([filters, dashboardId]) => {
120+
const request = {
121+
page: 0,
122+
size: 10000,
123+
'idDashboard.equals': dashboardId,
124+
sort: 'order,asc'
125+
};
126+
return this.utmRenderVisualization.query(request);
127+
}),
128+
tap(vis => {
129+
const visualizations = vis.body || [];
130+
this.dashboardName = visualizations[0].dashboard.name;
131+
this.dashboardDescription = visualizations[0].dashboard.description;
132+
133+
const filters = JSON.parse(visualizations[0].dashboard.filters);
134+
this.dashboardFilters = filters ? filters : [];
135+
136+
this.applyTimeFilterToVisualizations(visualizations);
137+
138+
this.loadingVisualizations = false;
139+
})
140+
)
141+
.subscribe();
142+
143+
this.accountService.identity().then(account => this.account = account);
96144
}
97145

146+
98147
setVisFilter(): Promise<boolean> {
99148
return new Promise<boolean>(resolve => {
100149
for (const dashFilter of this.getFilterByIndexPattern()) {
@@ -151,7 +200,7 @@ export class DashboardExportPdfComponent implements OnInit, AfterViewInit {
151200
getTimeFilterValue() {
152201
this.filterTime = {
153202
from: this.resolveFromDate(this.getTime()),
154-
to: this.resolveToDate(this.getTime()),
203+
to: this.resolveFromDate(this.getTime()),
155204
};
156205
}
157206

@@ -191,4 +240,24 @@ export class DashboardExportPdfComponent implements OnInit, AfterViewInit {
191240
showFilters(): boolean {
192241
return this.filtersValues.filter(value => value.field !== '@timestamp').length > 0;
193242
}
243+
244+
applyTimeFilterToVisualizations(visualizations: UtmDashboardVisualizationType[]) {
245+
if (!this.filtersValues || this.filtersValues.length === 0) {
246+
this.visualizationRender = visualizations;
247+
return;
248+
}
249+
250+
this.visualizationRender = visualizations.map(v => ({
251+
...v,
252+
visualization: {
253+
...v.visualization,
254+
filterType: [...v.visualization.filterType, ... this.filtersValues]
255+
}
256+
}));
257+
}
258+
259+
ngOnDestroy() {
260+
this.destroy$.next();
261+
this.destroy$.complete();
262+
}
194263
}

frontend/src/app/dashboard/dashboard-render/dashboard-render.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ export class DashboardRenderComponent implements OnInit, OnDestroy, AfterViewIni
177177
exportToPdf() {
178178
filtersToStringParam(this.filtersValues).then(queryParams => {
179179
this.spinner.show('buildPrintPDF');
180-
const url = '/dashboard/export/' + this.dashboard.id + '/' + normalizeString(this.dashboard.name) + '?' + queryParams;
181-
// window.open('/dashboard/export/' + this.dashboardId + '/' + normalizeString(this.dashboard.name) + '?' + queryParams, '_blank');
180+
const safeParams = new URLSearchParams(queryParams).toString();
181+
const url = `/dashboard/export/${this.dashboard.id}/${normalizeString(this.dashboard.name)}?${safeParams}`;
182+
182183
this.exportPdfService.getPdf(url, this.dashboard.name, 'PDF_TYPE_TOKEN').subscribe(response => {
183184
this.spinner.hide('buildPrintPDF').then(() =>
184185
this.exportPdfService.handlePdfResponse(response));

0 commit comments

Comments
 (0)