Skip to content

Commit 8ea7022

Browse files
committed
fea: add tls connection options and setup steps for syslog integrations
Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
1 parent 8d9be89 commit 8ea7022

File tree

2 files changed

+92
-64
lines changed

2 files changed

+92
-64
lines changed

frontend/src/app/app-module/guides/shared/components/log-collector.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class LogCollectorComponent {
7979

8080
const command = replaceCommandTokens(this.selectedPlatform.command, {
8181
PROTOCOL: protocol,
82-
AGENT_NAME: this.agent,
82+
AGENT_NAME: this.agentName(),
8383
ACTION: this.selectedAction && this.selectedAction.action || '',
8484
TLS: this.selectedProtocol && this.selectedProtocol.name === 'TCP/TLS' ? ' --tls' : ''
8585
});

frontend/src/app/app-module/guides/shared/constant.ts

Lines changed: 91 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,109 @@
1+
const WINDOWS_SHELL =
2+
'Run the following PowerShell script as “ADMINISTRATOR” on a server with the UTMStack agent installed.';
3+
4+
const LINUX_SHELL =
5+
'Run the following Bash script as “ADMINISTRATOR” on a server with the UTMStack agent installed.';
6+
17
export interface Platform {
28
id: number;
39
name: string;
410
command: string;
511
shell: string;
6-
path: string;
7-
restart: string;
12+
path?: string;
13+
restart?: string;
14+
extraCommands?: string[];
815
}
916

10-
export const createPlatforms = (windowsCommandAMD64: string,
11-
windowsCommandARM64: string,
12-
linuxCommand: string,
13-
windowsPath?: string,
14-
windowsRestart?: string,
15-
linuxPath?: string,
16-
linuxRestart?: string) => [
17-
{
18-
id: 1,
19-
name: 'WINDOWS (AMD64)',
20-
command: windowsCommandAMD64,
21-
shell: 'Run the following powershell script as “ADMINISTRATOR” in a Server with the UTMStack agent Installed.',
22-
path: windowsPath,
23-
restart: windowsRestart
24-
},
25-
{
26-
id: 2,
27-
name: 'WINDOWS (ARM64)',
28-
command: windowsCommandARM64,
29-
shell: 'Run the following powershell script as “ADMINISTRATOR” in a Server with the UTMStack agent Installed.',
30-
path: windowsPath,
31-
restart: windowsRestart
32-
},
33-
{
34-
id: 3,
35-
name: 'LINUX',
36-
command: linuxCommand,
37-
shell: 'Run the following bash script as “ADMINISTRATOR” in a Server with the UTMStack agent Installed.',
38-
path: linuxPath,
39-
restart: linuxRestart
40-
}
41-
];
17+
function createPlatform(
18+
id: number,
19+
name: string,
20+
command: string,
21+
shell: string,
22+
path?: string,
23+
restart?: string,
24+
extraCommands?: string[]): Platform {
25+
return { id, name, command, shell, path, restart, extraCommands };
26+
}
4227

43-
export const createFileBeatsPlatforms = (windowsCommand: string,
44-
linuxCommand: string,
45-
windowsPath?: string,
46-
windowsRestart?: string,
47-
linuxPath?: string,
48-
linuxRestart?: string) => [
49-
{
50-
id: 1,
51-
name: 'WINDOWS',
52-
command: windowsCommand,
53-
shell: 'Run the following powershell script as “ADMINISTRATOR” in a Server with the UTMStack agent Installed.',
54-
path: windowsPath,
55-
restart: windowsRestart
56-
},
57-
{
58-
id: 3,
59-
name: 'LINUX',
60-
command: linuxCommand,
61-
shell: 'Run the following bash script as “ADMINISTRATOR” in a Server with the UTMStack agent Installed.',
62-
path: linuxPath,
63-
restart: linuxRestart
64-
}
28+
export const createPlatforms = (
29+
windowsCommandAMD64: string,
30+
windowsCommandARM64: string,
31+
linuxCommand: string,
32+
windowsPath?: string,
33+
windowsRestart?: string,
34+
linuxPath?: string,
35+
linuxRestart?: string): Platform[] => [
36+
createPlatform(
37+
1,
38+
'WINDOWS (AMD64)',
39+
windowsCommandAMD64,
40+
WINDOWS_SHELL,
41+
windowsPath,
42+
windowsRestart,[
43+
`Start-Process "C:\\Program Files\\UTMStack\\UTMStack Agent\\utmstack_agent_service.exe" \`
44+
-ArgumentList 'load-tls-certs', '[YOUR_CERT_PATH]', '[YOUR_KEY_PATH]' \`
45+
-NoNewWindow -Wait`
46+
]
47+
),
48+
createPlatform(
49+
2,
50+
'WINDOWS (ARM64)',
51+
windowsCommandARM64,
52+
WINDOWS_SHELL,
53+
windowsPath,
54+
windowsRestart,
55+
[
56+
`Start-Process "C:\\Program Files\\UTMStack\\UTMStack Agent\\utmstack_agent_service_arm64.exe" \`
57+
-ArgumentList 'load-tls-certs', '[YOUR_CERT_PATH]', '[YOUR_KEY_PATH]' \`
58+
-NoNewWindow -Wait`
59+
]
60+
),
61+
createPlatform(
62+
3,
63+
'LINUX',
64+
linuxCommand,
65+
LINUX_SHELL,
66+
linuxPath,
67+
linuxRestart,
68+
[
69+
`sudo bash -c "/opt/utmstack-linux-agent/utmstack_agent_service load-tls-certs [YOUR_CERT_PATH] [YOUR_KEY_PATH]"`
70+
]
71+
)
6572
];
6673

74+
export const createFileBeatsPlatforms = (
75+
windowsCommand: string,
76+
linuxCommand: string,
77+
windowsPath?: string,
78+
windowsRestart?: string,
79+
linuxPath?: string,
80+
linuxRestart?: string): Platform[] => [
81+
createPlatform(
82+
1,
83+
'WINDOWS',
84+
windowsCommand,
85+
WINDOWS_SHELL,
86+
windowsPath,
87+
windowsRestart
88+
),
89+
createPlatform(
90+
3,
91+
'LINUX',
92+
linuxCommand,
93+
LINUX_SHELL,
94+
linuxPath,
95+
linuxRestart
96+
)
97+
];
6798

6899
export const PLATFORMS = createPlatforms(
69-
'Start-Process "C:\\Program Files\\UTMStack\\UTMStack Agent\\utmstack_agent_service.exe" -ArgumentList \'ACTION\',' +
70-
' \'AGENT_NAME\', \'PORT\' -NoNewWindow -Wait\n',
71-
'Start-Process "C:\\Program Files\\UTMStack\\UTMStack Agent\\utmstack_agent_service_arm64.exe" -ArgumentList \'ACTION\',' +
72-
' \'AGENT_NAME\', \'PORT\' -NoNewWindow -Wait\n',
73-
'sudo bash -c "/opt/utmstack-linux-agent/utmstack_agent_service ACTION AGENT_NAME PORT"'
100+
'Start-Process "C:\\Program Files\\UTMStack\\UTMStack Agent\\utmstack_agent_service.exe" -ArgumentList \'ACTION\', \'AGENT_NAME\', \'PROTOCOL\' TLS -NoNewWindow -Wait\n',
101+
'Start-Process "C:\\Program Files\\UTMStack\\UTMStack Agent\\utmstack_agent_service_arm64.exe" -ArgumentList \'ACTION\', \'AGENT_NAME\', \'PROTOCOL\' TLS -NoNewWindow -Wait\n',
102+
'sudo bash -c "/opt/utmstack-linux-agent/utmstack_agent_service ACTION AGENT_NAME PROTOCOL TLS"'
74103
);
75104

76-
77105
export const FILEBEAT_PLATFORMS = createFileBeatsPlatforms(
78-
'cd "C:\\Program Files\\UTMStack\\UTMStack Agent\\beats\\filebeat\\"; Start-Process "filebeat.exe" -ArgumentList "modules", "enable", \"AGENT_NAME\"',
106+
'cd "C:\\Program Files\\UTMStack\\UTMStack Agent\\beats\\filebeat\\"; Start-Process "filebeat.exe" -ArgumentList "modules", "enable", "AGENT_NAME"',
79107
'cd /opt/utmstack-linux-agent/beats/filebeat/ && ./filebeat modules enable AGENT_NAME',
80108
'C:\\Program Files\\UTMStack\\UTMStack Agent\\beats\\filebeat\\modules.d\\',
81109
'Stop-Service -Name UTMStackModulesLogsCollector; Start-Sleep -Seconds 5; Start-Service -Name UTMStackModulesLogsCollector',

0 commit comments

Comments
 (0)