Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.9.0 #435

Merged
merged 15 commits into from
Jul 18, 2024
196 changes: 150 additions & 46 deletions README.md

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions dist/pre/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/pre/index.js.map

Large diffs are not rendered by default.

Binary file added images/org-level.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/token-perms-recommendation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/checksum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export function verifyChecksum(downloadPath: string, is_tls: boolean) {
.digest("hex"); // checksum of downloaded file

let expectedChecksum: string =
"ceb925c78e5c79af4f344f08f59bbdcf3376d20d15930a315f9b24b6c4d0328a"; // checksum for v0.13.5
"a9f1842e3d7f3d38c143dbe8ffe1948e6c8173cd04da072d9f9d128bb400844a"; // checksum for v0.13.7

if (is_tls) {
expectedChecksum =
"846ae66c6cfab958fe61736cec0b58bdb7651b36af04c279405c7114675d7033"; // checksum for tls_agent
"e45b85e29216eb1d217aad368bdb056bbd868a308925e7b2cf9133b06ab435d0"; // checksum for tls_agent
}

if (checksum !== expectedChecksum) {
Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface Configuration {
is_github_hosted: boolean;
private: string;
is_debug: boolean;
one_time_key: string;
}

export interface PolicyResponse {
Expand Down
2 changes: 2 additions & 0 deletions src/policy-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ test("merge configs", async () => {
private: "true",
is_github_hosted: true,
is_debug: false,
one_time_key: "",
};
let policyResponse: PolicyResponse = {
owner: "h0x0er",
Expand All @@ -65,6 +66,7 @@ test("merge configs", async () => {
private: "true",
is_github_hosted: true,
is_debug: false,
one_time_key: "",
};

localConfig = mergeConfigs(localConfig, policyResponse);
Expand Down
7 changes: 5 additions & 2 deletions src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { isGithubHosted, isTLSEnabled } from "./tls-inspect";

interface MonitorResponse {
runner_ip_address?: string;
one_time_key?: string;
monitoring_started?: boolean;
}

Expand Down Expand Up @@ -60,6 +61,7 @@ interface MonitorResponse {
private: context?.payload?.repository?.private || false,
is_github_hosted: isGithubHosted(),
is_debug: core.isDebug(),
one_time_key: "",
};

let policyName = core.getInput("policy");
Expand Down Expand Up @@ -200,6 +202,7 @@ interface MonitorResponse {

if (statusCode === 200 && responseData) {
console.log(`Runner IP Address: ${responseData.runner_ip_address}`);
confg.one_time_key = responseData.one_time_key;
addSummary = responseData.monitoring_started ? "true" : "false";
}
} catch (e) {
Expand Down Expand Up @@ -231,12 +234,12 @@ interface MonitorResponse {

if (await isTLSEnabled(context.repo.owner)) {
downloadPath = await tc.downloadTool(
"https://packages.stepsecurity.io/github-hosted/harden-runner_1.2.0_linux_amd64.tar.gz"
"https://packages.stepsecurity.io/github-hosted/harden-runner_1.2.2_linux_amd64.tar.gz"
);
verifyChecksum(downloadPath, true); // NOTE: verifying tls_agent's checksum, before extracting
} else {
downloadPath = await tc.downloadTool(
"https://github.com/step-security/agent/releases/download/v0.13.5/agent_0.13.5_linux_amd64.tar.gz",
"https://github.com/step-security/agent/releases/download/v0.13.7/agent_0.13.7_linux_amd64.tar.gz",
undefined,
auth
);
Expand Down
Loading