Skip to content

Commit 23ac3ac

Browse files
authored
Merge pull request #1473 from utmstack/release/v10.9.4
fix: change file permissions from 777 to 755 for security improvements
2 parents 84902e4 + d8e622c commit 23ac3ac

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

agent/collectors/filebeat_amd64.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (f Filebeat) Install() error {
6666
return fmt.Errorf("error creating %s service: %v", config.ModulesServName, err)
6767
}
6868

69-
if err = utils.Execute("chmod", filebLogPath, "-R", "777", "filebeat"); err != nil {
69+
if err = utils.Execute("chmod", filebLogPath, "-R", "755", "filebeat"); err != nil {
7070
return fmt.Errorf("error executing chmod: %v", err)
7171
}
7272

agent/updates/dependencies.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func handleDependenciesPostDownload(dependencies []string) error {
3939
}
4040

4141
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
42-
if err := utils.Execute("chmod", utils.GetMyPath(), "-R", "777", fmt.Sprintf(config.UpdaterSelf, "")); err != nil {
42+
if err := utils.Execute("chmod", utils.GetMyPath(), "-R", "755", fmt.Sprintf(config.UpdaterSelf, "")); err != nil {
4343
return fmt.Errorf("error executing chmod on %s: %v", fmt.Sprintf(config.UpdaterSelf, ""), err)
4444
}
4545
}
@@ -48,7 +48,7 @@ func handleDependenciesPostDownload(dependencies []string) error {
4848
return fmt.Errorf("error removing file %s: %v", file, err)
4949
}
5050
} else if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
51-
if err := utils.Execute("chmod", utils.GetMyPath(), "-R", "777", file); err != nil {
51+
if err := utils.Execute("chmod", utils.GetMyPath(), "-R", "755", file); err != nil {
5252
return fmt.Errorf("error executing chmod on %s: %v", file, err)
5353
}
5454
}

agent/updates/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func UpdateDependencies(cnf *config.Config) {
5555
}
5656

5757
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
58-
if err = utils.Execute("chmod", utils.GetMyPath(), "-R", "777", filepath.Join(utils.GetMyPath(), fmt.Sprintf(config.ServiceFile, "_new"))); err != nil {
58+
if err = utils.Execute("chmod", utils.GetMyPath(), "-R", "755", filepath.Join(utils.GetMyPath(), fmt.Sprintf(config.ServiceFile, "_new"))); err != nil {
5959
utils.Logger.ErrorF("error executing chmod: %v", err)
6060
}
6161
}

etc/opensearch/2.x/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ RUN yum update -y && \
3535
rm -rf /usr/share/man /usr/share/doc /usr/share/info /tmp/* /var/tmp/*
3636

3737
# Assign permissions and ownership to the extracted folder
38-
RUN chmod -R 777 /usr/share/opensearch/.utm_geoip && \
38+
RUN chmod -R 755 /usr/share/opensearch/.utm_geoip && \
3939
chown -R opensearch:opensearch /usr/share/opensearch/.utm_geoip
4040

4141
# Restore OpenSearch user

frontend/src/app/app-module/guides/guide-as400/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const PLATFORM = [
3232
`/opt/utmstack-linux-collectors/as400 && cd /opt/utmstack-linux-collectors/as400 && ` +
3333
`wget --no-check-certificate ` +
3434
`https://V_IP:9001/private/dependencies/collector/linux-as400-collector.zip ` +
35-
`&& unzip linux-as400-collector.zip && rm linux-as400-collector.zip && chmod -R 777 ` +
35+
`&& unzip linux-as400-collector.zip && rm linux-as400-collector.zip && chmod -R 755 ` +
3636
`utmstack_collectors_installer && ./utmstack_collectors_installer install as400 ` +
3737
`V_IP <secret>V_TOKEN<secret>"`,
3838

frontend/src/app/app-module/guides/guide-linux-agent/guide-linux-agent.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class GuideLinuxAgentComponent implements OnInit {
3939
return `sudo bash -c "apt update -y && apt install wget -y && mkdir -p /opt/utmstack-linux-agent && \
4040
wget --no-check-certificate -P /opt/utmstack-linux-agent \
4141
https://${ip}:9001/private/dependencies/agent/${installerName} && \
42-
chmod -R 777 /opt/utmstack-linux-agent/${installerName} && \
42+
chmod -R 755 /opt/utmstack-linux-agent/${installerName} && \
4343
/opt/utmstack-linux-agent/${installerName} install ${ip} <secret>${this.token}</secret> yes"`;
4444
}
4545

@@ -49,7 +49,7 @@ export class GuideLinuxAgentComponent implements OnInit {
4949
return `sudo bash -c "yum install wget -y && mkdir -p /opt/utmstack-linux-agent && \
5050
wget --no-check-certificate -P /opt/utmstack-linux-agent \
5151
https://${ip}:9001/private/dependencies/agent/${installerName} && \
52-
chmod -R 777 /opt/utmstack-linux-agent/${installerName} && \
52+
chmod -R 755 /opt/utmstack-linux-agent/${installerName} && \
5353
/opt/utmstack-linux-agent/${installerName} install ${ip} <secret>${this.token}</secret> yes"`;
5454
}
5555

@@ -59,7 +59,7 @@ export class GuideLinuxAgentComponent implements OnInit {
5959
return `sudo bash -c "dnf install wget -y && mkdir -p /opt/utmstack-linux-agent && \
6060
wget --no-check-certificate -P /opt/utmstack-linux-agent \
6161
https://${ip}:9001/private/dependencies/agent/${installerName} && \
62-
chmod -R 777 /opt/utmstack-linux-agent/${installerName} && \
62+
chmod -R 755 /opt/utmstack-linux-agent/${installerName} && \
6363
/opt/utmstack-linux-agent/${installerName} install ${ip} <secret>${this.token}</secret> yes"`;
6464
}
6565

0 commit comments

Comments
 (0)