MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / delete_scan

Method delete_scan

advanced_vuln_scanner.py:6036–6066  ·  view source on GitHub ↗

Delete a scan and its findings from memory and database

(self, scan_id: str)

Source from the content-addressed store, hash-verified

6034 except Exception as e:
6035 return (False, f"Failed to set CSA method: {str(e)}")
6036
6037 # Create and configure user
6038 try:
6039 user_resp = self._zap_api_call('JSON/users/action/newUser', {
6040 'contextId': context_id,
6041 'name': 'script_user'
6042 })
6043 user_id = user_resp.get('userId')
6044 except Exception as e:
6045 return (False, f"Failed to create user for script auth: {str(e)}")
6046
6047 if not user_id:
6048 return (False, "Failed to create user - no user ID returned")
6049
6050 # Set credentials
6051 try:
6052 self._zap_api_call('JSON/users/action/setAuthenticationCredentials', {
6053 'contextId': context_id,
6054 'userId': user_id,
6055 'authCredentialsConfigParams': urllib.parse.urlencode({
6056 'username': username,
6057 'password': password,
6058 })
6059 })
6060 except Exception as e:
6061 return (False, f"Failed to set script auth credentials: {str(e)}")
6062
6063 # Enable user
6064 try:
6065 self._zap_api_call('JSON/users/action/setUserEnabled', {
6066 'contextId': context_id,
6067 'userId': user_id,
6068 'enabled': 'true'
6069 })

Callers 1

Calls 6

get_connectionMethod · 0.80
cursorMethod · 0.80
commitMethod · 0.80
infoMethod · 0.80
errorMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected