-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Aegis | ||
|
||
A Python wrapper/TUI to manage Docker containers for the Aegis project. | ||
|
||
## Installation | ||
|
||
```bash | ||
pip install . |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import yaml | ||
|
||
|
||
def load_profiles(): | ||
with open("aegis/profiles.yaml", "r") as file: | ||
return yaml.safe_load(file)["profiles"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import docker | ||
from questionary import confirm | ||
import os | ||
|
||
client = docker.from_env() | ||
|
||
|
||
def pull_image(image_name): | ||
print(f"Pulling image: {image_name}") | ||
client.images.pull(image_name) | ||
|
||
|
||
def start_container(profile, mount_path=None): | ||
print(f"Starting container: {profile['name']}") | ||
host_network = profile['options'].get('host_networking', False) | ||
default_mount = profile['options'].get('default_mount', '') | ||
|
||
if not mount_path and default_mount: | ||
mount_path = default_mount | ||
|
||
mounts = {} | ||
if mount_path: | ||
src, target = mount_path.split(":") | ||
mounts[src] = {'bind': target, 'mode': 'rw'} | ||
|
||
client.containers.run( | ||
profile['image'], | ||
detach=True, | ||
network_mode="host" if host_network else None, | ||
volumes=mounts, | ||
tty=True, | ||
) | ||
|
||
|
||
def stop_container(container_id): | ||
container = client.containers.get(container_id) | ||
container.stop() | ||
container.remove() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
profiles: | ||
- name: "Dev" | ||
image: "fonalex45/aegis:dev" | ||
description: "Container for offensive security tools." | ||
options: | ||
host_networking: false | ||
default_mount: "./projects:/workspace" | ||
- name: "Main" | ||
image: "fonalex45/aegis:latest" | ||
description: "Container for offensive security tools." | ||
options: | ||
host_networking: true | ||
default_mount: "./projects:/workspace" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
docker==7.1.0 | ||
tqdm==4.67.0 | ||
questionary==2.0.1 | ||
pycryptodome==3.21.0 | ||
fabric==3.2.2 | ||
paramiko==3.5.0 | ||
paramiko-jump==0.1.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name="aegis", | ||
version="0.2.0", | ||
packages=find_packages(), | ||
install_requires=[ | ||
"docker==7.1.0", | ||
"tqdm==4.67.0", | ||
"questionary==2.0.1", | ||
"pycryptodome==3.18.0", | ||
"fabric==3.2.2", | ||
"paramiko==3.5.0", | ||
"paramiko-jump==0.1.3", | ||
"pyyaml==6.0", | ||
], | ||
entry_points={ | ||
"console_scripts": [ | ||
"aegis=aegis.main:main" | ||
] | ||
}, | ||
python_requires=">=3.6", | ||
) |