You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnf"Cleared {deleted_sources} sources from repo {repo}."
218
217
219
-
@mcp.tool()
220
-
defget_file_contents(
221
-
file_uri: str=Field(description="The file URI to get contents for. The URI scheme is defined as `file://path` and `file://path:region`. Examples of file URI: `file:///path/to/file:1:2:3:4`, `file:///path/to/file`. File URIs optionally contain a region definition that looks like `start_line:start_column:end_line:end_column` which will limit the contents returned to the specified region, for example `file:///path/to/file:1:2:3:4` indicates a file region of `1:2:3:4` which would return the content of the file starting at line 1, column 1 and ending at line 3 column 4. Line and column indices are 1-based, meaning line and column values start at 1. If the region is omitted the full contents of the file will be returned, for example `file:///path/to/file` returns the full contents of `/path/to/file`."),
222
-
database_path: str=Field(description="The path to the CodeQL database.")):
223
-
"""Get the contents of a file URI from a CodeQL database path."""
224
-
225
-
database_path=_resolve_db_path(database_path)
226
-
try:
227
-
# fix up any incorrectly formatted relative path uri
For the repo {{ GLOBALS_repo }} fetch the Python CodeQL database and find all remote flow sources using CodeQL.
34
-
Store the value for CodeQL's 'relative_database_path' in 'codeql_relative_database_path' memory key.
35
33
toolboxes:
36
34
- seclab_taskflows.toolboxes.gh_code_scanning
37
35
- seclab_taskflows.toolboxes.codeql_python
38
-
- seclab_taskflow_agent.toolboxes.memcache
39
36
- task:
40
37
must_complete: true
41
38
exclude_from_context: true
@@ -50,25 +47,21 @@ taskflow:
50
47
model: code_analysis
51
48
must_complete: false
52
49
repeat_prompt: true
53
-
async: true
54
-
async_limit: 5
55
50
max_steps: 100
56
51
name: source analysis
57
52
description: Identify actions that untrusted users are allowed perform the source.
58
53
agents:
59
-
- seclab_taskflows.personalities.auditer
54
+
- seclab_taskflows.personalities.auditor
60
55
user_prompt: |
61
-
Retrieve the contents of the `codeql_relative_database_path` memory key, which represents the relative path to the CodeQL database for the repository {{ GLOBALS_repo }}.
62
-
Using the CodeQL database located at that path, analyze the following source:
63
-
The source is a {{ RESULT_type }} in {{ RESULT_repo }} in the location {{ RESULT_source_location }}.
64
-
Analyze what the source endpoint is for and how it is used.
65
-
Search for relevant code associated with each source.
56
+
Fetch the zipball of the repository {{ GLOBALS_repo }} and use it to analyze the source.
57
+
The source is a {{ RESULT_type }} in {{ RESULT_repo }} in the location {{ RESULT_source_location }} on line {{ RESULT_line }}.
58
+
If the source is in a folder relating to tests or demo code, skip the analysis and update the source entry in the codeql_sqlite database indicating it is not relevant.
59
+
Analyze what the source endpoint is used for.
66
60
If it is a web endpoint, identify the routing path that reaches this source, HTTP method,
67
61
any middlewares used, which roles are allowed to call it.
68
62
Note which kind of authentication is required for that endpoint.
69
63
It is possible that the source does not have require any authentication.
70
64
If authorization is required, note the details.
71
-
Analyze the code and identify if this source could lead to a security vulnerability.
72
65
73
66
Update the source entry in the codeql_sqlite database with your findings.
74
67
## IMPORTANT: General Guidance that ALWAYS applies
0 commit comments