mirror of
https://github.com/cowrie/cowrie.git
synced 2025-07-01 18:07:27 -04:00
Pip check (#1576)
* 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:
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
version: 2
|
version: 2
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
|||||||
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@ -1 +1,2 @@
|
|||||||
|
---
|
||||||
patreon: micheloosterhof
|
patreon: micheloosterhof
|
||||||
|
|||||||
8
.github/workflows/pur.yml
vendored
8
.github/workflows/pur.yml
vendored
@ -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
|
||||||
|
|||||||
29
.github/workflows/tox.yml
vendored
29
.github/workflows/tox.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
|
---
|
||||||
name: Tox
|
name: Tox
|
||||||
|
|
||||||
on:
|
on: # yamllint disable-line rule:truthy
|
||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
@ -11,16 +12,16 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
python-version: [3.6, 3.7, 3.8, 3.9, pypy-3.7]
|
python-version: [3.6, 3.7, 3.8, 3.9, pypy-3.7]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip setuptools wheel
|
python -m pip install --upgrade pip setuptools wheel
|
||||||
python -m pip install -r requirements.txt
|
python -m pip install -r requirements.txt
|
||||||
python -m pip install -r requirements-dev.txt
|
python -m pip install -r requirements-dev.txt
|
||||||
pip install tox-gh-actions
|
pip install tox-gh-actions
|
||||||
- name: Test with tox
|
- name: Test with tox
|
||||||
run: tox
|
run: tox
|
||||||
|
|||||||
@ -13,12 +13,12 @@ formats:
|
|||||||
|
|
||||||
# Build documentation in the docs/ directory with Sphinx
|
# Build documentation in the docs/ directory with Sphinx
|
||||||
sphinx:
|
sphinx:
|
||||||
configuration: docs/conf.py
|
configuration: docs/conf.py
|
||||||
|
|
||||||
# Optionally Python version and requirements required to build your docs
|
# Optionally Python version and requirements required to build your docs
|
||||||
python:
|
python:
|
||||||
version: 3.8
|
version: 3.8
|
||||||
install:
|
install:
|
||||||
- requirements: docs/requirements.txt
|
- requirements: docs/requirements.txt
|
||||||
- method: pip
|
- method: pip
|
||||||
path: .
|
path: .
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
sudo: required
|
sudo: required
|
||||||
group: stable
|
group: stable
|
||||||
dist: bionic
|
dist: bionic
|
||||||
@ -27,7 +28,7 @@ before_script:
|
|||||||
- python setup.py build sdist bdist
|
- python setup.py build sdist bdist
|
||||||
- make -C docs html
|
- make -C docs html
|
||||||
script:
|
script:
|
||||||
- PYTHONPATH=${TRAVIS_BUILD_DIR}/src trial cowrie
|
- PYTHONPATH=${TRAVIS_BUILD_DIR}/src trial cowrie
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
slack:
|
slack:
|
||||||
|
|||||||
10
.yamllint.yml
Normal file
10
.yamllint.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
extends:
|
||||||
|
default
|
||||||
|
|
||||||
|
rules:
|
||||||
|
line-length: disable
|
||||||
|
|
||||||
|
ignore: |
|
||||||
|
.direnv
|
||||||
|
.tox
|
||||||
40
docs/FAQ.rst
40
docs/FAQ.rst
@ -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
|
||||||
|
|||||||
@ -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.
@ -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:
|
||||||
|
|||||||
34
tox.ini
34
tox.ini
@ -2,7 +2,7 @@
|
|||||||
skipsdist = True
|
skipsdist = True
|
||||||
envlist = lint,docs,py36,py37,py38,py39,py310,mypy,pytype,pyre
|
envlist = lint,docs,py36,py37,py38,py39,py310,mypy,pytype,pyre
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
skip_missing_interpreters=True
|
skip_missing_interpreters = True
|
||||||
|
|
||||||
[gh-actions]
|
[gh-actions]
|
||||||
python =
|
python =
|
||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user