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

Method update_network_profile

network_intelligence.py:238–262  ·  view source on GitHub ↗

Update network profile information

(self, network_id: str)

Source from the content-addressed store, hash-verified

236 self.logger.error(f"Error scheduling resolution check: {e}")
237
238 def update_network_profile(self, network_id: str):
239 """Update network profile information"""
240 try:
241 if network_id not in self.network_profiles:
242 self.network_profiles[network_id] = {
243 'first_seen': datetime.now().isoformat(),
244 'connection_count': 0,
245 'total_vulnerabilities': 0,
246 'total_credentials': 0,
247 'active_vulnerabilities': 0,
248 'active_credentials': 0
249 }
250
251 profile = self.network_profiles[network_id]
252 profile['last_seen'] = datetime.now().isoformat()
253 profile['connection_count'] += 1
254
255 # Update counts
256 profile['active_vulnerabilities'] = len(self.active_vulnerabilities.get(network_id, {}))
257 profile['active_credentials'] = len(self.active_credentials.get(network_id, {}))
258
259 self.save_intelligence_data()
260
261 except Exception as e:
262 self.logger.error(f"Error updating network profile: {e}")
263
264 def add_vulnerability(self, host: str, port: int, service: str, vulnerability: str,
265 severity: str = "medium", details: Optional[Dict] = None) -> Optional[str]:

Callers 4

add_vulnerabilityMethod · 0.95
add_credentialMethod · 0.95
resolve_findingMethod · 0.95

Calls 3

errorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected