-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
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 tagsGET /api/3/tags/{id}- Get tag detailsPOST /api/3/tags- Create tagPUT /api/3/tags/{id}- Update tagDELETE /api/3/tags/{id}- Delete tagGET /api/3/tags/{id}/assets- Get tagged assetsPUT /api/3/tags/{id}/assets- Set tagged assetsGET /api/3/tags/{id}/asset_groups- Get tagged asset groupsPUT /api/3/tags/{id}/asset_groups- Set tagged asset groupsPOST /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