Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class GuideLinuxAgentComponent implements OnInit {
@Input() integrationId: number;
module = UtmModulesEnum;
@Input() serverId: number;
@Input() version: string;
token: string;

constructor(private federationConnectionService: FederationConnectionService) { }
Expand All @@ -32,30 +33,40 @@ export class GuideLinuxAgentComponent implements OnInit {

getCommandUbuntu(): string {
const ip = window.location.host.includes(':') ? window.location.host.split(':')[0] : window.location.host;
return `sudo apt update -y && sudo apt install wget -y && mkdir -p /opt/utmstack-linux-agent && wget -P /opt/utmstack-linux-agent ` +
`https://cdn.utmstack.com/agent_updates/release/installer/v10.2.0/utmstack_agent_installer && chmod -R 777 ` +
`/opt/utmstack-linux-agent/utmstack_agent_installer && sudo /opt/utmstack-linux-agent/utmstack_agent_installer install ` + ip + ` <secret>` + this.token + `</secret> yes`;

return `sudo bash -c "apt update -y && apt install wget -y && mkdir -p /opt/utmstack-linux-agent && \
wget -P /opt/utmstack-linux-agent https://cdn.utmstack.com/agent_updates/release/installer/v${this.version}/utmstack_agent_installer && \
chmod -R 777 /opt/utmstack-linux-agent/utmstack_agent_installer && \
/opt/utmstack-linux-agent/utmstack_agent_installer install ${ip} <secret>${this.token}</secret> yes"`;
}
getCommandCentos7RedHat(): string {
const ip = window.location.host.includes(':') ? window.location.host.split(':')[0] : window.location.host;
return `sudo yum install wget -y && mkdir /opt/utmstack-linux-agent && wget -P /opt/utmstack-linux-agent ` +
`https://cdn.utmstack.com/agent_updates/release/installer/v10.2.0/utmstack_agent_installer && chmod -R 777 ` +
`/opt/utmstack-linux-agent/utmstack_agent_installer && sudo /opt/utmstack-linux-agent/utmstack_agent_installer install ` + ip + ` <secret>` + this.token + `</secret> yes`;

return `sudo bash -c "yum install wget -y && mkdir /opt/utmstack-linux-agent && wget -P /opt/utmstack-linux-agent \
https://cdn.utmstack.com/agent_updates/release/installer/v${this.version}/utmstack_agent_installer && \
chmod -R 777 /opt/utmstack-linux-agent/utmstack_agent_installer && \
/opt/utmstack-linux-agent/utmstack_agent_installer install ${ip} <secret>${this.token}</secret> yes"`;

}
getCommandCentos8Almalinux(): string {
const ip = window.location.host.includes(':') ? window.location.host.split(':')[0] : window.location.host;
return `sudo dnf install wget -y && mkdir /opt/utmstack-linux-agent && wget -P /opt/utmstack-linux-agent ` +
`https://cdn.utmstack.com/agent_updates/release/installer/v10.2.0/utmstack_agent_installer && chmod -R 777 ` +
`/opt/utmstack-linux-agent/utmstack_agent_installer && sudo /opt/utmstack-linux-agent/utmstack_agent_installer install ` + ip + ` <secret>` + this.token + `</secret> yes`;

return `sudo bash -c "dnf install wget -y && mkdir /opt/utmstack-linux-agent && \
wget -P /opt/utmstack-linux-agent https://cdn.utmstack.com/agent_updates/release/installer/v${this.version}/utmstack_agent_installer && \
chmod -R 777 /opt/utmstack-linux-agent/utmstack_agent_installer && \
/opt/utmstack-linux-agent/utmstack_agent_installer install ${ip} <secret>${this.token}</secret> yes"`;
}
getUninstallCommand(): string {
return `sudo /opt/utmstack-linux-agent/utmstack_agent_installer uninstall || true; sudo systemctl stop UTMStackAgent 2>/dev/null || true; ` +
`sudo systemctl disable UTMStackAgent 2>/dev/null || true; sudo rm /etc/systemd/system/UTMStackAgent.service 2>/dev/null || true; sudo systemctl stop UTMStackRedline 2>/dev/null || true; ` +
`sudo systemctl disable UTMStackRedline 2>/dev/null || true; sudo rm /etc/systemd/system/UTMStackRedline.service 2>/dev/null || true; ` +
`sudo systemctl stop UTMStackUpdater 2>/dev/null || true; sudo systemctl disable UTMStackUpdater 2>/dev/null || true; ` +
`sudo rm /etc/systemd/system/UTMStackUpdater.service 2>/dev/null || true; sudo systemctl stop UTMStackModulesLogsCollector 2>/dev/null || true; ` +
`sudo systemctl disable UTMStackModulesLogsCollector 2>/dev/null || true; sudo rm /etc/systemd/system/UTMStackModulesLogsCollector.service 2>/dev/null || true; ` +
`sudo systemctl daemon-reload 2>/dev/null || true; echo "Removing UTMStack Agent dependencies..." ` +
`&& sleep 10 && sudo rm -rf "/opt/utmstack-linux-agent" && echo "UTMStack Agent dependencies removed successfully."`;
return `sudo bash -c "/opt/utmstack-linux-agent/utmstack_agent_installer uninstall || true; \
systemctl stop UTMStackAgent 2>/dev/null || true; systemctl disable UTMStackAgent 2>/dev/null || true; \
rm /etc/systemd/system/UTMStackAgent.service 2>/dev/null || true; systemctl stop UTMStackRedline 2>/dev/null || true; \
systemctl disable UTMStackRedline 2>/dev/null || true; rm /etc/systemd/system/UTMStackRedline.service 2>/dev/null || true; \
systemctl stop UTMStackUpdater 2>/dev/null || true; systemctl disable UTMStackUpdater 2>/dev/null || true; \
rm /etc/systemd/system/UTMStackUpdater.service 2>/dev/null || true; systemctl stop UTMStackModulesLogsCollector 2>/dev/null || true; \
systemctl disable UTMStackModulesLogsCollector 2>/dev/null || true; \
rm /etc/systemd/system/UTMStackModulesLogsCollector.service 2>/dev/null || true; \
systemctl daemon-reload 2>/dev/null || true; \
echo 'Removing UTMStack Agent dependencies...' && sleep 10 && rm -rf /opt/utmstack-linux-agent && \
echo 'UTMStack Agent dependencies removed successfully.'"`;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class GuideWinlogbeatComponent implements OnInit {
@Input() serverId: number;
module = UtmModulesEnum;
token: string;
@Input() version: string;

constructor(private federationConnectionService: FederationConnectionService) {
}
Expand All @@ -34,7 +35,7 @@ export class GuideWinlogbeatComponent implements OnInit {
getCommand(): string {
const ip = window.location.host.includes(':') ? window.location.host.split(':')[0] : window.location.host;
return `New-Item -ItemType Directory -Force -Path "C:\\Program Files\\UTMStack\\UTMStack Agent"; ` +
`Invoke-WebRequest -Uri "https://cdn.utmstack.com/agent_updates/release/installer/v10.2.0/utmstack_agent_installer.exe" ` +
`Invoke-WebRequest -Uri "https://cdn.utmstack.com/agent_updates/release/installer/v${this.version}/utmstack_agent_installer.exe" ` +
`-OutFile "C:\\Program Files\\UTMStack\\UTMStack Agent\\utmstack_agent_installer.exe"; ` +
`Start-Process "C:\\Program Files\\UTMStack\\UTMStack Agent\\utmstack_agent_installer.exe" ` +
`-ArgumentList 'install', '` + ip + `', '<secret>` + this.token + `</secret>', 'yes' -NoNewWindow -Wait`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<div *ngIf="module;else loading" [ngSwitch]="module.moduleName" class="activated-route w-100 h-100">
<app-guide-winlogbeat [serverId]="serverId" *ngSwitchCase="moduleEnum.WINDOWS_AGENT"
[version]="currentVersion"
[integrationId]="module.id"></app-guide-winlogbeat>
<app-guide-asset-scanner [serverId]="serverId" *ngSwitchCase="moduleEnum.ASSET_MANAGEMENT"
[integrationId]="module.id"></app-guide-asset-scanner>
Expand Down Expand Up @@ -57,6 +58,7 @@
[filebeatModule]="module.moduleName">
</app-guide-macos-agent>
<app-guide-linux-agent *ngSwitchCase="moduleEnum.LINUX_AGENT" [serverId]="serverId"
[version]="currentVersion"
[integrationId]="module.id"></app-guide-linux-agent>

<app-guide-cisco *ngSwitchCase="moduleEnum.CISCO" [serverId]="serverId"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Component, Input, OnInit} from '@angular/core';
import {UtmModulesEnum} from '../shared/enum/utm-module.enum';
import {UtmModuleType} from '../shared/type/utm-module.type';
import {CheckForUpdatesService} from "../../shared/services/updates/check-for-updates.service";

@Component({
selector: 'app-module-integration',
Expand All @@ -11,11 +12,19 @@ export class ModuleIntegrationComponent implements OnInit {
@Input() module: UtmModuleType;
@Input() serverId: number;
moduleEnum = UtmModulesEnum;
currentVersion: string;

constructor() {
constructor(private checkForUpdatesService: CheckForUpdatesService) {
}

ngOnInit() {
this.getVersionInfo();
}

getVersionInfo() {
this.checkForUpdatesService.getVersion().subscribe(response => {
this.currentVersion = response.body.build.version;
});
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="card p-2 d-flex flex-row justify-content-between w-100 align-items-center">
<code *ngIf="code" [innerHTML]="code" style="width: 95%"></code>
<code *ngIf="code" [innerHTML]="code" (copy)="preventCopy($event)" class="user-select"></code>
<i (click)="copyCode()" *ngIf="allowCopy" class="icon-copy cursor-pointer"
ngbTooltip="Copy"></i>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.user-select {
width: 95%;
user-select: none
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export class UtmCodeViewComponent implements OnInit, OnChanges {
}
}

preventCopy(event: ClipboardEvent): void {
event.preventDefault();
}

copyCode() {
const selBox = document.createElement('textarea');
const copyText = this.removeSecretsTags(this.str.split('<br>').join(''));
Expand Down