Update message text

This commit is contained in:
Varun Sharma 2022-04-22 06:25:38 -07:00
commit 56662b5676
10 changed files with 39 additions and 25 deletions

6
dist/index.js vendored
View file

@ -1696,6 +1696,8 @@ function printInfo(web_url) {
console.log("\x1b[32m%s\x1b[0m", "View security insights and recommended policy at:");
console.log(`${web_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}`);
}
const CONTAINER_MESSAGE = "This job is running in a container. Harden Runner does not run in a container as it needs sudo access to run. This job will not be monitored.";
const UBUNTU_MESSAGE = "This job is not running in a GitHub Actions Hosted Runner Ubuntu VM. Harden Runner is only supported on Ubuntu VM. This job will not be monitored.";
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
var core = __nccwpck_require__(186);
@ -1747,11 +1749,11 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
(() => __awaiter(void 0, void 0, void 0, function* () {
if (process.platform !== "linux") {
console.log("Only runs on linux");
console.log(UBUNTU_MESSAGE);
return;
}
if (isDocker()) {
console.log("StepSecurity Harden Runner does not run inside a Docker container");
console.log(CONTAINER_MESSAGE);
return;
}
if (core.getBooleanInput("disable-telemetry") &&

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

13
dist/post/index.js vendored
View file

@ -1697,6 +1697,14 @@ var external_fs_ = __nccwpck_require__(747);
const external_child_process_namespaceObject = require("child_process");
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
var core = __nccwpck_require__(186);
;// CONCATENATED MODULE: ./src/common.ts
function printInfo(web_url) {
console.log("\x1b[32m%s\x1b[0m", "View security insights and recommended policy at:");
console.log(`${web_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}`);
}
const CONTAINER_MESSAGE = "This job is running in a container. Harden Runner does not run in a container as it needs sudo access to run. This job will not be monitored.";
const UBUNTU_MESSAGE = "This job is not running in a GitHub Actions Hosted Runner Ubuntu VM. Harden Runner is only supported on Ubuntu VM. This job will not be monitored.";
;// CONCATENATED MODULE: external "node:fs"
const external_node_fs_namespaceObject = require("node:fs");
;// CONCATENATED MODULE: ./node_modules/is-docker/index.js
@ -1744,13 +1752,14 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
(() => __awaiter(void 0, void 0, void 0, function* () {
if (process.platform !== "linux") {
console.log("Only runs on linux");
console.log(UBUNTU_MESSAGE);
return;
}
if (isDocker()) {
console.log("StepSecurity Harden Runner does not run inside a Docker container");
console.log(CONTAINER_MESSAGE);
return;
}
external_fs_.writeFileSync("/home/agent/post_event.json", JSON.stringify({ event: "post" }));

File diff suppressed because one or more lines are too long

6
dist/pre/index.js vendored
View file

@ -6258,6 +6258,8 @@ function printInfo(web_url) {
console.log("\x1b[32m%s\x1b[0m", "View security insights and recommended policy at:");
console.log(`${web_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}`);
}
const CONTAINER_MESSAGE = "This job is running in a container. Harden Runner does not run in a container as it needs sudo access to run. This job will not be monitored.";
const UBUNTU_MESSAGE = "This job is not running in a GitHub Actions Hosted Runner Ubuntu VM. Harden Runner is only supported on Ubuntu VM. This job will not be monitored.";
// EXTERNAL MODULE: ./node_modules/@actions/tool-cache/lib/tool-cache.js
var tool_cache = __nccwpck_require__(7784);
@ -6335,11 +6337,11 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
(() => __awaiter(void 0, void 0, void 0, function* () {
try {
if (process.platform !== "linux") {
console.log("Only runs on linux");
console.log(UBUNTU_MESSAGE);
return;
}
if (isDocker()) {
console.log("StepSecurity Harden Runner does not run inside a Docker container");
console.log(CONTAINER_MESSAGE);
return;
}
var correlation_id = v4();

File diff suppressed because one or more lines are too long

View file

@ -1,17 +1,16 @@
import * as fs from "fs";
import * as cp from "child_process";
import * as core from "@actions/core";
import * as common from "./common";
import isDocker from "is-docker";
(async () => {
if (process.platform !== "linux") {
console.log("Only runs on linux");
console.log(common.UBUNTU_MESSAGE);
return;
}
if (isDocker()) {
console.log(
"StepSecurity Harden Runner does not run inside a Docker container"
);
console.log(common.CONTAINER_MESSAGE);
return;
}

View file

@ -8,3 +8,9 @@ export function printInfo(web_url) {
`${web_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}`
);
}
export const CONTAINER_MESSAGE =
"This job is running in a container. Harden Runner does not run in a container as it needs sudo access to run. This job will not be monitored.";
export const UBUNTU_MESSAGE =
"This job is not running in a GitHub Actions Hosted Runner Ubuntu VM. Harden Runner is only supported on Ubuntu VM. This job will not be monitored.";

View file

@ -1,16 +1,14 @@
import { printInfo } from "./common";
import * as common from "./common";
import * as core from "@actions/core";
import isDocker from "is-docker";
(async () => {
if (process.platform !== "linux") {
console.log("Only runs on linux");
console.log(common.UBUNTU_MESSAGE);
return;
}
if (isDocker()) {
console.log(
"StepSecurity Harden Runner does not run inside a Docker container"
);
console.log(common.CONTAINER_MESSAGE);
return;
}
@ -23,6 +21,6 @@ import isDocker from "is-docker";
);
} else {
var web_url = "https://app.stepsecurity.io";
printInfo(web_url);
common.printInfo(web_url);
}
})();

View file

@ -4,7 +4,7 @@ import * as fs from "fs";
import * as httpm from "@actions/http-client";
import * as path from "path";
import { v4 as uuidv4 } from "uuid";
import { printInfo } from "./common";
import * as common from "./common";
import * as tc from "@actions/tool-cache";
import { verifyChecksum } from "./checksum";
import isDocker from "is-docker";
@ -12,13 +12,11 @@ import isDocker from "is-docker";
(async () => {
try {
if (process.platform !== "linux") {
console.log("Only runs on linux");
console.log(common.UBUNTU_MESSAGE);
return;
}
if (isDocker()) {
console.log(
"StepSecurity Harden Runner does not run inside a Docker container"
);
console.log(common.CONTAINER_MESSAGE);
return;
}
@ -84,7 +82,7 @@ import isDocker from "is-docker";
console.log(`Step Security Job Correlation ID: ${correlation_id}`);
if (!confg.disable_telemetry || confg.egress_policy === "audit") {
printInfo(web_url);
common.printInfo(web_url);
}
let cmd = "cp",