Skip to content

[Sprint 3] Implement Scan Templates API Module #69

@talltechy

Description

@talltechy

Overview

Implement comprehensive Scan Templates API module following v2.0 BaseAPI pattern for managing scan configuration templates.

Scope

  • Full CRUD operations for scan templates
  • Template discovery settings management
  • Service and vulnerability check configuration
  • Performance settings management
  • Credential assignment to templates
  • 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/scan_templates - List scan templates
  • GET /api/3/scan_templates/{id} - Get template details
  • POST /api/3/scan_templates - Create template
  • PUT /api/3/scan_templates/{id} - Update template
  • DELETE /api/3/scan_templates/{id} - Delete template
  • GET /api/3/scan_templates/{id}/discovery - Get discovery settings
  • PUT /api/3/scan_templates/{id}/discovery - Update discovery
  • GET /api/3/scan_templates/{id}/service_discovery - Get service discovery
  • PUT /api/3/scan_templates/{id}/service_discovery - Update service discovery

Implementation Checklist

  • Create src/rapid7/api/scan_templates.py
  • Implement ScanTemplateAPI class extending BaseAPI
  • Add scan_templates sub-client to InsightVMClient
  • Create documentation in docs/SCAN_TEMPLATES_API.md
  • Update Memory Bank (activeContext.md, progress.md)
  • Create feature branch: feature/issue-{number}-scan-templates-api

Key Features

  • Template Types: Discovery, full audit, policy, web
  • Discovery Options: TCP/UDP port scanning, ICMP ping, service fingerprinting
  • Performance: Parallel scans, packet rate, scan delay
  • Vulnerability Checks: Enable/disable specific checks, categories
  • Credentials: Assign authentication credentials to templates
  • Helper Methods: create_from_builtin(), clone_template()

Estimated Size

~450-500 lines of code

Definition of Done

  • ScanTemplateAPI module implemented with all endpoints
  • Integrated with InsightVMClient as client.scan_templates
  • Documented with usage examples
  • Memory Bank updated
  • PR created and ready for review

References

  • Context7 API Documentation: /riza/rapid7-insightvm-api-docs
  • BaseAPI Pattern: src/rapid7/api/base.py
  • Similar Implementation: src/rapid7/api/sites.py

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions