-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Overview
Implement comprehensive Policies API module following v2.0 BaseAPI pattern for policy compliance assessment and management.
Scope
- List and get policy assessments
- Policy rules and groups management
- Asset compliance results
- Policy overrides management
- Benchmark support (CIS, DISA STIG, etc.)
- 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/policies- List all policiesGET /api/3/policies/{id}- Get policy detailsGET /api/3/policies/{id}/groups- Get policy groupsGET /api/3/policies/{id}/groups/{groupId}- Get group detailsGET /api/3/policies/{id}/groups/{groupId}/rules- Get rules under groupGET /api/3/policies/{id}/rules/{ruleId}- Get rule detailsGET /api/3/policies/{id}/assets/{assetId}- Get asset complianceGET /api/3/policy_overrides- List overridesPOST /api/3/policy_overrides- Create overrideDELETE /api/3/policy_overrides/{id}- Delete override
Implementation Checklist
- Create
src/rapid7/api/policies.py - Implement PolicyAPI class extending BaseAPI
- Add policies sub-client to InsightVMClient
- Create documentation in
docs/POLICIES_API.md - Update Memory Bank (activeContext.md, progress.md)
- Create feature branch:
feature/issue-{number}-policies-api
Key Features
- Policy Types: CIS Benchmarks, DISA STIG, FDCC, USGCB, custom
- Compliance Results: Pass/fail status per rule, overall compliance score
- Rule Hierarchy: Organized into groups and subgroups
- Asset Assessment: Check specific assets against policies
- Overrides: Temporary rule exemptions with justification
- Helper Methods:
get_compliance_summary(),find_failed_rules(),create_override()
Common Policy Benchmarks
- CIS Benchmarks (Windows, Linux, databases)
- DISA STIG (Security Technical Implementation Guides)
- PCI DSS compliance
- HIPAA compliance
- Custom organizational policies
Estimated Size
~500-600 lines of code
Definition of Done
- PolicyAPI module implemented with all endpoints
- Integrated with InsightVMClient as
client.policies - 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 Module:
src/rapid7/api/assets.py