Skip to content

Commit

Permalink
Merge 7735f29 into 20ecef5
Browse files Browse the repository at this point in the history
  • Loading branch information
xandfury committed Aug 29, 2018
2 parents 20ecef5 + 7735f29 commit cb9363d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 17 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
@@ -1,4 +1,4 @@
FROM python:3
FROM python:3.5

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -22,11 +22,10 @@ RUN pip install --no-cache-dir coverage
RUN pip install --no-cache-dir -r requirements.txt

# Run test cases
RUN tox
RUN tox -e run -- conpot -f --template default
RUN py.test -v

# Install the Conpot application
RUN python setup.py install
RUN python3.5 setup.py install
RUN rm -rf /opt/conpot /tmp/* /var/tmp/*

# Create directories
Expand All @@ -36,4 +35,4 @@ VOLUME /var/log/conpot/

EXPOSE 80 102 161/udp 502 21 69/udp

CMD ["/usr/local/bin/conpot", "--template", "default", "--logfile", "/var/log/conpot/conpot.log"]
CMD ["/usr/local/bin/conpot", "--template", "default", "--logfile", "/var/log/conpot/conpot.log"]
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -18,6 +18,10 @@ The build of the documentations [source](https://github.com/mushorg/conpot/tree/

## Easy install using Docker

![Docker Build Status](https://img.shields.io/docker/build/honeynet/conpot.svg)
![Docket Image Size](https://img.shields.io/microbadger/image-size/honeynet/conpot.svg?style=flat-square)
![Docker Pulls](https://img.shields.io/docker/pulls/honeynet/conpot.svg?style=flat-square)

#### Via a pre-built image

1. Install [Docker](https://docs.docker.com/engine/installation/)
Expand Down
8 changes: 7 additions & 1 deletion bin/conpot
Expand Up @@ -359,7 +359,13 @@ def main():
protocol_name, server_class = protocol
protocol_template = os.path.join(root_template_directory, protocol_name, '{0}.xml'.format(protocol_name))
if os.path.isfile(protocol_template):
xsd_file = os.path.join(package_directory, 'protocols', protocol_name, '{0}.xsd'.format(protocol_name))
if 'kamstrup' in protocol_name:
kamstrup_dir, kamstrup_protocol = os.path.split((protocol_name.replace('_', '/')) + '_protocol')
xsd_file = os.path.join(package_directory, 'protocols', kamstrup_dir, kamstrup_protocol,
'{0}.xsd'.format(protocol_name))
else:
xsd_file = os.path.join(package_directory, 'protocols', protocol_name,
'{0}.xsd'.format(protocol_name))
validate_template(protocol_template, xsd_file)
dom_protocol = etree.parse(protocol_template)
if dom_protocol.xpath('//{0}'.format(protocol_name)):
Expand Down
20 changes: 10 additions & 10 deletions conpot/tests/test_ipmi_server.py
Expand Up @@ -114,16 +114,16 @@ def test_user_list(self):

def test_channel_get_access(self):
result, _ = run_cmd(cmd=['channel', 'getaccess', '1', '3'], port=str(self.ipmi_server.server.server_port))
self.assertEqual(result,
b'Maximum User IDs : 5\n'
b'Enabled User IDs : 3\n\n'
b'User ID : 3\n'
b'User Name : User1\n'
b'Fixed Name : Yes\n'
b'Access Available : call-in / callback\n'
b'Link Authentication : enabled\n'
b'IPMI Messaging : enabled\n'
b'Privilege Level : USER\n')
self.assertIn(b'Maximum User IDs : 5\n'
b'Enabled User IDs : 3\n\n'
b'User ID : 3\n'
b'User Name : User1\n'
b'Fixed Name : Yes\n'
b'Access Available : call-in / callback\n'
b'Link Authentication : enabled\n'
b'IPMI Messaging : enabled\n'
b'Privilege Level : USER\n',
result)

def test_misc(self):
# change the session pass
Expand Down
2 changes: 1 addition & 1 deletion conpot/tests/test_vfs.py
Expand Up @@ -210,7 +210,7 @@ def test_copydir(self):
self.assertEqual(self.test_vfs.getinfo('/data_move', namespaces=['access']).permissions, _perms)
self.assertEqual(self.test_vfs.getinfo('/data_move', namespaces=['access']).user, _user)
self.assertEqual(self.test_vfs.getinfo('/data_move', namespaces=['access']).group, _group)
self.assertEqual(self.test_vfs.listdir('/'), ['data', 'data_move'])
self.assertEqual(set(self.test_vfs.listdir('/')), {'data', 'data_move'})

@freeze_time("2028-07-15 17:51:17")
def test_copyfile(self):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
@@ -1,4 +1,5 @@
gevent>=1.0
cffi
pysnmp
pysmi
lxml
Expand Down

0 comments on commit cb9363d

Please sign in to comment.