Skip to content

Commit 2fdf63e

Browse files
Merge pull request #1421 from ygalnezri/master
New Analyzer & Update Responders Watcher
2 parents 8081a3d + d5e66a9 commit 2fdf63e

File tree

15 files changed

+1420
-337
lines changed

15 files changed

+1420
-337
lines changed

analyzers/Watcher/README.md

Lines changed: 101 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,133 @@
1-
# [Watcher](https://github.com/thalesgroup-cert/Watcher)
1+
# [Watcher](https://github.com/thalesgroup-cert/Watcher) Analyzer
22

3-
## Watcher Check Domain Analyzer
3+
## Watcher Analyzer
44

55
### Description
6-
The Watcher Check Domain Analyzer is an Analyzer for TheHive/Cortex that checks if a given domain is already being monitored in the Watcher website monitoring system.
6+
Watcher Analyzer for TheHive/Cortex enables comprehensive domain presence checking across both Watcher modules:
7+
- **Legitimate Domain Module** (`/api/common/legitimate_domains/`) - Check legitimate/repurchased domains
8+
- **Website Monitoring Module** (`/api/site_monitoring/site/`) - Check monitored suspicious/malicious domains
9+
10+
The analyzer checks both modules simultaneously and provides a unified result.
11+
12+
---
713

814
### Features
9-
- **Check if a domain is monitored**: Verifies whether a specific domain is already being monitored in the Watcher system.
15+
16+
#### Watcher_Check
17+
Check if a domain is monitored in one or both Watcher modules and retrieve a unified status and details:
18+
19+
**From Legitimate Domain Module:**
20+
- Domain name
21+
- Ticket ID
22+
- Repurchased status (Yes/No)
23+
- Contact email
24+
- Creation/update timestamps
25+
26+
**From Website Monitoring Module:**
27+
- Domain name
28+
- Ticket ID
29+
- Legitimacy score (2-6)
30+
- IP addresses (primary, secondary)
31+
- MX records
32+
- Mail server IP
33+
- Takedown request status
34+
- Legal team notification status
35+
- Blocking request status
36+
- Creation/update timestamps
37+
38+
---
1039

1140
### Prerequisites
1241
- Access to the Watcher API
1342
- A valid API key for Watcher
1443
- A functional instance of Cortex and TheHive
1544

45+
---
46+
1647
### Installation
17-
- Add the configuration files for this analyzer to your Cortex configuration.
48+
49+
Add the configuration file to the Cortex configurations.
50+
51+
---
1852

1953
### Configuration
20-
In Cortex, configure the following parameters for the Analyzer:
2154

22-
| Parameter | Description | Required | Default Value |
23-
|--------------------|--------------------------------------------------------------------|----------|----------------|
24-
| `watcher_url` | URL of Watcher (e.g. `https://example.watcher.local:9002`) | Yes | - |
25-
| `watcher_api_key` | API key for authenticating | Yes | - |
55+
Configure the following parameters in Cortex:
2656

27-
### Usage
28-
When a domain artifact is submitted to this analyzer, it will:
29-
1. Query the Watcher API to check if the domain is already monitored.
30-
2. Return a report with either the monitoring status of the domain or an indication that it is not yet monitored.
57+
| Parameter | Description | Type | Required |
58+
|-------------------|--------------------------------------------------------------------|--------|----------|
59+
| `watcher_url` | Base URL of Watcher instance (e.g., `https://watcher.local:9002`) | String | Yes |
60+
| `watcher_api_key` | API authentication token for Watcher | String | Yes |
3161

32-
### Example JSON Response
33-
#### Domain is already monitored
62+
**Example Configuration:**
3463
```json
3564
{
36-
"status": "Monitored",
37-
"Message": "Domain 'example.com' is already monitored in Watcher.",
38-
"ticket_id": "12345"
65+
"watcher_url": "https://watcher.example.com:9002",
66+
"watcher_api_key": "your-api-token-here"
3967
}
4068
```
4169

42-
#### Domain is not monitored
43-
```json
44-
{
45-
"status": "Not Monitored",
46-
"Message": "Domain 'example.com' is not monitored in Watcher. You can add it using the Watcher responder."
47-
}
70+
---
71+
72+
### Usage
73+
74+
#### Check Domain Presence
75+
1. In TheHive, create a domain observable: `example.com`
76+
2. Run analyzer: **Watcher_Check**
77+
3. View results with one of four possible taxonomies:
78+
- `Watcher:Check = FoundOnBoth` (green) - Domain found in both modules
79+
- `Watcher:Check = FoundOnLegitDomain` (green) - Domain found in Legitimate Domain only
80+
- `Watcher:Check = FoundOnWebsiteMonitoring` (green) - Domain found in Website Monitoring only
81+
- `Watcher:Check = NotFound` (blue) - Domain not found in any module
82+
83+
---
84+
85+
### API Endpoints Used
86+
87+
#### Legitimate Domain Module
4888
```
89+
GET /api/common/legitimate_domains/?search={domain}
90+
```
91+
92+
#### Website Monitoring Module
93+
```
94+
GET /api/site_monitoring/site/
95+
```
96+
97+
---
98+
99+
### Taxonomies
100+
101+
The analyzer uses a unified taxonomy system:
102+
103+
| Analyzer | Namespace | Predicate | Values | Colors |
104+
|-----------------|-----------|-----------|-------------------------------------------------------------------------------------------|---------------------|
105+
| **Watcher_Check** | Watcher | Check | FoundOnBoth / FoundOnLegitDomain / FoundOnWebsiteMonitoring / NotFound | safe / safe / safe / info |
106+
107+
**Examples in TheHive:**
108+
- `Watcher:Check = "MonitoredOnBoth"` (Green badge) - Found in both modules
109+
- `Watcher:Check = "MonitoredOnLegitDomain"` (Green badge) - Found in Legitimate Domain only
110+
- `Watcher:Check = "MonitoredOnWebsiteMonitoring"` (Green badge) - Found in Website Monitoring only
111+
- `Watcher:Check = "None"` (Blue badge) - Not found in any module
112+
113+
---
114+
115+
### Best Practices
49116

50-
### Template Setup in TheHive
117+
1. **Single analyzer approach** - One analyzer checks both modules simultaneously
118+
2. **Use results** to trigger appropriate responders based on the status
119+
3. **Template files** provide rich visual feedback in TheHive interface with detailed information from both modules when available
51120

52-
To customize the display of analyzer results in TheHive, you can use **analyzer templates**.
121+
---
53122

54-
Follow these steps to install the templates for the `Watcher_CheckDomain` analyzer:
123+
### Support
55124

56-
1. Navigate to **TheHive** web interface
57-
2. Go to **Admin** > **Entities Management** > **Analyzer templates**
58-
3. Click on **Import templates**
59-
4. Browse to the template directory
60-
5. Select both `short.html` and `long.html` files
61-
6. Click **Import**
62-
7. Make sure the templates are correctly associated with the `Watcher_CheckDomain` analyzer
125+
For issues, questions, or feature requests:
126+
- **GitHub Issues**: [Watcher Repository](https://github.com/thalesgroup-cert/Watcher/issues)
63127

64-
Once done, TheHive will use these templates to display the analyzer output with better readability and style.
128+
---
65129

66-
### Author
130+
### Authors
67131

68132
**Thales Group CERT** - [thalesgroup-cert on GitHub](https://github.com/thalesgroup-cert)
69133
**Ygal NEZRI** - [@ygalnezri](https://github.com/ygalnezri)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "Watcher_Check",
3+
"version": "1.0",
4+
"author": "THA-CERT // YNE",
5+
"url": "https://github.com/thalesgroup-cert/Watcher",
6+
"license": "AGPL-V3",
7+
"description": "Check if a domain is monitored in Watcher (Legitimate Domain and/or Website Monitoring modules) and retrieve all details.",
8+
"dataTypeList": ["domain"],
9+
"command": "Watcher/watcher.py",
10+
"baseConfig": "Watcher",
11+
"configurationItems": [
12+
{
13+
"name": "watcher_url",
14+
"description": "URL of Watcher instance.",
15+
"type": "string",
16+
"required": true
17+
},
18+
{
19+
"name": "watcher_api_key",
20+
"description": "API key for authenticating requests to Watcher",
21+
"type": "string",
22+
"required": true
23+
}
24+
]
25+
}

analyzers/Watcher/Watcher_CheckDomain.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)