From 52c7c8d59133cda1ad52cb1ad663c82ef15726a2 Mon Sep 17 00:00:00 2001 From: Jordan Kasper Date: Wed, 3 Jul 2024 12:26:54 -0400 Subject: [PATCH 01/10] solve the issue with forked PR sources --- .github/workflows/hero-check.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/hero-check.yml b/.github/workflows/hero-check.yml index 7c81ff6..f3b12cf 100644 --- a/.github/workflows/hero-check.yml +++ b/.github/workflows/hero-check.yml @@ -3,26 +3,35 @@ name: Hero Check on: pull_request: branches: [ "main" ] + paths: + - 'open-source-heroes.md' jobs: check-for-hero: runs-on: ubuntu-latest permissions: pull-requests: write + steps: - - name: Checkout Code + - name: Checkout Target uses: actions/checkout@v4 with: repository: jordangov/defcon-poc - # token needss to be able read repo contents, write to PRs, and read secrets - token: ${{secrets.GH_TOKEN}} - fetch-depth: 0 + ref: main + path: target + + - name: Checkout Source + uses: actions/checkout@v4 + with: + path: source + - name: Check Submission id: check_sub run: >- - git fetch origin main; - SUBMISSION=`git diff origin/main..HEAD open-source-heroes.md | awk '/\* @${{github.actor}}/{ print $3 }'`; - echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}}; + pwd; + ls -l; + cd ..; + SUBMISSION=`diff target/open-source-heroes.md source/open-source-heroes.md | awk '/\* @${{github.actor}}/{ print $4 }'`; CHECKSUM=`echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}} | awk '/[a-z0-9]+/{ print $2 }'`; echo "Confirming submission ($SUBMISSION) equals checksum..."; if [[ "$SUBMISSION" = "$CHECKSUM" ]]; then From 90c92030d7b45881f2d10740511426aaad06ff08 Mon Sep 17 00:00:00 2001 From: Jordan Kasper Date: Wed, 3 Jul 2024 12:29:01 -0400 Subject: [PATCH 02/10] testing changes --- open-source-heroes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-source-heroes.md b/open-source-heroes.md index 374193f..4391447 100644 --- a/open-source-heroes.md +++ b/open-source-heroes.md @@ -12,4 +12,4 @@ This is the list of heroes. Add your name to the list below with your GitHub han ## The List * @whitehouse 7e2aac5579f5e3fb61c2ba63f95cfb7a87cb3da8 -* @jordangov 6119660cad1e64ddc93cde48e2d617e3cc00071e +* @jordangov 6119660cad1e64ddc93cde48e2d617e3cc00071ezzz From 0db0ce828211fdc4f7dd87c805085df4b0e15068 Mon Sep 17 00:00:00 2001 From: Jordan Kasper Date: Wed, 3 Jul 2024 12:32:51 -0400 Subject: [PATCH 03/10] correcting for dir locations --- .github/workflows/hero-check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hero-check.yml b/.github/workflows/hero-check.yml index f3b12cf..28bad0f 100644 --- a/.github/workflows/hero-check.yml +++ b/.github/workflows/hero-check.yml @@ -30,10 +30,12 @@ jobs: run: >- pwd; ls -l; - cd ..; + diff target/open-source-heroes.md source/open-source-heroes.md; + SUBMISSION=`diff target/open-source-heroes.md source/open-source-heroes.md | awk '/\* @${{github.actor}}/{ print $4 }'`; CHECKSUM=`echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}} | awk '/[a-z0-9]+/{ print $2 }'`; echo "Confirming submission ($SUBMISSION) equals checksum..."; + if [[ "$SUBMISSION" = "$CHECKSUM" ]]; then echo "Submissions match, they're an open source hero!" echo "RESULT=pass" >> "$GITHUB_OUTPUT"; From 3f4be933711314b24cd708949c854e3bca659259 Mon Sep 17 00:00:00 2001 From: Jordan Kasper Date: Wed, 3 Jul 2024 12:35:43 -0400 Subject: [PATCH 04/10] testing changes --- open-source-heroes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/open-source-heroes.md b/open-source-heroes.md index 4391447..aecf1ce 100644 --- a/open-source-heroes.md +++ b/open-source-heroes.md @@ -12,4 +12,5 @@ This is the list of heroes. Add your name to the list below with your GitHub han ## The List * @whitehouse 7e2aac5579f5e3fb61c2ba63f95cfb7a87cb3da8 -* @jordangov 6119660cad1e64ddc93cde48e2d617e3cc00071ezzz +* @jordangov 6119660cad1e64ddc93cde48e2d617e3cc00071e +* @daneallen 3ea9659b9a58c9a1f7290ef26b7710ddf14b0947 From 376e97c15aa1574f2cb5bbafc5dda3ba14db47b1 Mon Sep 17 00:00:00 2001 From: Jordan Kasper Date: Wed, 3 Jul 2024 12:46:44 -0400 Subject: [PATCH 05/10] trying to solve exit code 1 --- .github/workflows/hero-check.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/hero-check.yml b/.github/workflows/hero-check.yml index 28bad0f..f81521c 100644 --- a/.github/workflows/hero-check.yml +++ b/.github/workflows/hero-check.yml @@ -28,23 +28,20 @@ jobs: - name: Check Submission id: check_sub run: >- - pwd; - ls -l; - diff target/open-source-heroes.md source/open-source-heroes.md; - SUBMISSION=`diff target/open-source-heroes.md source/open-source-heroes.md | awk '/\* @${{github.actor}}/{ print $4 }'`; CHECKSUM=`echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}} | awk '/[a-z0-9]+/{ print $2 }'`; echo "Confirming submission ($SUBMISSION) equals checksum..."; - + if [[ "$SUBMISSION" = "$CHECKSUM" ]]; then - echo "Submissions match, they're an open source hero!" + echo "Submissions match" echo "RESULT=pass" >> "$GITHUB_OUTPUT"; echo "MESSAGE='🤩 Wow, you are an open source hero! Find a volunteer with the special White House badge to claim your fame!'" >> "$GITHUB_OUTPUT"; else - echo "Submissions do not match, need to try again." + echo "Submissions do not match" echo "RESULT=fail" >> "$GITHUB_OUTPUT"; echo "MESSAGE='😔 Sorry, but that is not the right hash. Have you found all of the clues?'" >> "$GITHUB_OUTPUT"; fi + - name: Post Message uses: actions/github-script@v7 with: From a9c1476573d7d2c8ef41eaca27b4374cf6a63684 Mon Sep 17 00:00:00 2001 From: Jordan Kasper Date: Wed, 3 Jul 2024 12:49:53 -0400 Subject: [PATCH 06/10] trying to solve exit code 1 --- .github/workflows/hero-check.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hero-check.yml b/.github/workflows/hero-check.yml index f81521c..62dbdbf 100644 --- a/.github/workflows/hero-check.yml +++ b/.github/workflows/hero-check.yml @@ -29,10 +29,10 @@ jobs: id: check_sub run: >- SUBMISSION=`diff target/open-source-heroes.md source/open-source-heroes.md | awk '/\* @${{github.actor}}/{ print $4 }'`; - CHECKSUM=`echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}} | awk '/[a-z0-9]+/{ print $2 }'`; - echo "Confirming submission ($SUBMISSION) equals checksum..."; + CHECK=`echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}} | awk '/[a-z0-9]+/{ print $2 }'`; + echo "Confirming submission ($SUBMISSION) equals check ($CHECK)..."; - if [[ "$SUBMISSION" = "$CHECKSUM" ]]; then + if [[ "$SUBMISSION" = "$CHECK" ]]; then echo "Submissions match" echo "RESULT=pass" >> "$GITHUB_OUTPUT"; echo "MESSAGE='🤩 Wow, you are an open source hero! Find a volunteer with the special White House badge to claim your fame!'" >> "$GITHUB_OUTPUT"; @@ -40,6 +40,9 @@ jobs: echo "Submissions do not match" echo "RESULT=fail" >> "$GITHUB_OUTPUT"; echo "MESSAGE='😔 Sorry, but that is not the right hash. Have you found all of the clues?'" >> "$GITHUB_OUTPUT"; + + echo "The diff:"; + diff target/open-source-heroes.md source/open-source-heroes.md; fi - name: Post Message From 94f3246007e392154ee48c33ce660ed0b879726f Mon Sep 17 00:00:00 2001 From: Jordan Kasper Date: Wed, 3 Jul 2024 13:24:14 -0400 Subject: [PATCH 07/10] trying to solve exit code 1 --- .github/workflows/hero-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hero-check.yml b/.github/workflows/hero-check.yml index 62dbdbf..e0cabfe 100644 --- a/.github/workflows/hero-check.yml +++ b/.github/workflows/hero-check.yml @@ -28,7 +28,7 @@ jobs: - name: Check Submission id: check_sub run: >- - SUBMISSION=`diff target/open-source-heroes.md source/open-source-heroes.md | awk '/\* @${{github.actor}}/{ print $4 }'`; + SUBMISSION=`(diff target/open-source-heroes.md source/open-source-heroes.md || true) | awk '/\* @${{github.actor}}/{ print $4 }'`; CHECK=`echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}} | awk '/[a-z0-9]+/{ print $2 }'`; echo "Confirming submission ($SUBMISSION) equals check ($CHECK)..."; From cbbc8139ed51d0daef036267ae4f9a8c41f252fc Mon Sep 17 00:00:00 2001 From: Jordan Kasper Date: Wed, 3 Jul 2024 13:33:54 -0400 Subject: [PATCH 08/10] trying to solve exit code 1 --- .github/workflows/hero-check.yml | 3 --- open-source-heroes.md | 1 - 2 files changed, 4 deletions(-) diff --git a/.github/workflows/hero-check.yml b/.github/workflows/hero-check.yml index e0cabfe..dcd3074 100644 --- a/.github/workflows/hero-check.yml +++ b/.github/workflows/hero-check.yml @@ -40,9 +40,6 @@ jobs: echo "Submissions do not match" echo "RESULT=fail" >> "$GITHUB_OUTPUT"; echo "MESSAGE='😔 Sorry, but that is not the right hash. Have you found all of the clues?'" >> "$GITHUB_OUTPUT"; - - echo "The diff:"; - diff target/open-source-heroes.md source/open-source-heroes.md; fi - name: Post Message diff --git a/open-source-heroes.md b/open-source-heroes.md index aecf1ce..374193f 100644 --- a/open-source-heroes.md +++ b/open-source-heroes.md @@ -13,4 +13,3 @@ This is the list of heroes. Add your name to the list below with your GitHub han * @whitehouse 7e2aac5579f5e3fb61c2ba63f95cfb7a87cb3da8 * @jordangov 6119660cad1e64ddc93cde48e2d617e3cc00071e -* @daneallen 3ea9659b9a58c9a1f7290ef26b7710ddf14b0947 From c0a0c865cbddac7e8e2b57de67fe9ba22a9ac8b0 Mon Sep 17 00:00:00 2001 From: Jordan Kasper Date: Wed, 3 Jul 2024 13:35:23 -0400 Subject: [PATCH 09/10] testing with myself --- open-source-heroes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/open-source-heroes.md b/open-source-heroes.md index 1811248..374193f 100644 --- a/open-source-heroes.md +++ b/open-source-heroes.md @@ -12,3 +12,4 @@ This is the list of heroes. Add your name to the list below with your GitHub han ## The List * @whitehouse 7e2aac5579f5e3fb61c2ba63f95cfb7a87cb3da8 +* @jordangov 6119660cad1e64ddc93cde48e2d617e3cc00071e From d55d72622edcccee2e063f25265657bfee172f3e Mon Sep 17 00:00:00 2001 From: Jordan Kasper Date: Wed, 3 Jul 2024 13:40:16 -0400 Subject: [PATCH 10/10] clean up of the changes --- .github/workflows/hero-check.yml | 2 +- open-source-heroes.md | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/hero-check.yml b/.github/workflows/hero-check.yml index dcd3074..40e0363 100644 --- a/.github/workflows/hero-check.yml +++ b/.github/workflows/hero-check.yml @@ -30,7 +30,7 @@ jobs: run: >- SUBMISSION=`(diff target/open-source-heroes.md source/open-source-heroes.md || true) | awk '/\* @${{github.actor}}/{ print $4 }'`; CHECK=`echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}} | awk '/[a-z0-9]+/{ print $2 }'`; - echo "Confirming submission ($SUBMISSION) equals check ($CHECK)..."; + echo "Confirming submission ($SUBMISSION) equals check..."; if [[ "$SUBMISSION" = "$CHECK" ]]; then echo "Submissions match" diff --git a/open-source-heroes.md b/open-source-heroes.md index 374193f..07d7287 100644 --- a/open-source-heroes.md +++ b/open-source-heroes.md @@ -2,14 +2,15 @@ This is the list of heroes. Add your name to the list below with your GitHub handle and the correct hash. -> **INSTRUCTIONS**: You must open a Pull Request to this repository, correctly adding your name to the list below along with the correct hash per the hints you have found elsewhere during DEF CON 32. -> -> PRs will be evaluated automatically by our CI pipeline. In order to be added to the list, your PR **must pass the CI checks**. -> +## INSTRUCTIONS + +Fork this repository, add your name to the list below (**along with the correct hash**), and open a Pull Request to the upstream repository. Your hash is unique to you. Exactly how to generate the hash is the puzzle! Use hints found around DEF CON 32 and on social media to solve it. + +> PRs will be evaluated automatically by our CI pipeline. In order to be added to the list, your PR **must pass the CI check**. +> > Example format: > `* @whitehouse 7e2aac5579f5e3fb61c2ba63f95cfb7a87cb3da8` ## The List * @whitehouse 7e2aac5579f5e3fb61c2ba63f95cfb7a87cb3da8 -* @jordangov 6119660cad1e64ddc93cde48e2d617e3cc00071e