mirror of
https://github.com/step-security/harden-runner.git
synced 2026-06-06 16:47:06 +00:00
Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc9d972ad4 | ||
|
|
0827586e44 | ||
|
|
f5cfd3fe85 | ||
|
|
abb3730f28 |
8 changed files with 77 additions and 45 deletions
19
dist/index.js
vendored
19
dist/index.js
vendored
|
|
@ -2913,8 +2913,8 @@ function addSummary() {
|
||||||
if (tableEntries.length === 0) {
|
if (tableEntries.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const insightsRow = `<h4><a href="${insights_url}">View Full Runtime Security Report & Recommended Policy</a></h4>`;
|
const insightsRow = `<p><b><a href="${insights_url}">📄 View Full Runtime Security Report & Recommended Policy</a></b></p>`;
|
||||||
yield core.summary.addSeparator().addRaw(`<h2>StepSecurity Report</h2>`);
|
yield core.summary.addSeparator().addRaw(`<h2>🛡 StepSecurity Report</h2>`);
|
||||||
tableEntries.sort((a, b) => {
|
tableEntries.sort((a, b) => {
|
||||||
if (a.status === "❌ Blocked" && b.status !== "❌ Blocked") {
|
if (a.status === "❌ Blocked" && b.status !== "❌ Blocked") {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -2928,8 +2928,9 @@ function addSummary() {
|
||||||
});
|
});
|
||||||
tableEntries = tableEntries.slice(0, 3);
|
tableEntries = tableEntries.slice(0, 3);
|
||||||
yield core.summary.addRaw(`
|
yield core.summary.addRaw(`
|
||||||
<p>Preview of the network events that occurred on the GitHub-hosted runner during this workflow run.</p>
|
<blockquote>
|
||||||
<h3>🌐 Network Events</h3>
|
<p>Preview of the outbound network calls during this workflow run.</p></blockquote>
|
||||||
|
<h3>Network Events</h3>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -2941,22 +2942,22 @@ function addSummary() {
|
||||||
<tbody>
|
<tbody>
|
||||||
${tableEntries
|
${tableEntries
|
||||||
.map((entry) => `<tr>
|
.map((entry) => `<tr>
|
||||||
<td>${entry.process}</td>
|
<td><code>${entry.process}</code></td>
|
||||||
<td>${entry.domain.replace(/\.$/, "")}</td>
|
<td>${entry.domain.replace(/\.$/, "")}</td>
|
||||||
<td>${entry.status}</td>
|
<td>${entry.status}</td>
|
||||||
</tr>`)
|
</tr>`)
|
||||||
.join("")}
|
.join("")}
|
||||||
<tr>
|
<tr>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
${insightsRow}
|
${insightsRow}
|
||||||
`);
|
`);
|
||||||
yield core.summary
|
yield core.summary
|
||||||
.addRaw(`<p>Markdown generated by the <a href="https://github.com/step-security/harden-runner">Harden-Runner GitHub Action</a></p>`)
|
.addRaw(`<p><i>Markdown generated by the <a href="https://github.com/step-security/harden-runner">Harden-Runner GitHub Action</a>.</i></p>`)
|
||||||
.addSeparator()
|
.addSeparator()
|
||||||
.write();
|
.write();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
32
dist/post/index.js
vendored
32
dist/post/index.js
vendored
|
|
@ -61211,8 +61211,8 @@ function addSummary() {
|
||||||
if (tableEntries.length === 0) {
|
if (tableEntries.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const insightsRow = `<h4><a href="${insights_url}">View Full Runtime Security Report & Recommended Policy</a></h4>`;
|
const insightsRow = `<p><b><a href="${insights_url}">📄 View Full Runtime Security Report & Recommended Policy</a></b></p>`;
|
||||||
yield core.summary.addSeparator().addRaw(`<h2>StepSecurity Report</h2>`);
|
yield core.summary.addSeparator().addRaw(`<h2>🛡 StepSecurity Report</h2>`);
|
||||||
tableEntries.sort((a, b) => {
|
tableEntries.sort((a, b) => {
|
||||||
if (a.status === "❌ Blocked" && b.status !== "❌ Blocked") {
|
if (a.status === "❌ Blocked" && b.status !== "❌ Blocked") {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -61226,8 +61226,9 @@ function addSummary() {
|
||||||
});
|
});
|
||||||
tableEntries = tableEntries.slice(0, 3);
|
tableEntries = tableEntries.slice(0, 3);
|
||||||
yield core.summary.addRaw(`
|
yield core.summary.addRaw(`
|
||||||
<p>Preview of the network events that occurred on the GitHub-hosted runner during this workflow run.</p>
|
<blockquote>
|
||||||
<h3>🌐 Network Events</h3>
|
<p>Preview of the outbound network calls during this workflow run.</p></blockquote>
|
||||||
|
<h3>Network Events</h3>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -61239,21 +61240,21 @@ function addSummary() {
|
||||||
<tbody>
|
<tbody>
|
||||||
${tableEntries
|
${tableEntries
|
||||||
.map((entry) => `<tr>
|
.map((entry) => `<tr>
|
||||||
<td>${entry.process}</td>
|
<td><code>${entry.process}</code></td>
|
||||||
<td>${entry.domain.replace(/\.$/, "")}</td>
|
<td>${entry.domain.replace(/\.$/, "")}</td>
|
||||||
<td>${entry.status}</td>
|
<td>${entry.status}</td>
|
||||||
</tr>`)
|
</tr>`)
|
||||||
.join("")}
|
.join("")}
|
||||||
<tr>
|
<tr>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
${insightsRow}
|
${insightsRow}
|
||||||
`);
|
`);
|
||||||
yield core.summary.addRaw(`<p>Markdown generated by the <a href="https://github.com/step-security/harden-runner">Harden-Runner GitHub Action</a></p>`)
|
yield core.summary.addRaw(`<p><i>Markdown generated by the <a href="https://github.com/step-security/harden-runner">Harden-Runner GitHub Action</a>.</i></p>`)
|
||||||
.addSeparator()
|
.addSeparator()
|
||||||
.write();
|
.write();
|
||||||
});
|
});
|
||||||
|
|
@ -61322,12 +61323,21 @@ var external_path_ = __nccwpck_require__(5622);
|
||||||
var external_path_default = /*#__PURE__*/__nccwpck_require__.n(external_path_);
|
var external_path_default = /*#__PURE__*/__nccwpck_require__.n(external_path_);
|
||||||
;// CONCATENATED MODULE: ./src/arc-runner.ts
|
;// CONCATENATED MODULE: ./src/arc-runner.ts
|
||||||
|
|
||||||
|
|
||||||
function isArcRunner() {
|
function isArcRunner() {
|
||||||
const runnerUserAgent = process.env["GITHUB_ACTIONS_RUNNER_EXTRA_USER_AGENT"];
|
const runnerUserAgent = process.env["GITHUB_ACTIONS_RUNNER_EXTRA_USER_AGENT"];
|
||||||
|
let isARC = false;
|
||||||
if (!runnerUserAgent) {
|
if (!runnerUserAgent) {
|
||||||
return false;
|
isARC = false;
|
||||||
}
|
}
|
||||||
return runnerUserAgent.includes("actions-runner-controller/");
|
else {
|
||||||
|
isARC = runnerUserAgent.includes("actions-runner-controller/");
|
||||||
|
}
|
||||||
|
return isARC || isSecondaryPod();
|
||||||
|
}
|
||||||
|
function isSecondaryPod() {
|
||||||
|
const workDir = "/__w";
|
||||||
|
return external_fs_.existsSync(workDir);
|
||||||
}
|
}
|
||||||
function getRunnerTempDir() {
|
function getRunnerTempDir() {
|
||||||
const isTest = process.env["isTest"];
|
const isTest = process.env["isTest"];
|
||||||
|
|
|
||||||
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
32
dist/pre/index.js
vendored
32
dist/pre/index.js
vendored
|
|
@ -69085,8 +69085,8 @@ function addSummary() {
|
||||||
if (tableEntries.length === 0) {
|
if (tableEntries.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const insightsRow = `<h4><a href="${insights_url}">View Full Runtime Security Report & Recommended Policy</a></h4>`;
|
const insightsRow = `<p><b><a href="${insights_url}">📄 View Full Runtime Security Report & Recommended Policy</a></b></p>`;
|
||||||
yield core.summary.addSeparator().addRaw(`<h2>StepSecurity Report</h2>`);
|
yield core.summary.addSeparator().addRaw(`<h2>🛡 StepSecurity Report</h2>`);
|
||||||
tableEntries.sort((a, b) => {
|
tableEntries.sort((a, b) => {
|
||||||
if (a.status === "❌ Blocked" && b.status !== "❌ Blocked") {
|
if (a.status === "❌ Blocked" && b.status !== "❌ Blocked") {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -69100,8 +69100,9 @@ function addSummary() {
|
||||||
});
|
});
|
||||||
tableEntries = tableEntries.slice(0, 3);
|
tableEntries = tableEntries.slice(0, 3);
|
||||||
yield core.summary.addRaw(`
|
yield core.summary.addRaw(`
|
||||||
<p>Preview of the network events that occurred on the GitHub-hosted runner during this workflow run.</p>
|
<blockquote>
|
||||||
<h3>🌐 Network Events</h3>
|
<p>Preview of the outbound network calls during this workflow run.</p></blockquote>
|
||||||
|
<h3>Network Events</h3>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -69113,22 +69114,22 @@ function addSummary() {
|
||||||
<tbody>
|
<tbody>
|
||||||
${tableEntries
|
${tableEntries
|
||||||
.map((entry) => `<tr>
|
.map((entry) => `<tr>
|
||||||
<td>${entry.process}</td>
|
<td><code>${entry.process}</code></td>
|
||||||
<td>${entry.domain.replace(/\.$/, "")}</td>
|
<td>${entry.domain.replace(/\.$/, "")}</td>
|
||||||
<td>${entry.status}</td>
|
<td>${entry.status}</td>
|
||||||
</tr>`)
|
</tr>`)
|
||||||
.join("")}
|
.join("")}
|
||||||
<tr>
|
<tr>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
${insightsRow}
|
${insightsRow}
|
||||||
`);
|
`);
|
||||||
yield core.summary
|
yield core.summary
|
||||||
.addRaw(`<p>Markdown generated by the <a href="https://github.com/step-security/harden-runner">Harden-Runner GitHub Action</a></p>`)
|
.addRaw(`<p><i>Markdown generated by the <a href="https://github.com/step-security/harden-runner">Harden-Runner GitHub Action</a>.</i></p>`)
|
||||||
.addSeparator()
|
.addSeparator()
|
||||||
.write();
|
.write();
|
||||||
});
|
});
|
||||||
|
|
@ -69286,12 +69287,21 @@ var cacheHttpClient = __nccwpck_require__(8245);
|
||||||
var cacheUtils = __nccwpck_require__(1518);
|
var cacheUtils = __nccwpck_require__(1518);
|
||||||
;// CONCATENATED MODULE: ./src/arc-runner.ts
|
;// CONCATENATED MODULE: ./src/arc-runner.ts
|
||||||
|
|
||||||
|
|
||||||
function isArcRunner() {
|
function isArcRunner() {
|
||||||
const runnerUserAgent = process.env["GITHUB_ACTIONS_RUNNER_EXTRA_USER_AGENT"];
|
const runnerUserAgent = process.env["GITHUB_ACTIONS_RUNNER_EXTRA_USER_AGENT"];
|
||||||
|
let isARC = false;
|
||||||
if (!runnerUserAgent) {
|
if (!runnerUserAgent) {
|
||||||
return false;
|
isARC = false;
|
||||||
}
|
}
|
||||||
return runnerUserAgent.includes("actions-runner-controller/");
|
else {
|
||||||
|
isARC = runnerUserAgent.includes("actions-runner-controller/");
|
||||||
|
}
|
||||||
|
return isARC || isSecondaryPod();
|
||||||
|
}
|
||||||
|
function isSecondaryPod() {
|
||||||
|
const workDir = "/__w";
|
||||||
|
return external_fs_.existsSync(workDir);
|
||||||
}
|
}
|
||||||
function getRunnerTempDir() {
|
function getRunnerTempDir() {
|
||||||
const isTest = process.env["isTest"];
|
const isTest = process.env["isTest"];
|
||||||
|
|
|
||||||
2
dist/pre/index.js.map
vendored
2
dist/pre/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,14 +1,24 @@
|
||||||
import * as cp from "child_process";
|
import * as cp from "child_process";
|
||||||
|
import * as fs from "fs";
|
||||||
import { sleep } from "./setup";
|
import { sleep } from "./setup";
|
||||||
|
|
||||||
export function isArcRunner(): boolean {
|
export function isArcRunner(): boolean {
|
||||||
const runnerUserAgent = process.env["GITHUB_ACTIONS_RUNNER_EXTRA_USER_AGENT"];
|
const runnerUserAgent = process.env["GITHUB_ACTIONS_RUNNER_EXTRA_USER_AGENT"];
|
||||||
|
|
||||||
|
let isARC = false;
|
||||||
|
|
||||||
if (!runnerUserAgent) {
|
if (!runnerUserAgent) {
|
||||||
return false;
|
isARC = false;
|
||||||
|
} else {
|
||||||
|
isARC = runnerUserAgent.includes("actions-runner-controller/");
|
||||||
}
|
}
|
||||||
|
|
||||||
return runnerUserAgent.includes("actions-runner-controller/");
|
return isARC || isSecondaryPod();
|
||||||
|
}
|
||||||
|
|
||||||
|
function isSecondaryPod(): boolean {
|
||||||
|
const workDir = "/__w";
|
||||||
|
return fs.existsSync(workDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRunnerTempDir(): string {
|
function getRunnerTempDir(): string {
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,9 @@ export async function addSummary() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const insightsRow = `<h4><a href="${insights_url}">View Full Runtime Security Report & Recommended Policy</a></h4>`;
|
const insightsRow = `<p><b><a href="${insights_url}">📄 View Full Runtime Security Report & Recommended Policy</a></b></p>`;
|
||||||
|
|
||||||
await core.summary.addSeparator().addRaw(`<h2>StepSecurity Report</h2>`);
|
await core.summary.addSeparator().addRaw(`<h2>🛡 StepSecurity Report</h2>`);
|
||||||
|
|
||||||
tableEntries.sort((a, b) => {
|
tableEntries.sort((a, b) => {
|
||||||
if (a.status === "❌ Blocked" && b.status !== "❌ Blocked") {
|
if (a.status === "❌ Blocked" && b.status !== "❌ Blocked") {
|
||||||
|
|
@ -118,8 +118,9 @@ export async function addSummary() {
|
||||||
tableEntries = tableEntries.slice(0, 3);
|
tableEntries = tableEntries.slice(0, 3);
|
||||||
|
|
||||||
await core.summary.addRaw(`
|
await core.summary.addRaw(`
|
||||||
<p>Preview of the network events that occurred on the GitHub-hosted runner during this workflow run.</p>
|
<blockquote>
|
||||||
<h3>🌐 Network Events</h3>
|
<p>Preview of the outbound network calls during this workflow run.</p></blockquote>
|
||||||
|
<h3>Network Events</h3>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -132,16 +133,16 @@ export async function addSummary() {
|
||||||
${tableEntries
|
${tableEntries
|
||||||
.map(
|
.map(
|
||||||
(entry) => `<tr>
|
(entry) => `<tr>
|
||||||
<td>${entry.process}</td>
|
<td><code>${entry.process}</code></td>
|
||||||
<td>${entry.domain.replace(/\.$/, "")}</td>
|
<td>${entry.domain.replace(/\.$/, "")}</td>
|
||||||
<td>${entry.status}</td>
|
<td>${entry.status}</td>
|
||||||
</tr>`
|
</tr>`
|
||||||
)
|
)
|
||||||
.join("")}
|
.join("")}
|
||||||
<tr>
|
<tr>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
<td>...</td>
|
<td><code>...</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
@ -150,7 +151,7 @@ export async function addSummary() {
|
||||||
|
|
||||||
await core.summary
|
await core.summary
|
||||||
.addRaw(
|
.addRaw(
|
||||||
`<p>Markdown generated by the <a href="https://github.com/step-security/harden-runner">Harden-Runner GitHub Action</a></p>`
|
`<p><i>Markdown generated by the <a href="https://github.com/step-security/harden-runner">Harden-Runner GitHub Action</a>.</i></p>`
|
||||||
)
|
)
|
||||||
.addSeparator()
|
.addSeparator()
|
||||||
.write();
|
.write();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue