Skip to content

Commit

Permalink
populated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
h0x0er committed Aug 20, 2024
0 parents commit dfb9a52
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Someone just pushed
---
Someone just pushed, oh no! Here's who did it: {{ payload.sender.login }}.
58 changes: 58 additions & 0 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Basic Tests

on:
workflow_dispatch:

# permissions:
# contents: read

jobs:
overwrite:
if: always()
runs-on: ARMLinuxRunner
steps:
- uses: h0x0er/harden-runner@arm-support
with:
egress-policy: audit
- uses: actions/checkout@v3

- name: echo overwrite
run: echo "## Overwritten" >> README.md

- name: mv overwrite
run: echo "# Replaced" >> README2.md; mv README2.md README.md

egress-test:
if: always()
runs-on: ARMLinuxRunner
steps:
- uses: h0x0er/harden-runner@arm-support
with:
egress-policy: block
disable-sudo: true
allowed-endpoints: |
www.google.com:443
- uses: actions/checkout@v3

- run: curl https://www.google.com
- run: curl https://microsoft.com

disabled-telemetry:
if: always()
runs-on: ARMLinuxRunner
steps:
- uses: h0x0er/harden-runner@arm-support
with:
egress-policy: block
disable-sudo: true
disable-telemetry: true
allowed-endpoints: |
www.google.com:443
- uses: actions/checkout@v3

- run: curl https://www.google.com
- run: curl https://microsoft.com
- run: curl https://youtube.com
- run: curl https://bing.com
34 changes: 34 additions & 0 deletions .github/workflows/tls-basic-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: TLS Basic Tests

on:
workflow_dispatch:

# permissions:
# contents: read

jobs:
dynamic-node:
if: always()
runs-on: ARMLinuxRunner
steps:
- uses: h0x0er/harden-runner@arm-support
with:
egress-policy: audit
- uses: actions/checkout@v3
- run: which node
- uses: actions/setup-node@v4
with:
node-version: "16"

- run: which node

- run: node req.js

owner-mismatch:
if: always()
runs-on: ARMLinuxRunner
steps:
- uses: h0x0er/harden-runner@arm-support
with:
egress-policy: audit
- run: curl -XPOST https://api.github.com/repos/malicious-owner/malicious-repo
88 changes: 88 additions & 0 deletions .github/workflows/tls-github-api-calls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: TLS Github API Calls

on:
workflow_dispatch:

# permissions:
# contents: read

jobs:
issue-create:
permissions:
contents: write
issues: write
if: always()
runs-on: ARMLinuxRunner
steps:
- run: free -m

- uses: h0x0er/harden-runner@arm-support
with:
egress-policy: audit
- uses: actions/checkout@v3
- uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: free -m

create-pr:
permissions:
contents: write
pull-requests: write
if: always()
runs-on: ARMLinuxRunner
steps:
- run: free -m
- uses: h0x0er/harden-runner@arm-support
with:
egress-policy: audit

- uses: actions/checkout@v4
- run: "echo '// changes' >> main.js"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: free -m

comment-on-pr:
permissions:
contents: write
issues: write
pull-requests: write
if: always()
runs-on: ubuntu-24.04
steps:
- uses: h0x0er/harden-runner@arm-support
with:
egress-policy: audit

- uses: actions/checkout@v4

- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Hello world ! :wave:
pr_number: 1

dispatch-workflow:
permissions:
contents: write
actions: write
if: always()
runs-on: ARMLinuxRunner
steps:
- run: free -m
- uses: h0x0er/harden-runner@arm-support
with:
egress-policy: audit

- uses: actions/checkout@v4
- name: Invoke workflow without inputs
uses: benc-uk/workflow-dispatch@v1
with:
workflow: enumeration.yml
- run: free -m
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Integration tests for arm runners
37 changes: 37 additions & 0 deletions req.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const https = require('https');

async function httpsGet(hostname, path, headers) {
return new Promise(async (resolve, reject) => {

const options = {
hostname: hostname,
path: path,
port: 443,
method: 'GET',
headers: headers
};

let body = [];

const req = https.request(options, res => {
res.on('data', chunk => body.push(chunk));
res.on('end', () => {
const data = Buffer.concat(body).toString();
resolve(data);
});
});
req.on('error', e => {
reject(e);
});
req.end();

});

}

result = httpsGet("api.github.com", "/", "");
result.then(function (data) {
console.log(data)
},function (err) {
consoel.log('https request failed',err)
})

0 comments on commit dfb9a52

Please sign in to comment.