Overview
Implement comprehensive Discovery Connections API module following v2.0 BaseAPI pattern for managing cloud and network discovery connections.
Scope
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
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
Overview
Implement comprehensive Discovery Connections API module following v2.0 BaseAPI pattern for managing cloud and network discovery connections.
Scope
API Endpoints
GET /api/3/discovery_connections- List all connectionsGET /api/3/discovery_connections/{id}- Get connection detailsPOST /api/3/discovery_connections- Create connectionPUT /api/3/discovery_connections/{id}- Update connectionDELETE /api/3/discovery_connections/{id}- Delete connectionGET /api/3/discovery_connections/{id}/status- Get connection statusPOST /api/3/discovery_connections/{id}/connect- Test connectionGET /api/3/discovery_connections/{id}/assets- Get discovered assetsImplementation Checklist
src/rapid7/api/discovery_connections.pydocs/DISCOVERY_CONNECTIONS_API.mdfeature/issue-{number}-discovery-connections-apiKey Features
create_aws_connection(),create_azure_connection(),test_connection()Connection Types
Estimated Size
~350-400 lines of code
Definition of Done
client.discovery_connectionsSecurity Considerations
References
/riza/rapid7-insightvm-api-docssrc/rapid7/api/base.pysrc/rapid7/api/assets.py