-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Gophish Integration #5
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
base: eval-pr-1444-target-1758210056979
Are you sure you want to change the base?
Changes from all commits
60e6ddb
ff13222
9f917b4
1a000fd
6840835
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
type: action | ||
definition: | ||
title: Get campaign | ||
description: Get a campaign from Gophish. | ||
display_group: Gophish | ||
doc_url: https://docs.getgophish.com/api-documentation/campaigns#get-campaigns | ||
namespace: tools.gophish | ||
name: get_campaign | ||
secrets: | ||
- name: gophish | ||
keys: ["GOPHISH_API_KEY"] | ||
expects: | ||
base_url: | ||
type: str | ||
description: The base URL of the Gophish instance. | ||
required: true | ||
campaign_id: | ||
type: int | ||
description: The ID of the campaign to get. | ||
required: true | ||
steps: | ||
- ref: get_campaign | ||
action: core.http_request | ||
args: | ||
url: ${{ inputs.base_url }}/api/campaigns/${{ inputs.campaign_id }} | ||
method: GET | ||
headers: | ||
Authorization: Bearer ${{ SECRETS.gophish.GOPHISH_API_KEY }} | ||
returns: ${{ steps.get_campaign.result.data }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
type: action | ||
definition: | ||
title: Get campaign results | ||
description: Get a campaign's results from Gophish. | ||
display_group: Gophish | ||
doc_url: https://docs.getgophish.com/api-documentation/campaigns#get-campaigns | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doc_url anchor references listing campaigns instead of campaign results; link likely misleading. Prompt for AI agents
[internal] Confidence score: 8/10 [internal] Posted by: General AI Review Agent There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doc_url points to the "get-campaigns" (list campaigns) section, but this action retrieves campaign results; link is likely incorrect. Prompt for AI agents
[internal] Confidence score: 8/10 [internal] Posted by: General AI Review Agent |
||
namespace: tools.gophish | ||
name: get_campaign_results | ||
secrets: | ||
- name: gophish | ||
keys: ["GOPHISH_API_KEY"] | ||
expects: | ||
base_url: | ||
type: str | ||
description: The base URL of the Gophish instance. | ||
required: true | ||
campaign_id: | ||
type: int | ||
description: The ID of the campaign to get results for. | ||
required: true | ||
steps: | ||
- ref: get_campaign_results | ||
action: core.http_request | ||
args: | ||
url: ${{ inputs.base_url }}/api/campaigns/${{ inputs.campaign_id }}/results | ||
method: GET | ||
headers: | ||
Authorization: Bearer ${{ SECRETS.gophish.GOPHISH_API_KEY }} | ||
returns: ${{ steps.get_campaign_results.result.data }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
type: action | ||
definition: | ||
title: List campaigns | ||
description: List campaigns from Gophish. | ||
display_group: Gophish | ||
doc_url: https://docs.getgophish.com/api-documentation/campaigns#get-campaigns | ||
namespace: tools.gophish | ||
name: list_campaigns | ||
secrets: | ||
- name: gophish | ||
keys: ["GOPHISH_API_KEY"] | ||
expects: | ||
base_url: | ||
type: str | ||
description: The base URL of the Gophish instance. | ||
required: true | ||
steps: | ||
- ref: list_campaigns | ||
action: core.http_request | ||
args: | ||
url: ${{ inputs.base_url }}/api/campaigns/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove trailing slash from the endpoint to align with other Gophish commands and avoid potential redirects.
Reasoning: Prompt for AI agents
[internal] Confidence score: 8/10 [internal] Posted by: General AI Review Agent |
||
method: GET | ||
headers: | ||
Authorization: Bearer ${{ SECRETS.gophish.GOPHISH_API_KEY }} | ||
|
||
# This is needed because the API will return results and timelines for all campaigns. This can exeed the max size of workflow data steps very easily. For example a campaign with 1,000 recipients will return 11,000 lines of just results, in addition to the at least 1000 timeline items which are each another 8 lines of data. Very quickly this can exeed the max size of workflow data steps. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo in comment: replace "exeed" with "exceed" (twice) for clarity. Prompt for AI agents
[internal] Confidence score: 10/10 [internal] Posted by: General AI Review Agent There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in comment: "exeed" should be "exceed" (appears twice on this line). Prompt for AI agents
[internal] Confidence score: 10/10 [internal] Posted by: General AI Review Agent |
||
- ref: parse_campaigns_list | ||
action: core.script.run_python | ||
args: | ||
inputs: | ||
data: ${{ steps.list_campaigns.result.data }} | ||
script: | | ||
def main(data): | ||
return [ | ||
{"id": campaign["id"], "name": campaign["name"]} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing whitespace at end of line. Remove to adhere to style and avoid noisy diffs. DEV MODE: This violation would have been filtered out by screening filters. Failing filters: functionalImpact.
Reasoning: Prompt for AI agents
[internal] Confidence score: 9/10 [internal] Posted by: General AI Review Agent |
||
for campaign in data | ||
] | ||
returns: ${{ steps.parse_campaigns_list.result }} |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc_url points to the list endpoint section ("get-campaigns") instead of the single campaign action. Link to the campaigns page root or the correct anchor for single campaign.
Prompt for AI agents
[internal] Confidence score: 8/10
[internal] Posted by: General AI Review Agent