* add pip check/pip install to verify recommend config actually works
* add yamllint because too much yaml now
* add FAQ's
This commit is contained in:
Michel Oosterhof
2021-06-09 13:37:10 +08:00
committed by GitHub
parent 90386933e5
commit 2a68eacb69
12 changed files with 101 additions and 46 deletions

View File

@ -1,3 +1,4 @@
---
version: 2 version: 2
workflows: workflows:
version: 2 version: 2

1
.github/FUNDING.yml vendored
View File

@ -1 +1,2 @@
---
patreon: micheloosterhof patreon: micheloosterhof

View File

@ -34,6 +34,14 @@ jobs:
pur -r requirements.txt pur -r requirements.txt
pur -r requirements-dev.txt pur -r requirements-dev.txt
pur --skip csirtgsdk -r requirements-output.txt pur --skip csirtgsdk -r requirements-output.txt
- name: pip install
run: |
pip install --upgrade -r requirements.txt
pip install --upgrade -r requirements-dev.txt
pip install --upgrade -r requirements-output.txt
- name: pip check
run: |
pip check
- name: git diff - name: git diff
run: | run: |
git diff git diff

View File

@ -1,6 +1,7 @@
---
name: Tox name: Tox
on: on: # yamllint disable-line rule:truthy
- push - push
- pull_request - pull_request

View File

@ -1,3 +1,4 @@
---
sudo: required sudo: required
group: stable group: stable
dist: bionic dist: bionic

10
.yamllint.yml Normal file
View File

@ -0,0 +1,10 @@
---
extends:
default
rules:
line-length: disable
ignore: |
.direnv
.tox

View File

@ -15,3 +15,43 @@ time and effort. Cowrie tries to provide most common commands used by attackers
of the honeypot. If you see attackers use a command that you'd like of the honeypot. If you see attackers use a command that you'd like
to see implemented, please let us know, or send a pull request. to see implemented, please let us know, or send a pull request.
How do I add or modify the default user?
****************************************
The default Cowrie users is called `phil` these days. Having the same
user always available is an easy way to identify Cowrie so it's recommend to change
this setup. You can modify it by doing the following::
$ vi honeyfs/etc/passwd
And edit the userid. Then::
$ bin/fsctl share/cowrie/fs.pickle
fs.pickle:/$ mv /home/phil /home/joe
And then restart Cowrie::
$ bin/cowrie restart
How do I add files to the file system?
**************************************
The file system meta data is stored in the pickle file. The file
contents is stored in the `honeyfs` directory. To add a file, the
minimum action is to modify the pickle file. Doing this makes the
file show up in `ls` and other commands. But it won't have any
contents available. To add file contents, you'll need a file to
honeyfs.
First add a file system entry, the `1024` here is the file size. The
`chown` commands only takes numerical uid's, they should match
entries in `honeyfs/etc/passwd`::
$ bin/fsctl share/cowrie/fs.pickle
fs.pickle:/$ touch /home/phil/myfile 1024
fs.pickle:/$ chown 1000:1000 /home/phil/myfile
Then create or copy a file in the `honeyfs`::
$ cp myfile /honeyfs/home/phil

View File

@ -4,14 +4,17 @@ importlib_metadata==4.0.1; python_version<'3.8'
mypy-extensions==0.4.3; platform_python_implementation=='CPython' mypy-extensions==0.4.3; platform_python_implementation=='CPython'
mypy-zope==0.3.0; platform_python_implementation=='CPython' mypy-zope==0.3.0; platform_python_implementation=='CPython'
mypy==0.812; platform_python_implementation=='CPython' mypy==0.812; platform_python_implementation=='CPython'
pathspec==0.8.1
pipdeptree==2.0.0 pipdeptree==2.0.0
pre-commit==2.12.1 pre-commit==2.12.1
pur==5.4.0 pur==5.4.0
pyre-check==0.9.0 pyre-check==0.9.0
pytype==2021.4.15; platform_python_implementation=='CPython' pytype==2021.4.15; platform_python_implementation=='CPython'
pyupgrade==2.13.0 pyupgrade==2.13.0
pyyaml==5.4.1
setuptools==56.0.0 setuptools==56.0.0
sphinx-copybutton==0.3.1 sphinx-copybutton==0.3.1
sphinx_rtd_theme==0.5.2 sphinx_rtd_theme==0.5.2
tox==3.23.0 tox==3.23.0
twistedchecker==0.7.4 twistedchecker==0.7.4
yamllint==1.26.1

Binary file not shown.

View File

@ -142,8 +142,10 @@ pages for more information and options.
% len(packages) % len(packages)
) )
self.write("Need to get %s.2kB of archives.\n" % (totalsize)) self.write("Need to get %s.2kB of archives.\n" % (totalsize))
self.write("After this operation, {:.1f}kB of additional disk space will be used.\n".format( self.write(
totalsize * 2.2) "After this operation, {:.1f}kB of additional disk space will be used.\n".format(
totalsize * 2.2
)
) )
i = 1 i = 1
for p in packages: for p in packages:

32
tox.ini
View File

@ -10,7 +10,7 @@ python =
3.7: py37 3.7: py37
3.8: py38 3.8: py38
3.9: py39 3.9: py39
3.9: lint, docs, mypy, pytype, pyre 3.9: lint, docs, typing
pypy-3.7: pypy3 pypy-3.7: pypy3
[travis] [travis]
@ -19,7 +19,7 @@ python =
3.7: py37 3.7: py37
3.8: py38 3.8: py38
3.9: py39 3.9: py39
3.9: lint, docs, mypy, pytype, pyre 3.9: lint, docs, typing
3.10: py310 3.10: py310
pypy3: pypy3 pypy3: pypy3
@ -33,15 +33,20 @@ deps =
commands = commands =
trial cowrie trial cowrie
[testenv:lint] [testenv:lint]
deps = deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt -r{toxinidir}/requirements-dev.txt
allowlist_externals =
yamllint
commands = commands =
flake8 --ignore E203,E501,W503 --count --statistics {toxinidir}/src flake8 --ignore E203,E501,W503 --count --statistics {toxinidir}/src
- twistedchecker -d W9002,W9202,W9204,W9208,W9402,C0301,C0103,W9001,C9302,W9401 {toxinidir}/src - twistedchecker -d W9002,W9202,W9204,W9208,W9402,C0301,C0103,W9001,C9302,W9401 {toxinidir}/src
yamllint {toxinidir}
basepython = python3.9 basepython = python3.9
[testenv:docs] [testenv:docs]
setenv = setenv =
PYTHONPATH = {toxinidir}/src PYTHONPATH = {toxinidir}/src
@ -53,8 +58,9 @@ commands =
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
basepython = python3.9 basepython = python3.9
[testenv:mypy]
description = run Mypy (static type checker) [testenv:typing]
description = run static type checkers
deps = deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
@ -66,23 +72,5 @@ commands =
--config-file="{toxinidir}/mypy.ini" \ --config-file="{toxinidir}/mypy.ini" \
{tty:--pretty:} \ {tty:--pretty:} \
{posargs:src} {posargs:src}
[testenv:pytype]
description = run Pytype (static type checker)
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt
commands =
- pytype --keep-going --jobs auto - pytype --keep-going --jobs auto
[testenv:pyre]
description = run Pyre (static type checker)
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt
commands =
- pyre --noninteractive analyze - pyre --noninteractive analyze