0
# Server & Synchronization
1
2
Multi-server synchronization and federation capabilities for sharing threat intelligence across MISP instances with comprehensive server management and data exchange controls.
3
4
## Capabilities
5
6
### Server Management
7
8
Manage remote MISP server connections and configurations.
9
10
```python { .api }
11
def servers(self, **kwargs) -> list:
12
"""List configured remote servers."""
13
14
def get_server(self, server_id: Union[int, str]) -> dict:
15
"""Get specific server configuration."""
16
17
def add_server(self, server: Union['MISPServer', dict]) -> dict:
18
"""Add remote server configuration."""
19
20
def update_server(self, server: Union['MISPServer', dict], server_id: Union[int, str] = None) -> dict:
21
"""Update server configuration."""
22
23
def delete_server(self, server_id: Union[int, str]) -> dict:
24
"""Remove server configuration."""
25
26
def test_server(self, server_id: Union[int, str]) -> dict:
27
"""Test connection to remote server."""
28
```
29
30
### Data Synchronization
31
32
Control data exchange and synchronization between MISP instances.
33
34
```python { .api }
35
def server_pull(self, server_id: Union[int, str], **kwargs) -> dict:
36
"""Pull data from remote server."""
37
38
def server_push(self, server_id: Union[int, str], **kwargs) -> dict:
39
"""Push data to remote server."""
40
41
def get_sync_config(self, server_id: Union[int, str]) -> dict:
42
"""Get synchronization configuration."""
43
44
def set_sync_config(self, server_id: Union[int, str], config: dict) -> dict:
45
"""Update synchronization settings."""
46
```
47
48
## Usage Examples
49
50
### Server Configuration
51
52
```python
53
from pymisp import PyMISP, MISPServer
54
55
misp = PyMISP('https://misp.example.com', 'your-api-key')
56
57
# Add remote server
58
server = MISPServer()
59
server.name = "Partner MISP"
60
server.url = "https://partner-misp.com"
61
server.authkey = "partner-api-key"
62
server.push = True
63
server.pull = True
64
65
response = misp.add_server(server)
66
67
# Test connection
68
test_result = misp.test_server(server_id)
69
```
70
71
### Data Synchronization
72
73
```python
74
# Pull recent events from remote server
75
pull_result = misp.server_pull(
76
server_id,
77
timestamp='7d',
78
limit=100
79
)
80
81
# Push specific events to remote server
82
push_result = misp.server_push(
83
server_id,
84
eventid=[1, 2, 3]
85
)
86
```