Skip to content

[Sprint 5] Implement Tags API Module #75

@talltechy

Description

@talltechy

Overview

Implement comprehensive Tags API module following v2.0 BaseAPI pattern for asset and asset group tagging.

Scope

  • Full CRUD operations for tags
  • Dynamic tag criteria management
  • Static tag management
  • Asset tagging operations
  • Asset group tagging operations
  • Search by tags
  • 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/tags - List all tags
  • GET /api/3/tags/{id} - Get tag details
  • POST /api/3/tags - Create tag
  • PUT /api/3/tags/{id} - Update tag
  • DELETE /api/3/tags/{id} - Delete tag
  • GET /api/3/tags/{id}/assets - Get tagged assets
  • PUT /api/3/tags/{id}/assets - Set tagged assets
  • GET /api/3/tags/{id}/asset_groups - Get tagged asset groups
  • PUT /api/3/tags/{id}/asset_groups - Set tagged asset groups
  • POST /api/3/tags/search - Search tags

Implementation Checklist

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

Key Features

  • Tag Types: Static (manual) and dynamic (criteria-based)
  • Dynamic Criteria: Auto-tag based on asset properties, vulnerabilities, etc.
  • Scope: Apply to assets, asset groups, sites
  • Search: Find assets/groups by tag
  • Color Coding: Visual organization in UI
  • Helper Methods: create_dynamic_tag(), tag_asset(), untag_asset(), find_by_name()

Tag Use Cases

  • Environment: Production, development, staging
  • Location: Data center, cloud provider, region
  • Compliance: PCI, HIPAA, SOX
  • Risk Level: Critical, high, medium, low
  • Custom: Organization-specific categorization

Estimated Size

~350-400 lines of code

Definition of Done

  • TagAPI module implemented with all endpoints
  • Integrated with InsightVMClient as client.tags
  • 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
  • Related Modules: src/rapid7/api/assets.py, src/rapid7/api/asset_groups.py

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions