You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
2.9 KiB
140 lines
2.9 KiB
= Ασφάλεια Δικτύων και Επικοινωνιών !
|
|
Apostolos rootApostolos@swarmlab.io
|
|
// Metadata:
|
|
:description: Intro and Install
|
|
:keywords: sec, iptables
|
|
:data-uri:
|
|
:toc: right
|
|
:toc-title: Πίνακας περιεχομένων
|
|
:toclevels: 4
|
|
:icons: font
|
|
:source-highlighter: highlight
|
|
:sectnums:
|
|
|
|
|
|
|
|
{empty} +
|
|
|
|
|
|
== Install swarmlab-sec (Home PC)
|
|
|
|
- Install docker +
|
|
http://docs.swarmlab.io/SwarmLab-HowTos/labs/Howtos/docker/install.adoc.html[^]
|
|
|
|
- Clone repo https://git.swarmlab.io:3000/swarmlab/swarmlab-sec[^] +
|
|
|
|
== Usage (swarmlab-sec)
|
|
|
|
|
|
- Open a console
|
|
|
|
- cd to swarmlab-sec
|
|
|
|
- Create a directory
|
|
|
|
```
|
|
cd <dir>
|
|
|
|
../install/usr/share/swarmlab.io/sec/swarmlab-sec
|
|
|
|
create create project (swarmlab-sec create)
|
|
up start swarmlab-sec (swarmlab-sec up size=10)
|
|
scale resize swarmlab-sec (swarmlab-sec scale size=30)
|
|
reload rebuild image (swarmlab-sec reload size=15)
|
|
login login swarmlab-sec (swarmlab-sec login)
|
|
exec execute command (swarmlab-sec exec [SHELL COMMAND])
|
|
down stop swarmlab-sec (swarmlab-sec down)
|
|
clean clean project (swarmlab-sec clean)
|
|
list show instances (swarmlab-sec swarmlab-sec list)
|
|
help show help (swarmlab-sec help)
|
|
```
|
|
|
|
|
|
|
|
[[cheat-swarmlab-create]]
|
|
== Create swarmlab project
|
|
|
|
```
|
|
mkdir myproject
|
|
cd myproject
|
|
../install/usr/share/swarmlab.io/sec/swarmlab-sec create
|
|
```
|
|
.Relevant files:
|
|
```
|
|
Project
|
|
├── Dockerfile # Image specification
|
|
├── project # Sample program source code
|
|
│ └── hello_world.c
|
|
├── ssh # keys for accessing
|
|
│ ├── id_rsa # (could generate your own)
|
|
│ └── id_rsa.pub
|
|
├── docker-compose.yml # Container orchestration
|
|
```
|
|
|
|
[[cheat-swarmlab-up]]
|
|
== Spin up the swarmlab cluster
|
|
|
|
```
|
|
cd myproject
|
|
../install/usr/share/swarmlab.io/sec/swarmlab-sec up size=5
|
|
```
|
|
|
|
|
|
.We built a high-performing, scalable infrastructure
|
|
image:./swarmlab-network.png[alt="Swarmlab"] +
|
|
|
|
|
|
[[cheat-swarmlab-up1]]
|
|
== Login to the swarmlab cluster
|
|
|
|
```
|
|
cd myproject
|
|
../install/usr/share/swarmlab.io/sec/swarmlab-sec login
|
|
```
|
|
|
|
[NOTE]
|
|
====
|
|
When you are inside a container
|
|
[source,bash]
|
|
----
|
|
ssh docker@<IP>
|
|
----
|
|
|
|
User password: docker
|
|
|
|
sudo password: docker
|
|
|
|
====
|
|
|
|
CAUTION: If you don't have the *<IP>* address - you can use the http://docs.swarmlab.io/SwarmLab-HowTos/labs/sec/ex-1_iptables.adoc.html["Scan and network statistics"^] tools.
|
|
|
|
|
|
[[cheat-swarmlab-scale]]
|
|
== Scale cluster in real-time
|
|
|
|
As the cluster running, without having to close the session, open a different terminal and go back to the project directory.
|
|
|
|
```
|
|
cd myproject
|
|
../install/usr/share/swarmlab.io/sec/swarmlab-sec scale size=10
|
|
```
|
|
|
|
[[cheat-swarmlab-down]]
|
|
== shutdown swarmlab-sec cluster
|
|
|
|
|
|
```
|
|
cd myproject
|
|
../install/usr/share/swarmlab.io/sec/swarmlab-sec down
|
|
```
|
|
|
|
:hardbreaks:
|
|
|
|
{empty} +
|
|
{empty} +
|
|
{empty}
|
|
|
|
:!hardbreaks:
|
|
|
|
'''
|
|
|
|
|