qualys-mcp 2.2.4__py3-none-any.whl → 2.2.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qualys-mcp
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: MCP server for Qualys security APIs - natural language interaction with vulnerability, asset, and cloud security data
5
5
  Project-URL: Homepage, https://github.com/nelssec/qualys-mcp
6
6
  Project-URL: Repository, https://github.com/nelssec/qualys-mcp
@@ -0,0 +1,6 @@
1
+ qualys_mcp.py,sha256=4fr7ukuhKhbfgmItmV8z7xiR-aabYD2SF3glVG9qs9A,34333
2
+ qualys_mcp-2.2.5.dist-info/METADATA,sha256=qxjzE5gwIji4v6f5DsfTZ1hvWPYuhg4_un2AIQkr41s,3295
3
+ qualys_mcp-2.2.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
4
+ qualys_mcp-2.2.5.dist-info/entry_points.txt,sha256=Dc8X0AhJDjGaZOJ0SNpWDWjEX4sYzrYa9FZEbggX0Rs,47
5
+ qualys_mcp-2.2.5.dist-info/licenses/LICENSE,sha256=dW3nC4AX_VbxPAgneSDR-miZPiHgAYw5JhPtdbUEt_E,1091
6
+ qualys_mcp-2.2.5.dist-info/RECORD,,
qualys_mcp.py CHANGED
@@ -597,16 +597,62 @@ def get_asset_risk(asset_id: str) -> dict:
597
597
  return result
598
598
 
599
599
 
600
+ def get_criticality(asset):
601
+ """Extract criticality score from asset"""
602
+ crit = asset.get('criticality')
603
+ if isinstance(crit, dict):
604
+ return crit.get('score', 0) or 0
605
+ return crit or 0
606
+
607
+
600
608
  @mcp.tool()
601
- def get_tech_debt(days_until_eol: int = 0) -> dict:
602
- """Get EOL/EOS operating systems and hardware. Returns sample assets with EOL/EOS status."""
609
+ def get_tech_debt(limit: int = 100) -> dict:
610
+ """Get all EOL/EOS operating systems and hardware, sorted by criticality and risk score."""
603
611
  result = {'os': [], 'hardware': []}
612
+ seen = set()
613
+
614
+ for a in get_eol_assets_by_qql("operatingSystem.lifecycle.stage:`EOL/EOS`", limit * 10):
615
+ aid = a.get('assetId')
616
+ if aid in seen:
617
+ continue
618
+ os_info = a.get('operatingSystem', {}) or {}
619
+ lifecycle = os_info.get('lifecycle', {}) or {}
620
+ stage = lifecycle.get('stage', '')
621
+ if is_eol_stage(stage) and len(result['os']) < limit:
622
+ seen.add(aid)
623
+ result['os'].append({
624
+ 'assetId': aid,
625
+ 'address': a.get('address', ''),
626
+ 'hostname': a.get('dnsHostName', '') or a.get('dnsName', ''),
627
+ 'os': os_info.get('osName', '') or 'Unknown',
628
+ 'stage': stage,
629
+ 'criticality': get_criticality(a),
630
+ 'riskScore': a.get('assetRiskScore') or 0
631
+ })
632
+
633
+ seen.clear()
634
+ for a in get_eol_assets_by_qql("hardware.lifecycle.stage:`EOL/EOS`", limit * 10):
635
+ aid = a.get('assetId')
636
+ if aid in seen:
637
+ continue
638
+ hw_info = a.get('hardware', {}) or {}
639
+ lifecycle = hw_info.get('lifecycle', {}) or {}
640
+ stage = lifecycle.get('stage', '')
641
+ if is_eol_stage(stage) and len(result['hardware']) < limit:
642
+ seen.add(aid)
643
+ result['hardware'].append({
644
+ 'assetId': aid,
645
+ 'address': a.get('address', ''),
646
+ 'hostname': a.get('dnsHostName', '') or a.get('dnsName', ''),
647
+ 'hardware': hw_info.get('model', '') or 'Unknown',
648
+ 'stage': stage,
649
+ 'criticality': get_criticality(a),
650
+ 'riskScore': a.get('assetRiskScore') or 0
651
+ })
604
652
 
605
- samples = get_all_eol_assets(15)
606
- result['os'] = samples['os']
607
- result['hardware'] = samples['hardware']
608
- result['osCount'] = len(samples['os'])
609
- result['hardwareCount'] = len(samples['hardware'])
653
+ result['os'].sort(key=lambda x: (-x['criticality'], -x['riskScore']))
654
+ result['hardware'].sort(key=lambda x: (-x['criticality'], -x['riskScore']))
655
+ result['summary'] = {'osEOL': len(result['os']), 'hardwareEOL': len(result['hardware'])}
610
656
 
611
657
  return result
612
658
 
@@ -1,6 +0,0 @@
1
- qualys_mcp.py,sha256=8Lf5HWF7l7VpSwhnz5iAlwcvIna11Glj83iWXwgqgoU,32424
2
- qualys_mcp-2.2.4.dist-info/METADATA,sha256=tJwDhsTuKqhlUXjMuwlfczvlt-7Cto2nPSAjOknjzDY,3295
3
- qualys_mcp-2.2.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
4
- qualys_mcp-2.2.4.dist-info/entry_points.txt,sha256=Dc8X0AhJDjGaZOJ0SNpWDWjEX4sYzrYa9FZEbggX0Rs,47
5
- qualys_mcp-2.2.4.dist-info/licenses/LICENSE,sha256=dW3nC4AX_VbxPAgneSDR-miZPiHgAYw5JhPtdbUEt_E,1091
6
- qualys_mcp-2.2.4.dist-info/RECORD,,