https://github.com/ik5/distributed_test
A test i was given to write a distrubuted command and control
https://github.com/ik5/distributed_test
command-and-control distributed golang remote-control
Last synced: 10 months ago
JSON representation
A test i was given to write a distrubuted command and control
- Host: GitHub
- URL: https://github.com/ik5/distributed_test
- Owner: ik5
- License: unlicense
- Created: 2018-12-12T15:24:59.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-12T15:27:26.000Z (about 7 years ago)
- Last Synced: 2025-02-02T07:14:14.127Z (11 months ago)
- Topics: command-and-control, distributed, golang, remote-control
- Language: Go
- Size: 16.6 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.markdown
- License: LICENSE
Awesome Lists containing this project
README
# Scylla Test
The following repository aims to provide a Command and Control (C&C) system
for managing "unlimited" number of servers to perform tasks and report back.
## The idea behind the implementation:
There are three levels of services
0. Dispatcher - CnC server
1. Orchestration - Sends tasks to nodes or sub orchestration servers
3. Nodes - Actual workers that does the code.
### Flow idea
The dispatcher has X Orchestration servers that it knows about, having them
registered and reporting an heartbeat every second to know that they are up.
The Orchestration server has registered X amount of either nodes or additional
orchestration servers.
The server sends heartbeat to the Dispather if it is connected directly to it,
and sends actions to nodes or other orchestration servers.
It gathers all information arrived from all nodes and other orchestration servers
and pass it up to the dispatcher.
The node server is a worker that sends a heartbeat to a known orchestration server
every second, and listen to an action to do.
When an action is given, it execute it, and reports back what was the result.
# How to use
There is the `cmd` directory. It contains `nodes` and `orchestration` sub directories.
The `nodes` directory are the workers nodes described under this readme.
The `orchestration` directory contains the orchestration server described under this readme.
# How I tested
Created the following file:
l: 216
t: 2
{
"check_etc_hosts_has_8888": {
"path": "/etc/hosts",
"type": "file_contains",
"check": "8.8.8.8"
},
"check_log_file_exists": {
"path": "/var/log/messages.log",
"type": "file_exists"
}
}
Then used netcat like so:
nc 127.0.0.2:8082 < test.request