Skip to content

Commit 74804f7

Browse files
authored
Merge pull request #101 from pineapaul/sandbox
Threat Library and MITRE Integration
2 parents 6bf52a7 + d99bcc3 commit 74804f7

File tree

19 files changed

+3687
-1
lines changed

19 files changed

+3687
-1
lines changed
Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
# Information Assets Linking in Threat Library
2+
3+
## Overview
4+
5+
The Threat Library now includes comprehensive linking capabilities with Information Assets, allowing security teams to establish direct relationships between threats and the assets they could potentially impact. This feature enhances risk assessment and provides better visibility into threat exposure across the organization.
6+
7+
## Features
8+
9+
### 1. **Information Assets Column in DataTable**
10+
- **New Column**: Added "Information Assets" column to the main threats table
11+
- **Visual Display**: Shows linked assets as green tags with asset names
12+
- **Tooltip Support**: Hover over tags to see full asset details including category and type
13+
- **Truncation**: Displays first 2 assets with "+X more" indicator for additional assets
14+
15+
### 2. **Enhanced Add Threat Modal**
16+
- **Asset Selection**: Users can select multiple information assets when creating custom threats
17+
- **Checkbox Interface**: Clean, intuitive selection with asset details displayed
18+
- **Asset Information**: Shows asset name, category, type, and criticality level
19+
- **Validation**: Ensures proper linking between threats and assets
20+
21+
### 3. **MITRE ATTACK Integration Enhancement**
22+
- **Two-Step Process**:
23+
1. Select MITRE technique from the framework
24+
2. Choose affected information assets
25+
- **Asset Selection Modal**: Dedicated modal for selecting assets after technique selection
26+
- **Context Preservation**: Shows selected technique details during asset selection
27+
- **Streamlined Workflow**: Efficient import process with asset linking
28+
29+
### 4. **Database Schema Updates**
30+
- **New Field**: Added `informationAssets` array to threats collection
31+
- **Array Structure**: Contains array of information asset IDs
32+
- **Backward Compatibility**: Existing threats automatically get empty array
33+
- **Data Population**: API automatically populates asset details when fetching threats
34+
35+
## Technical Implementation
36+
37+
### Database Schema
38+
39+
```typescript
40+
interface Threat {
41+
// ... existing fields
42+
informationAssets: string[] // Array of information asset IDs
43+
}
44+
45+
interface InformationAsset {
46+
id: string
47+
informationAsset: string
48+
category: string
49+
type: string
50+
criticality: string
51+
}
52+
```
53+
54+
### API Endpoints
55+
56+
#### 1. **GET /api/information-assets/list**
57+
- **Purpose**: Fetch available information assets for selection
58+
- **Response**: Simplified asset list with essential fields
59+
- **Authentication**: Required
60+
- **Use Case**: Populate asset selection dropdowns
61+
62+
#### 2. **Enhanced POST /api/threats**
63+
- **New Field**: Accepts `informationAssets` array
64+
- **Validation**: Ensures array format
65+
- **Storage**: Stores asset IDs in threats collection
66+
67+
#### 3. **Enhanced GET /api/threats**
68+
- **Population**: Automatically populates asset details
69+
- **Performance**: Efficient batch loading of asset information
70+
- **Response**: Includes full asset objects with threat data
71+
72+
### Frontend Components
73+
74+
#### 1. **Asset Selection Interface**
75+
- **Checkbox Grid**: Organized asset selection with detailed information
76+
- **Search & Filter**: Easy asset discovery (future enhancement)
77+
- **Visual Feedback**: Clear indication of selected assets
78+
79+
#### 2. **Asset Display Components**
80+
- **Tag System**: Green tags for information assets
81+
- **Tooltip Integration**: Rich information on hover
82+
- **Responsive Design**: Adapts to different screen sizes
83+
84+
#### 3. **Modal Workflow**
85+
- **Add Threat Modal**: Integrated asset selection
86+
- **MITRE Import Modal**: Two-step asset selection process
87+
- **State Management**: Proper form state handling
88+
89+
## Usage Instructions
90+
91+
### Creating Custom Threats with Asset Linking
92+
93+
1. **Open Add Threat Modal**
94+
- Click "Add Threat" button
95+
- Fill in threat details (name, description, category, severity)
96+
97+
2. **Select Information Assets**
98+
- Scroll to "Information Assets" section
99+
- Check boxes for affected assets
100+
- See asset details (name, category, type, criticality)
101+
102+
3. **Complete Threat Creation**
103+
- Add tags and other metadata
104+
- Click "Add Threat" to save
105+
106+
### Importing MITRE Techniques with Asset Linking
107+
108+
1. **Open MITRE Import Modal**
109+
- Click "Import from MITRE" button
110+
- Use filters to find relevant techniques
111+
112+
2. **Select Technique**
113+
- Click "Select Assets" button on desired technique
114+
- Review technique details in confirmation modal
115+
116+
3. **Choose Affected Assets**
117+
- Select information assets from the list
118+
- Review selections and asset details
119+
120+
4. **Complete Import**
121+
- Click "Import Threat" to create threat with asset links
122+
123+
### Viewing Asset Links
124+
125+
1. **Main Table View**
126+
- See linked assets as green tags in "Information Assets" column
127+
- Hover over tags for detailed information
128+
129+
2. **Export Functionality**
130+
- CSV export includes asset information
131+
- Asset names separated by semicolons
132+
133+
## Migration and Setup
134+
135+
### Database Migration
136+
137+
Run the migration script to update existing threats:
138+
139+
```bash
140+
npm run migrate-threats
141+
```
142+
143+
This script:
144+
- Adds `informationAssets` field to existing threats
145+
- Sets default value as empty array
146+
- Maintains data integrity
147+
- Provides migration verification
148+
149+
### Verification Steps
150+
151+
1. **Check Migration Results**
152+
- Verify all threats have `informationAssets` field
153+
- Confirm field is properly initialized as empty array
154+
155+
2. **Test Asset Linking**
156+
- Create new threat with asset selection
157+
- Import MITRE technique with asset linking
158+
- Verify links appear in main table
159+
160+
3. **Validate Data Display**
161+
- Check asset tags render correctly
162+
- Verify tooltip information
163+
- Test CSV export functionality
164+
165+
## Future Enhancements
166+
167+
### 1. **Advanced Asset Filtering**
168+
- **Search Functionality**: Find assets by name, category, or type
169+
- **Criticality Filtering**: Filter by asset criticality level
170+
- **Department Grouping**: Organize assets by business unit
171+
172+
### 2. **Bulk Operations**
173+
- **Mass Asset Linking**: Link multiple threats to assets simultaneously
174+
- **Asset Impact Analysis**: View all threats affecting specific assets
175+
- **Risk Scoring**: Calculate risk scores based on asset criticality
176+
177+
### 3. **Reporting and Analytics**
178+
- **Asset Exposure Reports**: Identify most vulnerable assets
179+
- **Threat Distribution**: Analyze threat patterns across asset types
180+
- **Risk Heat Maps**: Visual representation of asset-threat relationships
181+
182+
### 4. **Integration Features**
183+
- **Asset Management Systems**: Sync with external asset databases
184+
- **Risk Management Tools**: Export data for risk assessment platforms
185+
- **Compliance Reporting**: Generate compliance reports with asset context
186+
187+
## Security Considerations
188+
189+
### 1. **Access Control**
190+
- **Authentication Required**: All asset operations require valid session
191+
- **Authorization Checks**: Users can only access authorized assets
192+
- **Audit Logging**: Track asset selection and modification
193+
194+
### 2. **Data Validation**
195+
- **Input Sanitization**: Prevent injection attacks
196+
- **Asset ID Validation**: Ensure valid asset references
197+
- **Array Size Limits**: Prevent excessive asset linking
198+
199+
### 3. **Privacy Protection**
200+
- **Asset Information**: Display only necessary asset details
201+
- **User Permissions**: Respect asset access restrictions
202+
- **Data Encryption**: Secure asset data in transit and storage
203+
204+
## Troubleshooting
205+
206+
### Common Issues
207+
208+
#### 1. **Assets Not Loading**
209+
- Check database connection
210+
- Verify information-assets collection exists
211+
- Check user authentication status
212+
213+
#### 2. **Asset Selection Not Working**
214+
- Verify JavaScript console for errors
215+
- Check form state management
216+
- Ensure proper event handling
217+
218+
#### 3. **Migration Failures**
219+
- Verify MongoDB connection string
220+
- Check database permissions
221+
- Review migration script logs
222+
223+
### Debug Steps
224+
225+
1. **Check Browser Console**
226+
- Look for JavaScript errors
227+
- Verify API responses
228+
- Check network requests
229+
230+
2. **Verify Database State**
231+
- Confirm threats collection structure
232+
- Check information-assets collection
233+
- Validate data relationships
234+
235+
3. **Test API Endpoints**
236+
- Verify authentication
237+
- Check response formats
238+
- Validate error handling
239+
240+
## Support and Maintenance
241+
242+
### Regular Maintenance
243+
244+
1. **Data Validation**
245+
- Periodic checks for orphaned asset references
246+
- Validation of asset-threat relationships
247+
- Cleanup of invalid links
248+
249+
2. **Performance Monitoring**
250+
- Monitor API response times
251+
- Check database query performance
252+
- Optimize asset population queries
253+
254+
3. **User Training**
255+
- Provide guidance on asset selection
256+
- Explain linking best practices
257+
- Document workflow procedures
258+
259+
### Contact Information
260+
261+
For technical support or feature requests:
262+
- **Development Team**: Submit issues through project repository
263+
- **Documentation**: Refer to this document and related guides
264+
- **Training**: Contact security team for user training sessions
265+
266+
---
267+
268+
*This documentation covers the Information Assets Linking feature as implemented in the Threat Library. For additional information or support, please refer to the main project documentation or contact the development team.*

0 commit comments

Comments
 (0)