mirror of
https://github.com/step-security/harden-runner.git
synced 2026-06-05 22:47:05 +00:00
Merge pull request #536 from rohan-stepsecurity/feat/flag/disable-sudo-and-containers
fix: run sudo command only when both disable-sudo and disable-sudo-an…
This commit is contained in:
commit
ff2ab228bd
1 changed files with 2 additions and 14 deletions
|
|
@ -81,21 +81,9 @@ import { isGithubHosted } from "./tls-inspect";
|
|||
}
|
||||
|
||||
var disable_sudo = process.env.STATE_disableSudo;
|
||||
if (disable_sudo !== "true") {
|
||||
try {
|
||||
var journalLog = cp.execSync("sudo journalctl -u agent.service --lines=1000", {
|
||||
encoding: "utf8",
|
||||
maxBuffer: 1024 * 1024 * 10 // 10MB buffer
|
||||
});
|
||||
console.log("agent.service log:");
|
||||
console.log(journalLog);
|
||||
} catch (error) {
|
||||
console.log("Warning: Could not fetch service logs:", error.message);
|
||||
}
|
||||
}
|
||||
|
||||
var disable_sudo_and_containers = process.env.disableSudoAndContainers;
|
||||
if (disable_sudo_and_containers !== "true") {
|
||||
|
||||
if (disable_sudo !== "true" && disable_sudo_and_containers !== "true") {
|
||||
try {
|
||||
var journalLog = cp.execSync("sudo journalctl -u agent.service --lines=1000", {
|
||||
encoding: "utf8",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue