Skip to content

Commit 2cf0f06

Browse files
committed
Release 2.5.0
2 parents 5e70db3 + 753242a commit 2cf0f06

30 files changed

+224
-88
lines changed

LICENSE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
### Tactical RMM License Version 1.0
22

3-
Text of license:&emsp;&emsp;&emsp;Copyright © 2022 AmidaWare LLC. All rights reserved.<br>
3+
Text of license:&emsp;&emsp;&emsp;Copyright © 2023 AmidaWare Inc. All rights reserved.<br>
44
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;Amending the text of this license is not permitted.
55

6-
Trade Mark:&emsp;&emsp;&emsp;&emsp;"Tactical RMM" is a trade mark of AmidaWare LLC.
6+
Trade Mark:&emsp;&emsp;&emsp;&emsp;"Tactical RMM" is a trade mark of AmidaWare Inc.
77

8-
Licensor:&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;AmidaWare LLC of 1968 S Coast Hwy PMB 3847 Laguna Beach, CA, USA.
8+
Licensor:&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;AmidaWare Inc. of 1968 S Coast Hwy PMB 3847 Laguna Beach, CA, USA.
99

1010
Licensed Software:&emsp;&nbsp;The software known as Tactical RMM Version v0.12.0 (and all subsequent releases and versions) and the Tactical RMM Agent v2.0.0 (and all subsequent releases and versions).
1111

@@ -26,7 +26,7 @@ This license does not allow the functionality of the Licensed Software (whether
2626
* the offering of installation and/or configuration services;
2727
* the offer for sale, distribution or sale of any service or product (whether or not branded as Tactical RMM).
2828

29-
The prior written approval of AmidaWare LLC must be obtained for all commercial use and/or for-profit service use of the (i) Licensed Software (whether in whole or in part), (ii) a modified version of the Licensed Software and/or (iii) a derivative work.
29+
The prior written approval of AmidaWare Inc. must be obtained for all commercial use and/or for-profit service use of the (i) Licensed Software (whether in whole or in part), (ii) a modified version of the Licensed Software and/or (iii) a derivative work.
3030

3131
The terms of this license apply to all copies of the Licensed Software (including modified versions) and derivative works.
3232

@@ -38,7 +38,7 @@ If a derivative work is created which is based on or otherwise incorporates all
3838
### 4. Copyright Notice
3939
The following copyright notice shall be included in all copies of the Licensed Software:
4040

41-
&emsp;&emsp;&emsp;Copyright © 2022 AmidaWare LLC.
41+
&emsp;&emsp;&emsp;Copyright © 2023 AmidaWare Inc.
4242

4343
&emsp;&emsp;&emsp;Licensed under the Tactical RMM License Version 1.0 (the “License”).<br>
4444
&emsp;&emsp;&emsp;You may only use the Licensed Software in accordance with the License.<br>
@@ -54,13 +54,13 @@ THE FOLLOWING EXCLUSIONS SHALL APPLY TO THE FULLEST EXTENT PERMISSIBLE AT LAW.
5454
This license shall terminate with immediate effect if there is a material breach of any of its terms.
5555

5656
### 8. No partnership, agency or joint venture
57-
Nothing in this license agreement is intended to, or shall be deemed to, establish any partnership or joint venture or any relationship of agency between AmidaWare LLC and any other person.
57+
Nothing in this license agreement is intended to, or shall be deemed to, establish any partnership or joint venture or any relationship of agency between AmidaWare Inc. and any other person.
5858

5959
### 9. No endorsement
6060
The names of the authors and/or the copyright holders must not be used to promote or endorse any products or services which are in any way derived from the Licensed Software without prior written consent.
6161

6262
### 10. Trademarks
63-
No permission is granted to use the trademark “Tactical RMM” or any other trade name, trademark, service mark or product name of AmidaWare LLC except to the extent necessary to comply with the notice requirements in Section 4 (Copyright Notice).
63+
No permission is granted to use the trademark “Tactical RMM” or any other trade name, trademark, service mark or product name of AmidaWare Inc. except to the extent necessary to comply with the notice requirements in Section 4 (Copyright Notice).
6464

6565
### 11. Entire agreement
6666
This license contains the whole agreement relating to its subject matter.

agent/agent.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 AmidaWare LLC.
2+
Copyright 2023 AmidaWare Inc.
33
44
Licensed under the Tactical RMM License Version 1.0 (the “License”).
55
You may only use the Licensed Software in accordance with the License.
@@ -14,6 +14,7 @@ package agent
1414
import (
1515
"bytes"
1616
"context"
17+
"crypto/tls"
1718
"errors"
1819
"fmt"
1920
"math"
@@ -73,6 +74,7 @@ type Agent struct {
7374
NatsProxyPort string
7475
NatsPingInterval int
7576
NatsWSCompression bool
77+
Insecure bool
7678
}
7779

7880
const (
@@ -125,12 +127,20 @@ func New(logger *logrus.Logger, version string) *Agent {
125127
headers["Authorization"] = fmt.Sprintf("Token %s", ac.Token)
126128
}
127129

130+
insecure := ac.Insecure == "true"
131+
128132
restyC := resty.New()
129133
restyC.SetBaseURL(ac.BaseURL)
130134
restyC.SetCloseConnection(true)
131135
restyC.SetHeaders(headers)
132136
restyC.SetTimeout(15 * time.Second)
133137
restyC.SetDebug(logger.IsLevelEnabled(logrus.DebugLevel))
138+
if insecure {
139+
insecureConf := &tls.Config{
140+
InsecureSkipVerify: true,
141+
}
142+
restyC.SetTLSClientConfig(insecureConf)
143+
}
134144

135145
if len(ac.Proxy) > 0 {
136146
restyC.SetProxy(ac.Proxy)
@@ -236,6 +246,7 @@ func New(logger *logrus.Logger, version string) *Agent {
236246
NatsProxyPort: natsProxyPort,
237247
NatsPingInterval: natsPingInterval,
238248
NatsWSCompression: natsWsCompression,
249+
Insecure: insecure,
239250
}
240251
}
241252

@@ -477,6 +488,12 @@ func (a *Agent) setupNatsOptions() []nats.Option {
477488
a.Logger.Errorln("NATS error:", err)
478489
a.Logger.Errorf("%+v\n", sub)
479490
}))
491+
if a.Insecure {
492+
insecureConf := &tls.Config{
493+
InsecureSkipVerify: true,
494+
}
495+
opts = append(opts, nats.Secure(insecureConf))
496+
}
480497
return opts
481498
}
482499

agent/agent_unix.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// +build !windows
33

44
/*
5-
Copyright 2022 AmidaWare LLC.
5+
Copyright 2023 AmidaWare Inc.
66
77
Licensed under the Tactical RMM License Version 1.0 (the “License”).
88
You may only use the Licensed Software in accordance with the License.
@@ -16,6 +16,7 @@ package agent
1616

1717
import (
1818
"bufio"
19+
"crypto/tls"
1920
"errors"
2021
"fmt"
2122
"os"
@@ -160,6 +161,7 @@ func NewAgentConfig() *rmm.AgentConfig {
160161
NatsProxyPort: viper.GetString("natsproxyport"),
161162
NatsStandardPort: viper.GetString("natsstandardport"),
162163
NatsPingInterval: viper.GetInt("natspinginterval"),
164+
Insecure: viper.GetString("insecure"),
163165
}
164166
return ret
165167
}
@@ -248,6 +250,12 @@ func (a *Agent) AgentUpdate(url, inno, version string) error {
248250
if len(a.Proxy) > 0 {
249251
rClient.SetProxy(a.Proxy)
250252
}
253+
if a.Insecure {
254+
insecureConf := &tls.Config{
255+
InsecureSkipVerify: true,
256+
}
257+
rClient.SetTLSClientConfig(insecureConf)
258+
}
251259

252260
r, err := rClient.R().SetOutput(f.Name()).Get(url)
253261
if err != nil {

agent/agent_windows.go

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 AmidaWare LLC.
2+
Copyright 2023 AmidaWare Inc.
33
44
Licensed under the Tactical RMM License Version 1.0 (the “License”).
55
You may only use the Licensed Software in accordance with the License.
@@ -14,6 +14,7 @@ package agent
1414
import (
1515
"bytes"
1616
"context"
17+
"crypto/tls"
1718
"errors"
1819
"fmt"
1920
"os"
@@ -68,6 +69,7 @@ func NewAgentConfig() *rmm.AgentConfig {
6869
natsStandardPort, _, _ := k.GetStringValue("NatsStandardPort")
6970
natsPingInterval, _, _ := k.GetStringValue("NatsPingInterval")
7071
npi, _ := strconv.Atoi(natsPingInterval)
72+
insecure, _, _ := k.GetStringValue("Insecure")
7173

7274
return &rmm.AgentConfig{
7375
BaseURL: baseurl,
@@ -85,6 +87,7 @@ func NewAgentConfig() *rmm.AgentConfig {
8587
NatsProxyPort: natsProxyPort,
8688
NatsStandardPort: natsStandardPort,
8789
NatsPingInterval: npi,
90+
Insecure: insecure,
8891
}
8992
}
9093

@@ -158,21 +161,36 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int,
158161
defer cancel()
159162

160163
var timedOut = false
164+
var token *wintoken.Token
165+
var envBlock *uint16
166+
usingEnvVars := len(envVars) > 0
161167
cmd := exec.Command(exe, cmdArgs...)
162168
if runasuser {
163-
token, err := wintoken.GetInteractiveToken(wintoken.TokenImpersonation)
169+
token, err = wintoken.GetInteractiveToken(wintoken.TokenImpersonation)
164170
if err == nil {
165171
defer token.Close()
166172
cmd.SysProcAttr = &syscall.SysProcAttr{Token: syscall.Token(token.Token()), HideWindow: true}
173+
174+
if usingEnvVars {
175+
envBlock, err = CreateEnvironmentBlock(syscall.Token(token.Token()))
176+
if err == nil {
177+
defer DestroyEnvironmentBlock(envBlock)
178+
userEnv := EnvironmentBlockToSlice(envBlock)
179+
cmd.Env = userEnv
180+
} else {
181+
cmd.Env = os.Environ()
182+
}
183+
}
167184
}
185+
} else if usingEnvVars {
186+
cmd.Env = os.Environ()
168187
}
169-
cmd.Stdout = &outb
170-
cmd.Stderr = &errb
171188

172-
if len(envVars) > 0 {
173-
cmd.Env = os.Environ()
189+
if usingEnvVars {
174190
cmd.Env = append(cmd.Env, envVars...)
175191
}
192+
cmd.Stdout = &outb
193+
cmd.Stderr = &errb
176194

177195
if cmdErr := cmd.Start(); cmdErr != nil {
178196
a.Logger.Debugln(cmdErr)
@@ -615,6 +633,12 @@ func (a *Agent) AgentUpdate(url, inno, version string) error {
615633
if len(a.Proxy) > 0 {
616634
rClient.SetProxy(a.Proxy)
617635
}
636+
if a.Insecure {
637+
insecureConf := &tls.Config{
638+
InsecureSkipVerify: true,
639+
}
640+
rClient.SetTLSClientConfig(insecureConf)
641+
}
618642
r, err := rClient.R().SetOutput(updater).Get(url)
619643
if err != nil {
620644
a.Logger.Errorln(err)

agent/checkin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 AmidaWare LLC.
2+
Copyright 2023 AmidaWare Inc.
33
44
Licensed under the Tactical RMM License Version 1.0 (the “License”).
55
You may only use the Licensed Software in accordance with the License.

agent/checks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 AmidaWare LLC.
2+
Copyright 2023 AmidaWare Inc.
33
44
Licensed under the Tactical RMM License Version 1.0 (the “License”).
55
You may only use the Licensed Software in accordance with the License.

agent/choco_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 AmidaWare LLC.
2+
Copyright 2023 AmidaWare Inc.
33
44
Licensed under the Tactical RMM License Version 1.0 (the “License”).
55
You may only use the Licensed Software in accordance with the License.

agent/eventlog_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 AmidaWare LLC.
2+
Copyright 2023 AmidaWare Inc.
33
44
Licensed under the Tactical RMM License Version 1.0 (the “License”).
55
You may only use the Licensed Software in accordance with the License.

agent/install.go

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 AmidaWare LLC.
2+
Copyright 2023 AmidaWare Inc.
33
44
Licensed under the Tactical RMM License Version 1.0 (the “License”).
55
You may only use the Licensed Software in accordance with the License.
@@ -12,6 +12,7 @@ https://license.tacticalrmm.com
1212
package agent
1313

1414
import (
15+
"crypto/tls"
1516
"fmt"
1617
"io"
1718
"net/url"
@@ -28,25 +29,27 @@ import (
2829
)
2930

3031
type Installer struct {
31-
Headers map[string]string
32-
RMM string
33-
ClientID int
34-
SiteID int
35-
Description string
36-
AgentType string
37-
Power bool
38-
RDP bool
39-
Ping bool
40-
Token string
41-
LocalMesh string
42-
Cert string
43-
Proxy string
44-
Timeout time.Duration
45-
SaltMaster string
46-
Silent bool
47-
NoMesh bool
48-
MeshDir string
49-
MeshNodeID string
32+
Headers map[string]string
33+
RMM string
34+
ClientID int
35+
SiteID int
36+
Description string
37+
AgentType string
38+
Power bool
39+
RDP bool
40+
Ping bool
41+
Token string
42+
LocalMesh string
43+
Cert string
44+
Proxy string
45+
Timeout time.Duration
46+
SaltMaster string
47+
Silent bool
48+
NoMesh bool
49+
MeshDir string
50+
MeshNodeID string
51+
Insecure bool
52+
NatsStandardPort string
5053
}
5154

5255
func (a *Agent) Install(i *Installer) {
@@ -97,6 +100,14 @@ func (a *Agent) Install(i *Installer) {
97100
iClient.SetProxy(i.Proxy)
98101
}
99102

103+
insecureConf := &tls.Config{
104+
InsecureSkipVerify: true,
105+
}
106+
107+
if i.Insecure {
108+
iClient.SetTLSClientConfig(insecureConf)
109+
}
110+
100111
creds, cerr := iClient.R().Get(fmt.Sprintf("%s/api/v3/installer/", baseURL))
101112
if cerr != nil {
102113
a.installerMsg(cerr.Error(), "error", i.Silent)
@@ -133,6 +144,10 @@ func (a *Agent) Install(i *Installer) {
133144
rClient.SetProxy(i.Proxy)
134145
}
135146

147+
if i.Insecure {
148+
rClient.SetTLSClientConfig(insecureConf)
149+
}
150+
136151
var installerMeshSystemEXE string
137152
if len(i.MeshDir) > 0 {
138153
installerMeshSystemEXE = filepath.Join(i.MeshDir, "MeshAgent.exe")
@@ -230,7 +245,7 @@ func (a *Agent) Install(i *Installer) {
230245
a.Logger.Debugln("Agent token:", agentToken)
231246
a.Logger.Debugln("Agent PK:", agentPK)
232247

233-
createAgentConfig(baseURL, a.AgentID, i.SaltMaster, agentToken, strconv.Itoa(agentPK), i.Cert, i.Proxy, i.MeshDir)
248+
createAgentConfig(baseURL, a.AgentID, i.SaltMaster, agentToken, strconv.Itoa(agentPK), i.Cert, i.Proxy, i.MeshDir, i.NatsStandardPort, i.Insecure)
234249
time.Sleep(1 * time.Second)
235250
// refresh our agent with new values
236251
a = New(a.Logger, a.Version)

agent/install_unix.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// +build !windows
33

44
/*
5-
Copyright 2022 AmidaWare LLC.
5+
Copyright 2023 AmidaWare Inc.
66
77
Licensed under the Tactical RMM License Version 1.0 (the “License”).
88
You may only use the Licensed Software in accordance with the License.
@@ -33,7 +33,7 @@ func (a *Agent) installerMsg(msg, alert string, silent bool) {
3333
}
3434
}
3535

36-
func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, meshdir string) {
36+
func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, meshdir, natsport string, insecure bool) {
3737
viper.SetConfigType("json")
3838
viper.Set("baseurl", baseurl)
3939
viper.Set("agentid", agentid)
@@ -43,6 +43,10 @@ func createAgentConfig(baseurl, agentid, apiurl, token, agentpk, cert, proxy, me
4343
viper.Set("cert", cert)
4444
viper.Set("proxy", proxy)
4545
viper.Set("meshdir", meshdir)
46+
viper.Set("natsstandardport", natsport)
47+
if insecure {
48+
viper.Set("insecure", "true")
49+
}
4650
viper.SetConfigPermissions(0660)
4751
err := viper.SafeWriteConfigAs(etcConfig)
4852
if err != nil {

0 commit comments

Comments
 (0)