-
Notifications
You must be signed in to change notification settings - Fork 4
Add advisory support #54
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
Changes from all commits
a618b14
26f6d3d
ef5f389
7276a2d
250186f
f1ba721
9ec009c
35e41ee
94cd6f3
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,11 @@ | ||
| # SPDX-FileCopyrightText: GitHub, Inc. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| seclab-taskflow-agent: | ||
| filetype: prompt | ||
| version: "1.0" | ||
| prompt: | | ||
| ## Known Security Advisories for this Repository | ||
|
|
||
| Fetch the security advisories for {{ globals.repo }} from memcache (stored under the key 'security_advisories_{{ globals.repo }}'). If the value in the memcache is null or an error message, clearly state that no advisories are available and skip advisory analysis. Otherwise, state how many advisories were found. | ||
| Review these advisories and consider them when identifying security risks. If you identify code that is similar to a known advisory pattern, highlight that connection. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ model_config: seclab_taskflows.configs.model_config | |
|
|
||
| globals: | ||
| repo: | ||
| use_advisory: | ||
| # Taskflow to audit some potential issues. | ||
| taskflow: | ||
| - task: | ||
|
|
@@ -17,7 +18,7 @@ taskflow: | |
| - seclab_taskflow_agent.personalities.assistant | ||
| model: general_tasks | ||
| user_prompt: | | ||
| Fetch the component issues in {{ globals.repo }}. | ||
| Fetch all component issues for the repo {{ globals.repo }} using the get_component_issues_for_repo tool. | ||
| toolboxes: | ||
| - seclab_taskflows.toolboxes.repo_context | ||
| - task: | ||
|
|
@@ -29,20 +30,24 @@ taskflow: | |
| - seclab_taskflows.personalities.web_application_security_expert | ||
| model: code_analysis | ||
| user_prompt: | | ||
| The issue is in repo {{ result.repo }} with id {{ result.issue_id }}. The component is under the directory | ||
| The issue is in repo {{ result.repo }} with id {{ result.issue_id }}. The component is under the directory | ||
| {{ result.location }} with component_id {{ result.component_id }}. The notes of the component is: | ||
|
|
||
| {{ result.component_notes }} | ||
|
|
||
| You should use this to understand the intended purpose of the component and take it into account when | ||
| You should use this to understand the intended purpose of the component and take it into account when | ||
| you audit the issue. | ||
|
|
||
| The type of the issue is {{ result.issue_type }} and here is the notes of the issue: | ||
|
|
||
| {{ result.issue_notes }} | ||
|
|
||
| {% if globals.use_advisory == 'true' %} | ||
| {% include 'seclab_taskflows.prompts.audit.known_security_advisories' %} | ||
| {% endif %} | ||
|
|
||
| {% include 'seclab_taskflows.prompts.audit.audit_issue' %} | ||
|
Comment on lines
+46
to
49
|
||
| toolboxes: | ||
| - seclab_taskflows.toolboxes.repo_context | ||
| - seclab_taskflows.toolboxes.local_file_viewer | ||
|
|
||
| - seclab_taskflow_agent.toolboxes.memcache | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||
| # SPDX-FileCopyrightText: GitHub, Inc. | ||||||
| # SPDX-License-Identifier: MIT | ||||||
|
|
||||||
| seclab-taskflow-agent: | ||||||
| filetype: taskflow | ||||||
| version: "1.0" | ||||||
|
|
||||||
| model_config: seclab_taskflows.configs.model_config | ||||||
|
|
||||||
| globals: | ||||||
| repo: | ||||||
|
|
||||||
| # Example taskflow to fetch and review security advisories for a repository | ||||||
| taskflow: | ||||||
| - task: | ||||||
| must_complete: true | ||||||
| exclude_from_context: false | ||||||
| agents: | ||||||
| - seclab_taskflow_agent.personalities.assistant | ||||||
| model: general_tasks | ||||||
| user_prompt: | | ||||||
| Fetch all GitHub Security Advisories (GHSAs) for the repo {{ globals.repo }}. | ||||||
|
|
||||||
| If an error occurs during fetching, store the error message in memcache under the key 'security_advisories_{{ globals.repo }}'. | ||||||
| Ensure the error message starts with "Error:" followed by a description of the error. | ||||||
|
|
||||||
| If fetching is successful, store the list of advisories in memcache under the key 'security_advisories_{{ globals.repo }}'. | ||||||
|
|
||||||
| If one or more advisories are found, provide a summary of the findings including: | ||||||
| 1. How many advisories were found | ||||||
| 2. The severity levels of the advisories | ||||||
| toolboxes: | ||||||
| - seclab_taskflows.toolboxes.ghsa | ||||||
| - seclab_taskflow_agent.toolboxes.memcache | ||||||
| - seclab_taskflows.toolboxes.local_file_viewer | ||||||
| - seclab_taskflows.toolboxes.gh_file_viewer | ||||||
|
Comment on lines
+35
to
+36
|
||||||
| - seclab_taskflows.toolboxes.local_file_viewer | |
| - seclab_taskflows.toolboxes.gh_file_viewer |
Uh oh!
There was an error while loading. Please reload this page.