Add IP address search feature with global search box
- Add API endpoint GET /api/scans/by-ip/{ip_address} to retrieve
last 10 scans containing a specific IP
- Add ScanService.get_scans_by_ip() method with ScanIP join query
- Add search box to global navigation header
- Create dedicated search results page at /search/ip
- Update API documentation with new endpoint
This commit is contained in:
@@ -989,6 +989,56 @@ curl -X DELETE http://localhost:5000/api/scans/42 \
|
||||
-b cookies.txt
|
||||
```
|
||||
|
||||
### Get Scans by IP
|
||||
|
||||
Get the last 10 scans containing a specific IP address.
|
||||
|
||||
**Endpoint:** `GET /api/scans/by-ip/{ip_address}`
|
||||
|
||||
**Authentication:** Required
|
||||
|
||||
**Path Parameters:**
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `ip_address` | string | Yes | IP address to search for |
|
||||
|
||||
**Success Response (200 OK):**
|
||||
```json
|
||||
{
|
||||
"ip_address": "192.168.1.10",
|
||||
"scans": [
|
||||
{
|
||||
"id": 42,
|
||||
"timestamp": "2025-11-14T10:30:00Z",
|
||||
"duration": 125.5,
|
||||
"status": "completed",
|
||||
"title": "Production Network Scan",
|
||||
"config_id": 1,
|
||||
"triggered_by": "manual",
|
||||
"created_at": "2025-11-14T10:30:00Z"
|
||||
},
|
||||
{
|
||||
"id": 38,
|
||||
"timestamp": "2025-11-13T10:30:00Z",
|
||||
"duration": 98.2,
|
||||
"status": "completed",
|
||||
"title": "Production Network Scan",
|
||||
"config_id": 1,
|
||||
"triggered_by": "scheduled",
|
||||
"created_at": "2025-11-13T10:30:00Z"
|
||||
}
|
||||
],
|
||||
"count": 2
|
||||
}
|
||||
```
|
||||
|
||||
**Usage Example:**
|
||||
```bash
|
||||
curl -X GET http://localhost:5000/api/scans/by-ip/192.168.1.10 \
|
||||
-b cookies.txt
|
||||
```
|
||||
|
||||
### Compare Scans
|
||||
|
||||
Compare two scans to identify differences in ports, services, and certificates.
|
||||
|
||||
Reference in New Issue
Block a user