mcp-security icon indicating copy to clipboard operation
mcp-security copied to clipboard

secops MCP tool get_rule_detections is not working

Open BenPerel opened this issue 1 year ago • 1 comments

The secops-soar MCP tool list_events_by_alert is not working as expected either providing the below error or no response for valid rule IDs (perhaps something from the prefix being ru or ur)

Observed behavior

  • The tool returns an error when it uses a rule ID with prefix "ur:

    {
      "error": "Unexpected error: Failed to list detections: {\n  \"error\": {\n    \"code\": 400,\n    \"message\": \"Request contains an invalid argument.\",\n    \"status\": \"INVALID_ARGUMENT\"\n  }\n}\n",
      "detections": []
    }
    
  • Here is the error observed in the vscode window:

    2025-05-20 17:35:14.322 [error] [Window] [Extension Host] Server "secops" stderr: [05/20/25 17:35:14] ERROR     Unexpected error getting rule security_rules.py:202
                               detections for rule                                 
                               ru_19700ab1-6847-4367-815e-f0                       
                               fbd86c248c: Failed to list                          
                               detections: {                                       
                                 "error": {                                         
                                   "code": 404,                                      
                                   "message": "Requested                           
                               entity was not found.",                              
                                   "status": "NOT_FOUND"                            
                                 }                                                 
                               }                                                   
    
                               ╭─ Traceback (most recent c─╮                       
                               │ /Users/bperel/vertexai-te │                       
                               │ sting/gus-mcp/mcp-securit │                       
                               │ y/server/secops/secops_mc │                       
                               │ p/tools/security_rules.py │                       
                               │ :195 in                   │                       
                               │ get_rule_detections       │                       
                               │                           │                       
                               │   192 │   │   │   │   log │                       
                               │         {valid_alert_states │                       
                               │   193 │   │   │   │   rai │                       
                               │         {alert_state}")    │                       
                               │   194 │   │               │                       
                               │ ❱ 195 │   │   detections_ │                       
                               │         page_token)         │                       
                               │   196 │   │               │                       
                               │   197 │   │   return dete │                       
                               │   198 │   except ValueErr │                       
                               │                           │                       
                               │ /Users/bperel/vertexai-te │                       
                               │ sting/gus-mcp/mcp-securit │                       
                               │ y/server/secops/.venv/lib │                       
                               │ /python3.11/site-packages │                       
                               │ /secops/chronicle/client. │                       
                               │ py:932 in list_detections │                       
                               │                           │                       
                               │    929 │   │   │   APIErr │                       
                               │    930 │   │   │   ValueE │                       
                               │    931 │   │   """       │                       
                               │ ❱  932 │   │   return _li │                       
                               │    933 │                 │                       
                               │    934 │   def list_error │                       
                               │    935 │   │   """List ex │                       
                               │                           │                       
                               │ /Users/bperel/vertexai-te │                       
                               │ sting/gus-mcp/mcp-securit │                       
                               │ y/server/secops/.venv/lib │                       
                               │ /python3.11/site-packages │                       
                               │ /secops/chronicle/rule_de │                       
                               │ tection.py:74 in          │                       
                               │ list_detections           │                       
                               │                           │                       
                               │    71 │   response = clie │                       
                               │    72 │                   │                       
                               │    73 │   if response.sta │                       
                               │ ❱  74 │   │   raise APIEr │                       
                               │    75 │                   │                       
                               │    76 │   return response │                       
                               │    77                     │                       
                               ╰───────────────────────────╯                       
                               APIError: Failed to list                            
                               detections: {                                       
                                 "error": {                                         
                                   "code": 404,                                      
                                   "message": "Requested                           
                               entity was not found.",                              
                                   "status": "NOT_FOUND"                            
                                 }                                                 
                               }                                                   
    
  • For reference, this specific example is the NTDS.dit Extraction via Windows Volume Shadow Copy curated detection rule from the Mandiant Intel Emerging Threats rule set with Rule ID: ur_19700ab1-6847-4367-815e-f0fbd86c248c

  • I've also ran this a number of times where I get an empty response for any rule I check, so the tool isn't technically failing, but not querying correctly or providing the correct output. Here are several examples:

  • ru_6bcb3719-8b99-4f9c-87c0-09a685b869f6@v_1745437248_070239000

  • ru_4ef88d80-8382-4fdf-b70e-f39cac0ed32f@v_1745437240_068783000

  • ru_6f61528a-849c-48be-a1fd-8f1aec256696@v_1745437230_999679000


Steps to reproduce

  1. Call the get_rule_detections tool in secops MCP.
  2. Observe the returned error as the response from the model.

BenPerel avatar May 20 '25 23:05 BenPerel

seems to be resolved now with latest version

BenPerel avatar May 23 '25 09:05 BenPerel