Browse Source

links

master
zeus 4 years ago
parent
commit
290e1d83ff
  1. 94
      README.md
  2. BIN
      images/swarmlab-network.png
  3. 6
      install/usr/share/swarmlab.io/sec/project/bin/swarmlab-nmap
  4. 9
      install/usr/share/swarmlab.io/sec/swarmlab-sec

94
README.md

@ -1,27 +1,87 @@
SEC SwarmLab.io # hybrid-sec !
====================
Orchestrate a Swarmlab SEC cluster:
+ Using Docker Compose to replicate production environment on single Docker host ## LabInstance sec
# Single-host with Docker Compose ![alt text](images/swarmlab-network.png "")
See INSTALL
Relevant files: ## Quickstart
This is a quickstart guide of howto use this *LabInstance to deploy Linux sec systems*
### HowTo use it
### Default Configuration
- Working Directory
> /project
- Default user
> docker
- Default password
> docker
- Default password4root
> pass
#### Find lab workers
> ifconfig
>
> nmap -sP 172.130.0.0/24
>
> or
>
> /project/bin/swarmlab-nmap
#### connect to workers
```bash
ssh docker@[IP]
``` ```
Project
├── Dockerfile # Image specification
├── project # Sample program source code #### Create hosts file
│ └── hello_world.c
├── ssh # keys for accessing
│ ├── id_rsa # (could generate your own) ```bash
│ └── id_rsa.pub /project/bin/swarmlab-nmap > /project/hosts
├── .env # General configuration
├── docker-compose.yml # Container orchestration
└── swarmlab-mpi # Commands wrapper ultility
``` ```
---
**NOTE:** copy files to all clients
```bash
while read -r line;
do
scp /project/file docker@$line:/some_dir/file
done < /project/hosts
```
---
---
**MORE INFO**
See
- [sec1](http://docs.swarmlab.io/SwarmLab-HowTos/labs/sec/ex-1_iptables.adoc.html){:target="_blank"}
- http://docs.swarmlab.io/SwarmLab-HowTos/labs/sec/ex-2_iptables.adoc.html
- http://docs.swarmlab.io/SwarmLab-HowTos/labs/sec/ex-3_iptables.adoc.html
- http://docs.swarmlab.io/SwarmLab-HowTos/labs/sec/ex-3a_iptables-flow-chart.adoc.html
---

BIN
images/swarmlab-network.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

6
install/usr/share/swarmlab.io/sec/project/bin/swarmlab-nmap

@ -0,0 +1,6 @@
#/bin/sh
#ip=`nslookup hybrid-mpi_master_1.hybrid-mpi_hybrid-mpi | grep Addr | cut -d':' -f2 | grep -v 127.0.`
ip=`nslookup $NODENAME | grep Addr | cut -d':' -f2 | grep -v 127.0.`
nmap -sn -oG - $ip/24 | grep Up | grep $NODENETWORK | cut -d ' ' -f 2

9
install/usr/share/swarmlab.io/sec/swarmlab-sec

@ -36,6 +36,8 @@ IMAGE_origin="ubuntu:18.04"
bootstrap="sec_bootstrap" bootstrap="sec_bootstrap"
hostnames="auto_update_hosts" hostnames="auto_update_hosts"
hostnames_get="get_hosts" hostnames_get="get_hosts"
NODENAME=${HYBRID_NETWORK}_master_1.${HYBRID_NETWORK}_${HYBRID_NETWORK}
NODENETWORK=${HYBRID_NETWORK}
# shellcheck disable=SC1091 # shellcheck disable=SC1091
#. ./.env #. ./.env
@ -305,6 +307,7 @@ fi
/bin/mkdir -p $Wdir/project /bin/mkdir -p $Wdir/project
/bin/cp -rf $DIR/project/bin $Wdir/project
/bin/cp -f $DIR/project/hello_world.sh $Wdir/project /bin/cp -f $DIR/project/hello_world.sh $Wdir/project
/bin/cp -f $DIR/$bootstrap $Wdir/$bootstrap /bin/cp -f $DIR/$bootstrap $Wdir/$bootstrap
/bin/cp -f $DIR/$hostnames $Wdir/$hostnames /bin/cp -f $DIR/$hostnames $Wdir/$hostnames
@ -327,6 +330,9 @@ services:
master: master:
image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME
privileged: true privileged: true
environment:
- NODENAME=${NODENAME}
- NODENETWORK=${NODENETWORK}
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
user: root user: root
@ -342,6 +348,9 @@ services:
worker: worker:
image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME
privileged: true privileged: true
environment:
- NODENAME=${NODENAME}
- NODENETWORK=${NODENETWORK}
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
user: root user: root

Loading…
Cancel
Save