From 99623e9df672c15e38900674148f88ec2761a189 Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:24:56 -0500 Subject: [PATCH 1/8] fix: workflow cannot find commit hashes --- .github/workflows/validate_robopages.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate_robopages.yml b/.github/workflows/validate_robopages.yml index 6bc31f5..06b2fd0 100644 --- a/.github/workflows/validate_robopages.yml +++ b/.github/workflows/validate_robopages.yml @@ -48,8 +48,11 @@ jobs: dreadnode/robopages:latest validate --path "$(printf '%q' "$file")" } + # Fetch the base branch to ensure we have the commit history + git fetch origin ${{ github.base_ref }} + # Get changed files, excluding .github directory - changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | \ + changed_files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | \ grep '\.yml$' | grep -v '^.github/' || true) # Validate each changed file From 19fd0747e238b404b631625ed6f9b6ca1d45c580 Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:27:00 -0500 Subject: [PATCH 2/8] chore: test robopage --- .github/workflows/validate_robopages.yml | 1 + .../offensive/information-gathering/amass.yml | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate_robopages.yml b/.github/workflows/validate_robopages.yml index 06b2fd0..5c13794 100644 --- a/.github/workflows/validate_robopages.yml +++ b/.github/workflows/validate_robopages.yml @@ -7,6 +7,7 @@ on: - '!.github/**' branches: - main + - workflow/fix-sha-ref-issues jobs: validate: diff --git a/cybersecurity/offensive/information-gathering/amass.yml b/cybersecurity/offensive/information-gathering/amass.yml index ee29bd8..25ae022 100644 --- a/cybersecurity/offensive/information-gathering/amass.yml +++ b/cybersecurity/offensive/information-gathering/amass.yml @@ -17,7 +17,28 @@ functions: - amass - enum - -brute - - -min-for-recursive + - -min-for-recursive + - '2' + - -d + - ${target} + + amass_test: + description: Perform DNS enumeration and network mapping of systems exposed to the Internet. + parameters: + target: + type: string + description: The URL of the target to scan. + examples: + - https://target.tld + + container: + image: caffix/amass + + cmdline: + - amass + - enum + - -brute + - -min-for-recursive - '2' - -d - ${target} From 066a98991df088b21e09fa105acd82cbfd9d0fba Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:29:14 -0500 Subject: [PATCH 3/8] fix: fetch all history and diff command to use provided SHA vars instead of branch names --- .github/workflows/validate_robopages.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate_robopages.yml b/.github/workflows/validate_robopages.yml index 5c13794..32b6479 100644 --- a/.github/workflows/validate_robopages.yml +++ b/.github/workflows/validate_robopages.yml @@ -19,6 +19,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 + with: + fetch-depth: 0 # Fetch all history + ref: ${{ github.head_ref }} # Checkout the PR branch - name: Set up Docker uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # 3.7.1 @@ -49,11 +52,8 @@ jobs: dreadnode/robopages:latest validate --path "$(printf '%q' "$file")" } - # Fetch the base branch to ensure we have the commit history - git fetch origin ${{ github.base_ref }} - - # Get changed files, excluding .github directory - changed_files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | \ + # Get changed files using GitHub's provided variables + changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | \ grep '\.yml$' | grep -v '^.github/' || true) # Validate each changed file From 189bdf3ff7155ffb0dce34d8b206996974cdd69a Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:31:05 -0500 Subject: [PATCH 4/8] test: revert changes --- .../offensive/information-gathering/amass.yml | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/cybersecurity/offensive/information-gathering/amass.yml b/cybersecurity/offensive/information-gathering/amass.yml index 25ae022..b8d32e0 100644 --- a/cybersecurity/offensive/information-gathering/amass.yml +++ b/cybersecurity/offensive/information-gathering/amass.yml @@ -22,27 +22,6 @@ functions: - -d - ${target} - amass_test: - description: Perform DNS enumeration and network mapping of systems exposed to the Internet. - parameters: - target: - type: string - description: The URL of the target to scan. - examples: - - https://target.tld - - container: - image: caffix/amass - - cmdline: - - amass - - enum - - -brute - - -min-for-recursive - - '2' - - -d - - ${target} - amass_intel: description: Collect open source intelligence for investigation of the target organization. parameters: From a9f0f3de6ad8fe54e9cb3372181aeb5d907a661c Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:37:34 -0500 Subject: [PATCH 5/8] fix: regex handle dir path --- .github/workflows/validate_robopages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate_robopages.yml b/.github/workflows/validate_robopages.yml index 32b6479..d28e143 100644 --- a/.github/workflows/validate_robopages.yml +++ b/.github/workflows/validate_robopages.yml @@ -33,7 +33,7 @@ jobs: validate_file() { local file="$1" - if [[ ! "$file" =~ ^[a-zA-Z0-9_\-./]+\.yml$ ]]; then + if [[ ! "$file" =~ ^([a-zA-Z0-9_\-]+/)*[a-zA-Z0-9_\-]+\.yml$ ]]; then echo "Invalid file path characters: $file" return 1 fi From a2166a85f8d2768762200ee060e1a4f5161fe9b3 Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:39:27 -0500 Subject: [PATCH 6/8] fix: try categories at root --- cybersecurity/offensive/information-gathering/amass.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cybersecurity/offensive/information-gathering/amass.yml b/cybersecurity/offensive/information-gathering/amass.yml index b8d32e0..cd21676 100644 --- a/cybersecurity/offensive/information-gathering/amass.yml +++ b/cybersecurity/offensive/information-gathering/amass.yml @@ -1,5 +1,10 @@ description: The OWASP Amass Project performs network mapping of attack surfaces and external asset discovery using open source information gathering and active reconnaissance techniques. +categories: + - information-gathering + - reconnaissance + - dns-enumeration + functions: amass_enum: description: Perform DNS enumeration and network mapping of systems exposed to the Internet. From 818d077b15b4bba34839a3a9b65abd79e63a0d28 Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:42:12 -0500 Subject: [PATCH 7/8] fix: docker socket not mounted --- .github/workflows/validate_robopages.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate_robopages.yml b/.github/workflows/validate_robopages.yml index d28e143..b6cb54d 100644 --- a/.github/workflows/validate_robopages.yml +++ b/.github/workflows/validate_robopages.yml @@ -45,11 +45,13 @@ jobs: docker pull dreadnode/robopages:latest - # Run validation + # Run validation with Docker socket mounted docker run --rm \ -v $(pwd):/workspace \ + -v /var/run/docker.sock:/var/run/docker.sock \ -w /workspace \ - dreadnode/robopages:latest validate --path "$(printf '%q' "$file")" + --privileged \ + dreadnode/robopages:latest validate --path "$(printf '%q' "$file")" --skip-docker } # Get changed files using GitHub's provided variables From 8cf7a80d40e46afb50718c37e9df6ea2e02ee09a Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:56:21 -0500 Subject: [PATCH 8/8] chore: rm test branch --- .github/workflows/validate_robopages.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/validate_robopages.yml b/.github/workflows/validate_robopages.yml index b6cb54d..9419aa7 100644 --- a/.github/workflows/validate_robopages.yml +++ b/.github/workflows/validate_robopages.yml @@ -7,7 +7,6 @@ on: - '!.github/**' branches: - main - - workflow/fix-sha-ref-issues jobs: validate: