* 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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 101 additions and 46 deletions

View File

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

1
.github/FUNDING.yml vendored
View File

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

View File

@ -34,6 +34,14 @@ jobs:
pur -r requirements.txt
pur -r requirements-dev.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
run: |
git diff

View File

@ -1,6 +1,7 @@
---
name: Tox
on:
on: # yamllint disable-line rule:truthy
- push
- pull_request
@ -11,16 +12,16 @@ jobs:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, pypy-3.7]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
pip install tox-gh-actions
- name: Test with tox
run: tox
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
pip install tox-gh-actions
- name: Test with tox
run: tox

View File

@ -13,12 +13,12 @@ formats:
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
configuration: docs/conf.py
# Optionally Python version and requirements required to build your docs
python:
version: 3.8
install:
- requirements: docs/requirements.txt
- method: pip
path: .
version: 3.8
install:
- requirements: docs/requirements.txt
- method: pip
path: .

View File

@ -1,3 +1,4 @@
---
sudo: required
group: stable
dist: bionic
@ -27,7 +28,7 @@ before_script:
- python setup.py build sdist bdist
- make -C docs html
script:
- PYTHONPATH=${TRAVIS_BUILD_DIR}/src trial cowrie
- PYTHONPATH=${TRAVIS_BUILD_DIR}/src trial cowrie
notifications:
email: false
slack:

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
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-zope==0.3.0; platform_python_implementation=='CPython'
mypy==0.812; platform_python_implementation=='CPython'
pathspec==0.8.1
pipdeptree==2.0.0
pre-commit==2.12.1
pur==5.4.0
pyre-check==0.9.0
pytype==2021.4.15; platform_python_implementation=='CPython'
pyupgrade==2.13.0
pyyaml==5.4.1
setuptools==56.0.0
sphinx-copybutton==0.3.1
sphinx_rtd_theme==0.5.2
tox==3.23.0
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)
)
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(
totalsize * 2.2)
self.write(
"After this operation, {:.1f}kB of additional disk space will be used.\n".format(
totalsize * 2.2
)
)
i = 1
for p in packages:

34
tox.ini
View File

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