Skip to content

Commit da83f6e

Browse files
committed
Merge branch 'release/2.1.0'
Release Infection Monkey v2.1.0
2 parents 9eb8f82 + 143056a commit da83f6e

File tree

483 files changed

+20910
-22676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

483 files changed

+20910
-22676
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Add any further explanations here.
1414
## Testing Checklist
1515

1616
* [ ] Added relevant unit tests?
17-
* [ ] Have you successfully tested your changes locally? Elaborate:
17+
* [ ] Do all unit tests pass?
18+
* [ ] Do all end-to-end tests pass?
19+
* [ ] Any other testing performed?
1820
> Tested by {Running the Monkey locally with relevant config/running Island/...}
1921
* [ ] If applicable, add screenshots or log transcripts of the feature working

.pre-commit-config.yaml

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
default_stages: [commit]
22
repos:
33
- repo: https://github.com/pycqa/isort
4-
rev: 5.10.1
4+
rev: 5.12.0
55
hooks:
66
- id: isort
77
name: isort (python)
@@ -12,16 +12,16 @@ repos:
1212
name: isort (pyi)
1313
types: [pyi]
1414
- repo: https://github.com/psf/black
15-
rev: 22.3.0
15+
rev: 23.1.0
1616
hooks:
1717
- id: black
18-
- repo: https://gitlab.com/pycqa/flake8
19-
rev: 4.0.1
18+
- repo: https://github.com/PyCQA/flake8
19+
rev: 6.0.0
2020
hooks:
2121
- id: flake8
2222
additional_dependencies: [dlint]
2323
- repo: https://github.com/pre-commit/pre-commit-hooks
24-
rev: v4.1.0
24+
rev: v4.4.0
2525
hooks:
2626
- id: check-added-large-files
2727
- id: check-case-conflict
@@ -31,19 +31,19 @@ repos:
3131
- id: end-of-file-fixer
3232
- id: trailing-whitespace
3333
- repo: https://github.com/eslint/eslint
34-
rev: v8.12.0
34+
rev: v8.35.0
3535
hooks:
3636
- id: eslint
3737
args: ["monkey/monkey_island/cc/ui/src/", "--fix", "--max-warnings=0"]
3838
- repo: https://github.com/pre-commit/mirrors-mypy
39-
rev: v0.971
39+
rev: v1.0.1
4040
hooks:
4141
- id: mypy
4242
additional_dependencies: [types-ipaddress, types-paramiko, types-python-dateutil, types-pytz, types-PyYAML, types-requests]
4343
exclude: "vulture_allowlist.py"
44-
args: [--ignore-missing-imports]
44+
args: [--ignore-missing-imports, --check-untyped-defs]
4545
- repo: https://github.com/koalaman/shellcheck-precommit
46-
rev: v0.7.2
46+
rev: v0.9.0
4747
hooks:
4848
- id: shellcheck
4949
- repo: local
@@ -56,6 +56,10 @@ repos:
5656
exclude: "monkey/monkey_island/cc/ui"
5757
stages: [push]
5858
- repo: https://github.com/jendrikseipp/vulture
59-
rev: v2.3
59+
rev: v2.7
6060
hooks:
6161
- id: vulture
62+
- repo: https://github.com/mssalvatore/merge-issue-number-hook
63+
rev: v1.0.0
64+
hooks:
65+
- id: merge-issue-number

.travis.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: "Monkey Linux"
1616
language: python
1717
python:
18-
- 3.7
18+
- 3.11
1919
os: linux
2020
dist: focal
2121
vm:
@@ -76,7 +76,7 @@ jobs:
7676
## run unit tests and generate coverage data
7777
- cd monkey # this is our source dir
7878
- pip install pytest-xdist
79-
- python -m pytest -n auto --dist loadscope --cov=. # have to use `python -m pytest` instead of `pytest` to add "{$builddir}/monkey/monkey" to sys.path.
79+
- python -m pytest -n auto --dist worksteal --cov=. # have to use `python -m pytest` instead of `pytest` to add "{$builddir}/monkey/monkey" to sys.path.
8080

8181
# check js code. the npm install must happen after the flake8 because the node_modules folder will cause a lot of errors.
8282
- cd monkey_island/cc/ui
@@ -99,12 +99,12 @@ jobs:
9999
vm:
100100
size: x-large
101101
before_install:
102-
- choco install python --version=3.7.9
102+
- choco install python --version=3.11
103103
- python -m pip install -U pip setuptools virtualenv
104104
- python -m virtualenv $HOME/venv
105105
- source $HOME/venv/Scripts/activate
106106
env:
107-
PATH=/c/Python37:/c/Python37/Scripts:$PATH
107+
PATH=/c/Python311:/c/Python311/Scripts:$PATH
108108
cache:
109109
pip: true
110110
directories:
@@ -113,7 +113,7 @@ jobs:
113113
install:
114114
# Python
115115
- nproc
116-
- pip install pipenv==2022.7.4
116+
- pip install pipenv
117117
# Install island and monkey requirements as they are needed by UT's
118118
- pushd monkey/monkey_island
119119
- pipenv sync --dev # This installs dependencies from lock
@@ -126,7 +126,7 @@ jobs:
126126
## run unit tests and generate coverage data
127127
- cd monkey # this is our source dir
128128
- pip install pytest-xdist
129-
- python -m pytest -n auto --dist loadscope
129+
- python -m pytest -n auto --dist worksteal
130130

131131

132132
notifications:

CHANGELOG.md

+38
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,44 @@ file.
55
The format is based on [Keep a
66
Changelog](https://keepachangelog.com/en/1.0.0/).
77

8+
## [2.1.0] - 2023-04-19
9+
### Added
10+
- Logout button. #3063
11+
- An option to the Hadoop exploiter to try all discovered HTTP ports. #2136
12+
- `GET /api/agent-otp`. #3076
13+
- `POST /api/agent-otp-login` endpoint. #3076
14+
- A smarter brute-forcing strategy for SMB exploiter. #3039
15+
- `POST /api/refresh-authentication-token` endpoint that allows refreshing of
16+
the access token. #3181
17+
18+
### Changed
19+
- Migrated the hard-coded SMB exploiter to a plugin. #2952
20+
- Python version from 3.7 to 3.11.2. #2705
21+
- MSI installer is now build with InnoSetup. #1911
22+
23+
### Fixed
24+
- A UI deficiency where invalid configurations could be submitted to the
25+
backend. #1301, #2989
26+
- Notification spam bug. #2731
27+
- Agent propagator crashes if exploiters malfunction. #2992
28+
- Configuration order not preserved in debugging output. #2860
29+
- A bug in the Hadoop exploiter that resulted in speculative execution of
30+
multiple agents. #2758
31+
- Formatting of the manual run command when copy/pasting from the web UI. #3115
32+
- A bug where plugins received an incorrect agent ID. #3119
33+
- Random logouts when the UI is being actively used. #2049, #3079, #3137
34+
35+
### Security
36+
- Fixed plaintext private key in SSHKey pair list in UI. #2950
37+
- Upgraded MongoDB version from 4.x to 6.0.4. #2706
38+
- Replaced the `SystemSingleton` component, which could allow local users to
39+
execute a DoS attack against agents. #2817
40+
- Replaced our bespoke authentication solution with `flask-security-too`.
41+
#2049, #2157, #3078, #3138
42+
- Enforced access control around sensitive API endpoints. #2049, #2157
43+
- Upgraded 3rd-party dependencies. #2705, #2970, #2865, #3125
44+
- Fixed a potential XSS issue in exploiter plugins. #3081
45+
846
## [2.0.0] - 2023-02-08
947
### Added
1048
- `credentials.json` file for storing Monkey Island user login information. #1206

README.md

-10
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@ The Infection Monkey is comprised of two parts:
2020

2121
To read more about the Monkey, visit [akamai.com/infectionmonkey](https://www.akamai.com/infectionmonkey).
2222

23-
## 💥 We're Hiring 💥
24-
We are looking for a software engineering manager with a passion for UX and
25-
cybersecurity to join the Infection Monkey development team. This is a remote
26-
position and is open anywhere in Israel. You can learn more about Infection
27-
Monkey on our [website](https://www.akamai.com/infectionmonkey).
28-
29-
For more information, or to apply, see the official job post:
30-
- [Israel](https://akamaicareers.inflightcloud.com/jobdetails/aka_ext/028224?section=aka_ext&job=028224)
31-
32-
3323

3424
## Screenshots
3525

build_scripts/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
agent-dist/

build_scripts/README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,19 @@ NOTE: This script is intended to be run from a clean VM. You can also manually
4444
remove build artifacts by running `docker/clean.sh`
4545

4646
### Running the Docker Image
47-
The build script will produce a `.tgz` file in `./dist/`. See
48-
`docker/DOCKER_README.md` for instructions on running the docker image.
47+
The build script will produce a `.tgz` file in `./dist/`.
48+
To load the `.tgz` file:
49+
50+
1. Extract the Monkey Island Docker tarball:
51+
```bash
52+
tar -xvzf InfectionMonkey-docker-v2.0.0.tgz
53+
```
54+
55+
1. Load the Monkey Island Docker image:
56+
57+
```bash
58+
sudo docker load -i InfectionMonkey-docker-v2.0.0.tar
59+
```
60+
61+
For more information on how to run your local Monkey Island Docker image, see
62+
[https://techdocs.akamai.com/infection-monkey/docs/docker/](https://techdocs.akamai.com/infection-monkey/docs/docker/).

build_scripts/appimage/AppRun

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ self="$(readlink -f -- $0)"
55
here="${self%/*}"
66
APPDIR="${APPDIR:-${here}}"
77

8-
# Export TCl/Tk
9-
export TCL_LIBRARY="${APPDIR}/usr/share/tcltk/tcl8.4"
10-
export TK_LIBRARY="${APPDIR}/usr/share/tcltk/tk8.4"
11-
export TKPATH="${TK_LIBRARY}"
12-
138
# Export SSL certificate
149
export SSL_CERT_FILE="${APPDIR}/opt/_internal/certs.pem"
1510

@@ -24,12 +19,12 @@ do
2419
if [[ "${opt}" =~ "I" ]] || [[ "${opt}" =~ "E" ]]; then
2520
# Environment variables are disabled ($PYTHONHOME). Let's run in a safe
2621
# mode from the raw Python binary inside the AppImage
27-
"$APPDIR/opt/python3.7/bin/python3.7" "$@"
22+
"$APPDIR/opt/python3.11/bin/python3.11" "$@"
2823
exit "$?"
2924
fi
3025
done
3126

3227
export PYTHONNOUSERSITE=1
33-
(PYTHONHOME="${APPDIR}/opt/python3.7" exec "${APPDIR}/opt/python3.7/bin/python3.7" "${APPDIR}/usr/src/monkey_island.py" $@)
28+
(PYTHONHOME="${APPDIR}/opt/python3.11" exec "${APPDIR}/opt/python3.11/bin/python3.11" "${APPDIR}/usr/src/monkey_island.py" $@)
3429

3530
exit "$?"

build_scripts/appimage/appimage.sh

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/bash
22

3+
# Changes: python version
34
LINUXDEPLOY_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
4-
PYTHON_VERSION="3.7.16"
5-
PYTHON_APPIMAGE_URL="https://github.com/niess/python-appimage/releases/download/python3.7/python${PYTHON_VERSION}-cp37-cp37m-manylinux1_x86_64.AppImage"
5+
PYTHON_VERSION="3.11.3"
6+
PYTHON_APPIMAGE_URL="https://github.com/niess/python-appimage/releases/download/python3.11/python${PYTHON_VERSION}-cp311-cp311-manylinux2014_x86_64.AppImage"
67
APPIMAGE_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
78
APPDIR="$APPIMAGE_DIR/squashfs-root"
89
BUILD_DIR="$APPDIR/usr/src"
@@ -32,7 +33,7 @@ setup_build_dir() {
3233

3334
pushd "$APPIMAGE_DIR" || handle_error
3435

35-
setup_python_37_appdir
36+
setup_python_appdir
3637

3738
mkdir -p "$BUILD_DIR"
3839

@@ -53,10 +54,10 @@ setup_build_dir() {
5354
popd || handle_error
5455
}
5556

56-
setup_python_37_appdir() {
57+
setup_python_appdir() {
5758
PYTHON_APPIMAGE="python${PYTHON_VERSION}_x86_64.AppImage"
5859

59-
log_message "downloading Python3.7 Appimage"
60+
log_message "downloading Python Appimage"
6061
curl -L -o "$PYTHON_APPIMAGE" "$PYTHON_APPIMAGE_URL"
6162

6263
chmod u+x "$PYTHON_APPIMAGE"
@@ -77,12 +78,14 @@ install_monkey_island_python_dependencies() {
7778
log_message "Installing island requirements"
7879

7980
log_message "Installing pipenv"
80-
"$APPDIR"/AppRun -m pip install pipenv==2022.7.4 || handle_error
81+
"$APPDIR"/AppRun -m pip install pipenv || handle_error
8182
export CI=1
8283

8384
log_message "Installing dependencies"
8485
pushd "$BUILD_DIR/monkey_island" || handle_error
85-
"$APPDIR"/AppRun -m pipenv --python "$APPDIR/AppRun" sync --system || handle_error
86+
"$APPDIR"/AppRun -m pipenv --python "$APPDIR/AppRun" requirements > requirements.txt || handle_error
87+
"$APPDIR"/AppRun -m pip install -r requirements.txt || handle_error
88+
rm requirements.txt
8689
popd || handle_error
8790

8891
log_message "Uninstalling pipenv (build dependency only)"

build_scripts/appimage/install-infection-monkey-service.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ while (( "$#" )); do
130130
exit 0
131131
;;
132132
*)
133-
die "Error: Unsupported parameter $1."
133+
die "Error: Unsupported parameter \"$1\"."
134134
;;
135135
esac
136136
done

0 commit comments

Comments
 (0)