Skip to content

Commit 4a63cda

Browse files
authored
Add tls-inspection capability (#368)
1 parent dece111 commit 4a63cda

12 files changed

+264
-74
lines changed

.github/workflows/canary.yml

+6
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ jobs:
4141
env:
4242
PAT: ${{ secrets.PAT }}
4343
canary: true
44+
45+
- name: Canary TLS test
46+
uses: docker://ghcr.io/step-security/integration-test/int:latest
47+
env:
48+
PAT: ${{ secrets.PAT }}
49+
canary-tls: true

.github/workflows/recurring-int-tests.yml

+15
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,18 @@ jobs:
2222
env:
2323
PAT: ${{ secrets.PAT }}
2424
canary: true
25+
26+
int-tls-tests:
27+
name: int tls tests
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Harden Runner
31+
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895
32+
with:
33+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
34+
35+
- name: Canary test
36+
uses: docker://ghcr.io/step-security/integration-test/int:latest
37+
env:
38+
PAT: ${{ secrets.PAT }}
39+
canary-tls: true

dist/pre/index.js

+132-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pre/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/checksum.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@ import * as core from "@actions/core";
22
import * as crypto from "crypto";
33
import * as fs from "fs";
44

5-
export function verifyChecksum(downloadPath: string) {
5+
export function verifyChecksum(downloadPath: string, is_tls: boolean) {
66
const fileBuffer: Buffer = fs.readFileSync(downloadPath);
77
const checksum: string = crypto
88
.createHash("sha256")
99
.update(fileBuffer)
1010
.digest("hex"); // checksum of downloaded file
1111

12-
const expectedChecksum: string =
12+
let expectedChecksum: string =
1313
"ceb925c78e5c79af4f344f08f59bbdcf3376d20d15930a315f9b24b6c4d0328a"; // checksum for v0.13.5
1414

15+
if (is_tls) {
16+
expectedChecksum =
17+
"204c82116e8c0eebf5409bb2b81aa5d96fe32f0c5abc1cb0364ee70937c32056"; // checksum for tls_agent
18+
}
19+
1520
if (checksum !== expectedChecksum) {
1621
core.setFailed(
1722
`Checksum verification failed, expected ${expectedChecksum} instead got ${checksum}`

src/configs.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const STEPSECURITY_ENV = "agent"; // agent or int
2+
3+
export const STEPSECURITY_API_URL = `https://${STEPSECURITY_ENV}.api.stepsecurity.io/v1`;
4+
5+
export const STEPSECURITY_WEB_URL = "https://app.stepsecurity.io";

src/interfaces.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface Configuration {
99
disable_telemetry: boolean;
1010
disable_sudo: boolean;
1111
disable_file_monitoring: boolean;
12+
is_github_hosted: boolean;
1213
private: string;
1314
}
1415

0 commit comments

Comments
 (0)