README
¶
Faker Service - Armis API Emulator + BGP/BMP Simulator
The faker service emulates the Armis API for testing and reproducing pipeline issues with large datasets. It can also simulate FRR-like BGP activity and export BMP to an Arancini collector for end-to-end ingest testing.
Features
- Generates 25,000 fake devices with unique IPs and metadata
- Emulates Armis API endpoints (
/api/v1/access_token/and/api/v1/search/) - Each device has:
- Unique IP address from different ranges (10.0.x.x, 10.1.x.x, 172.16.x.x, 172.17.x.x, 192.168.x.x)
- Variable number of MAC addresses (1-50, with most having 1-10)
- Armis device metadata (ID, name, type, OS, manufacturer, etc.)
- Supports pagination for large dataset testing
- Consistent responses for reproducible testing
Running Locally
# Build
go build -o faker ./cmd/faker
# Run
./faker
# Server starts on :8080
Running with Docker
# Build the image
docker build -f cmd/faker/Dockerfile -t serviceradar-faker .
# Run the container
docker run -p 8080:8080 serviceradar-faker
Running with Docker Compose
The faker service is defined in docker-compose.dev.yml (dev-only stack):
# Start faker with the dev compose file
docker compose -f docker-compose.dev.yml up faker
# Or start all dev services
docker compose -f docker-compose.dev.yml up
API Endpoints
Get Access Token
curl -X POST http://localhost:8080/api/v1/access_token/
Search Devices
# Get first 100 devices
curl "http://localhost:8080/api/v1/search/?aql=in:devices&length=100&from=0"
# Get next page
curl "http://localhost:8080/api/v1/search/?aql=in:devices&length=100&from=100"
BGP/BMP Simulation (Arancini Path)
This mode is disabled by default and is intended for demo/test environments.
Prerequisites:
gobgpdandgobgpmust be inPATH.- Arancini BMP collector must be reachable at
simulation.bgp.bmp_collector_address.
Enable by setting simulation.bgp.enabled=true in cmd/faker/config.json (or your deployed config).
Key config fields:
simulation.bgp.bmp_collector_address(example:127.0.0.1:11019)simulation.bgp.manage_daemon(true: faker starts/stopsgobgpd,false: faker controls externalgobgpd)simulation.bgp.gobgp_api_address(example:serviceradar-gobgp:50051for external daemon control)simulation.bgp.local_asnandsimulation.bgp.router_idsimulation.bgp.peers(FRR-like defaults are included)simulation.bgp.advertised_prefixes(defaults:23.138.124.0/24,2602:f678::/48)simulation.bgp.publish_interval,outage_interval,outage_duration_min,outage_duration_max
Smoke test flow:
- Start Arancini collector with BMP listen enabled.
- Start faker with BGP simulation enabled.
- Confirm faker logs show route announce/withdraw events and periodic outage windows.
- Confirm Arancini collector logs show incoming BMP session/messages from faker's GoBGP daemon.
Using with Embedded Sync (Agent)
Configure an Armis integration source to point to the faker service:
{
"sources": {
"faker-test": {
"type": "armis",
"endpoint": "http://faker:8080",
"partition": "test",
"credentials": {
"username": "test",
"password": "test"
},
"queries": [
{
"label": "all-devices",
"query": "in:devices",
"sweep_modes": ["icmp", "tcp"]
}
],
"page_size": 1000
}
}
}
Testing Large Datasets
The faker service is designed to help reproduce issues with large datasets:
- Memory Usage: With 25,000 devices, the service uses approximately 20-30MB of memory
- Pagination: Test pagination with different page sizes (100, 500, 1000)
- MAC Address Arrays: Devices have varying numbers of MAC addresses to test array handling
- Consistent Data: Device data is generated deterministically at startup for consistent testing
Debugging Pipeline Issues
To reproduce the sweep.json malformation issue:
- Start the faker service
- Configure the embedded sync runtime (via Integrations UI) to use faker as the Armis endpoint
- Ensure the agent is running so it can fetch all 25,000 devices
- Monitor KV store writes for malformed sweep.json
- Check agent's ability to read the sweep configuration
Performance Characteristics
- Startup: ~1 second to generate 25,000 devices
- Memory: ~30MB for 25,000 devices in memory
- Response time: < 10ms for paginated queries
- Max page size: 1000 devices per request
Click to show internal directories.
Click to hide internal directories.