Skip to content

Conversation

cubic-dev-local[bot]
Copy link

## Description

Created an integration for Gophish which is an Open-Source Phishing Framework.
Created all commands and documented that are in the API Docs: https://docs.getgophish.com/api-documentation/

List of Commands:

Namespace Function Secrets
tools.gophish create_campaign gophish
tools.gophish create_group gophish
tools.gophish create_landing_page gophish
tools.gophish create_sending_profile gophish
tools.gophish create_template gophish
tools.gophish delete_campaign gophish
tools.gophish delete_group gophish
tools.gophish delete_landing_page gophish
tools.gophish delete_sending_profile gophish
tools.gophish delete_template gophish
tools.gophish get_campaign gophish
tools.gophish get_campaign_results gophish
tools.gophish get_campaign_summary gophish
tools.gophish get_group gophish
tools.gophish get_group_summary gophish
tools.gophish get_landing_page gophish
tools.gophish get_sending_profile gophish
tools.gophish get_template gophish
tools.gophish list_campaigns gophish
tools.gophish list_groups gophish
tools.gophish list_groups_summary gophish
tools.gophish list_landing_pages gophish
tools.gophish list_sending_profiles gophish
tools.gophish list_templates gophish
tools.gophish modify_group gophish
tools.gophish modify_landing_page gophish
tools.gophish modify_sending_profile gophish
tools.gophish modify_template gophish

Screenshots / Recordings

image

Steps to QA

Run the following Workflow:
testing-gophish.yaml


Summary by cubic

Adds a full Gophish integration to manage campaigns, groups, landing pages, sending profiles, and templates. Also updates docs and adds a Gophish icon.

  • New Features

    • tools.gophish: CRUD for campaigns, groups, landing pages, sending profiles, and templates; plus campaign results and summary.
    • list_campaigns returns only id and name to avoid oversized responses.
    • Docs: added integration commands and the gophish secret (GOPHISH_API_KEY).
    • UI: added a Gophish icon.
  • Migration

    • Add a gophish secret with GOPHISH_API_KEY.
    • Use your Gophish base_url for all actions.
    • Optional: run testing-gophish.yaml to verify.
---

Based on: TracecatHQ/tracecat#1444

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 3 files

Prompt for AI agents (all 5 issues)

Understand the root cause of the following 5 issues and fix them.


<file name="packages/tracecat-registry/tracecat_registry/templates/tools/gophish/get_campaign_results.yml">

<violation number="1" location="packages/tracecat-registry/tracecat_registry/templates/tools/gophish/get_campaign_results.yml:6">
doc_url points to the campaigns listing docs, not the results endpoint. Update it to the section covering `/api/campaigns/{id}/results` so users land on the correct API reference.</violation>

<violation number="2" location="packages/tracecat-registry/tracecat_registry/templates/tools/gophish/get_campaign_results.yml:29">
The `get_campaign_results` action returns all results without pagination, which is inconsistent with the pattern seen in `list_campaigns` (which trims data) and many other integrations. This can lead to performance issues with large campaigns. Please add pagination support (e.g., a `limit` parameter) to align with established patterns in the repository.</violation>
</file>

<file name="packages/tracecat-registry/tracecat_registry/templates/tools/gophish/list_campaigns.yml">

<violation number="1" location="packages/tracecat-registry/tracecat_registry/templates/tools/gophish/list_campaigns.yml:21">
Trailing slash in URL is inconsistent with other Gophish endpoints; consider removing it for consistency and to avoid potential double slashes.

        DEV MODE: This violation would have been filtered out by GPT-5.
Reasoning:
• **GPT-5**: Trailing slash inconsistency is stylistic; negligible functional risk.</violation>

<violation number="2" location="packages/tracecat-registry/tracecat_registry/templates/tools/gophish/list_campaigns.yml:26">
Spelling: &quot;exeed&quot; should be &quot;exceed&quot; (appears twice).</violation>

<violation number="3" location="packages/tracecat-registry/tracecat_registry/templates/tools/gophish/list_campaigns.yml:35">
Direct key access may raise KeyError if a campaign object lacks id or name. Use .get(...) for safer extraction.

        DEV MODE: This violation would have been filtered out by GPT-5.
Reasoning:
• **GPT-5**: Direct key access is fine given Gophish schema (id and name present). Using .get would hide issues; low impact.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

method: GET
headers:
Authorization: Bearer ${{ SECRETS.gophish.GOPHISH_API_KEY }}
returns: ${{ steps.get_campaign_results.result.data }}
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The get_campaign_results action returns all results without pagination, which is inconsistent with the pattern seen in list_campaigns (which trims data) and many other integrations. This can lead to performance issues with large campaigns. Please add pagination support (e.g., a limit parameter) to align with established patterns in the repository.

Prompt for AI agents
Address the following comment on packages/tracecat-registry/tracecat_registry/templates/tools/gophish/get_campaign_results.yml at line 29:

<comment>The `get_campaign_results` action returns all results without pagination, which is inconsistent with the pattern seen in `list_campaigns` (which trims data) and many other integrations. This can lead to performance issues with large campaigns. Please add pagination support (e.g., a `limit` parameter) to align with established patterns in the repository.</comment>

<file context>
@@ -0,0 +1,29 @@
+        method: GET
+        headers:
+          Authorization: Bearer ${{ SECRETS.gophish.GOPHISH_API_KEY }}
+  returns: ${{ steps.get_campaign_results.result.data }}
</file context>

[internal] Confidence score: 9/10

[internal] Posted by: System Design Agent

Fix with Cubic

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
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 18, 2025

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 campaigns listing docs, not the results endpoint. Update it to the section covering /api/campaigns/{id}/results so users land on the correct API reference.

Prompt for AI agents
Address the following comment on packages/tracecat-registry/tracecat_registry/templates/tools/gophish/get_campaign_results.yml at line 6:

<comment>doc_url points to the campaigns listing docs, not the results endpoint. Update it to the section covering `/api/campaigns/{id}/results` so users land on the correct API reference.</comment>

<file context>
@@ -0,0 +1,29 @@
+  title: Get campaign results
+  description: Get a campaign&#39;s results from Gophish.
+  display_group: Gophish
+  doc_url: https://docs.getgophish.com/api-documentation/campaigns#get-campaigns
+  namespace: tools.gophish
+  name: get_campaign_results
</file context>

[internal] Confidence score: 7/10

[internal] Posted by: General AI Review Agent

Fix with Cubic

- ref: list_campaigns
action: core.http_request
args:
url: ${{ inputs.base_url }}/api/campaigns/
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing slash in URL is inconsistent with other Gophish endpoints; consider removing it for consistency and to avoid potential double slashes.

    DEV MODE: This violation would have been filtered out by GPT-5.

Reasoning:
GPT-5: Trailing slash inconsistency is stylistic; negligible functional risk.

Prompt for AI agents
Address the following comment on packages/tracecat-registry/tracecat_registry/templates/tools/gophish/list_campaigns.yml at line 21:

<comment>Trailing slash in URL is inconsistent with other Gophish endpoints; consider removing it for consistency and to avoid potential double slashes.

        DEV MODE: This violation would have been filtered out by GPT-5.
Reasoning:
• **GPT-5**: Trailing slash inconsistency is stylistic; negligible functional risk.</comment>

<file context>
@@ -0,0 +1,38 @@
+    - ref: list_campaigns
+      action: core.http_request
+      args:
+        url: ${{ inputs.base_url }}/api/campaigns/
+        method: GET
+        headers:
</file context>

[internal] Confidence score: 6/10

[internal] Posted by: General AI Review Agent

Fix with Cubic

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.
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling: "exeed" should be "exceed" (appears twice).

Prompt for AI agents
Address the following comment on packages/tracecat-registry/tracecat_registry/templates/tools/gophish/list_campaigns.yml at line 26:

<comment>Spelling: &quot;exeed&quot; should be &quot;exceed&quot; (appears twice).</comment>

<file context>
@@ -0,0 +1,38 @@
+        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.
+    - ref: parse_campaigns_list
+      action: core.script.run_python
</file context>

[internal] Confidence score: 10/10

[internal] Posted by: General AI Review Agent

Suggested change
# 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.
# This is needed because the API will return results and timelines for all campaigns. This can exceed 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 exceed the max size of workflow data steps.
Fix with Cubic

script: |
def main(data):
return [
{"id": campaign["id"], "name": campaign["name"]}
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct key access may raise KeyError if a campaign object lacks id or name. Use .get(...) for safer extraction.

    DEV MODE: This violation would have been filtered out by GPT-5.

Reasoning:
GPT-5: Direct key access is fine given Gophish schema (id and name present). Using .get would hide issues; low impact.

Prompt for AI agents
Address the following comment on packages/tracecat-registry/tracecat_registry/templates/tools/gophish/list_campaigns.yml at line 35:

<comment>Direct key access may raise KeyError if a campaign object lacks id or name. Use .get(...) for safer extraction.

        DEV MODE: This violation would have been filtered out by GPT-5.
Reasoning:
• **GPT-5**: Direct key access is fine given Gophish schema (id and name present). Using .get would hide issues; low impact.</comment>

<file context>
@@ -0,0 +1,38 @@
+        script: |
+          def main(data):
+            return [
+                {&quot;id&quot;: campaign[&quot;id&quot;], &quot;name&quot;: campaign[&quot;name&quot;]} 
+                for campaign in data
+            ]
</file context>

[internal] Confidence score: 7/10

[internal] Posted by: General AI Review Agent

Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant