Skip to content

[Sprint 6] Implement Discovery Connections API Module #79

@talltechy

Description

@talltechy

Overview

Implement comprehensive Discovery Connections API module following v2.0 BaseAPI pattern for managing cloud and network discovery connections.

Scope

  • AWS cloud connection management
  • Azure cloud connection management
  • Active Directory connection management
  • DHCP/DNS discovery connections
  • Connection testing and validation
  • Helper methods for common workflows
  • Integration with InsightVMClient
  • Comprehensive docstrings with type hints
  • Error handling
  • Unit tests (when test framework ready)

API Endpoints

  • GET /api/3/discovery_connections - List all connections
  • GET /api/3/discovery_connections/{id} - Get connection details
  • POST /api/3/discovery_connections - Create connection
  • PUT /api/3/discovery_connections/{id} - Update connection
  • DELETE /api/3/discovery_connections/{id} - Delete connection
  • GET /api/3/discovery_connections/{id}/status - Get connection status
  • POST /api/3/discovery_connections/{id}/connect - Test connection
  • GET /api/3/discovery_connections/{id}/assets - Get discovered assets

Implementation Checklist

  • Create src/rapid7/api/discovery_connections.py
  • Implement DiscoveryConnectionAPI class extending BaseAPI
  • Add discovery_connections sub-client to InsightVMClient
  • Create documentation in docs/DISCOVERY_CONNECTIONS_API.md
  • Update Memory Bank (activeContext.md, progress.md)
  • Create feature branch: feature/issue-{number}-discovery-connections-api

Key Features

  • Cloud Discovery:
    • AWS: EC2 instances, RDS, ELB
    • Azure: Virtual Machines, SQL Databases
  • Network Discovery:
    • Active Directory: Computer accounts, organizational units
    • DHCP: Active leases, IP ranges
    • DNS: Hostname resolution
  • Auto-Import: Automatically add discovered assets to sites
  • Scheduling: Regular discovery scans
  • Helper Methods: create_aws_connection(), create_azure_connection(), test_connection()

Connection Types

  • AWS: Access key/secret, regions, VPCs
  • Azure: Subscription ID, tenant, credentials
  • Active Directory: LDAP connection, search base
  • DHCP: Server address, scope
  • DNS: Server address, zones

Estimated Size

~350-400 lines of code

Definition of Done

  • DiscoveryConnectionAPI module implemented with all endpoints
  • Integrated with InsightVMClient as client.discovery_connections
  • Documented with usage examples for each connection type
  • Memory Bank updated
  • PR created and ready for review

Security Considerations

  • Cloud credentials securely stored
  • Credential testing before saving
  • Read-only permissions recommended
  • Audit logging for connection changes

References

  • Context7 API Documentation: /riza/rapid7-insightvm-api-docs
  • BaseAPI Pattern: src/rapid7/api/base.py
  • Related Module: src/rapid7/api/assets.py

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions