Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api for running modules #360

Open
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

spiderxm
Copy link
Collaborator

Description

Added an API for getting details of running modules.
This will work when we run our APIs via python ohp.py --start-api-server. But will not work with docker-compose up. For that we need to enable docker in docker to run docker commands from running containers. Looking for its solutions

Motivation and Context

To add a panel in Python-Honepot UI with details of running modules.

Reviewers

@dhirensr

How Has This Been Tested?

It has been tested locally.

GET http://localhost:5001/api/core/running/modules

[
    {
        "Command": "\"/bin/sh -c 'service…\"",
        "CreatedAt": "2022-07-27 21:49:43 +0530 IST",
        "ID": "b5760a5cc113",
        "Image": "ohp_ftpserver_weak_password",
        "Labels": "desktop.docker.io/binds/0/SourceKind=hostFile,desktop.docker.io/binds/0/Target=/root,desktop.docker.io/binds/0/Source=/Users/mrigankanand/PycharmProjects/Python-Honeypot/tmp/ohp_ftp_weak_container/",
        "LocalVolumes": "0",
        "Mounts": "/host_mnt/User…",
        "Names": "ohp_ftpserver_weak_password",
        "Networks": "ohp_internet",
        "Ports": "0.0.0.0:21->21/tcp",
        "RunningFor": "2 hours ago",
        "Size": "3B (virtual 293MB)",
        "State": "running",
        "Status": "Up 2 hours"
    }
]

Screenshots (if appropriate):

Screenshot 2022-07-27 at 11 47 26 PM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other

Checklist

  • I have followed the Contributor Guidelines.
  • The code has been thoroughly tested in my local development environment with flake8 and pylint.
  • The code is Python 3 compatible.
  • The code follows the PEP8 styling guidelines with 4 spaces indentation.
  • I have added the relevant documentation.
  • My branch is up-to-date with the Upstream master branch.

@spiderxm spiderxm requested a review from dhirensr July 27, 2022 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant