Commit Graph

5599 Commits

Author SHA1 Message Date
Mike Salvatore b98ebc8a69 island: Remove tmpdir cleanup code from test_utils.py
Pytest automatically cleans up tmpdir fixtures older than 3 runs. See
https://docs.pytest.org/en/6.2.x/tmpdir.html#the-default-base-temporary-directory

Windows10 and Linux will automatically clean their temp directories.
2021-06-09 10:36:37 -04:00
Mike Salvatore 00b37ca6a5 island: Test windows permissions set by create_secure_directory() 2021-06-09 10:32:42 -04:00
shreyamalviya 91aad66e16 Modify log message when checking file permissions
Removed code to display it in octal since it makes no sense on Windows.
Added `oct()` around linux permissions when expected_permissions is
being defined.
2021-06-09 19:51:20 +05:30
shreyamalviya 424aceb116 Use constants instead of permission masks 2021-06-09 19:38:45 +05:30
shreyamalviya 84b0664423 Modify comment in monkey_island/cc/server_utils/file_utils.py 2021-06-09 19:37:58 +05:30
Mike Salvatore b30de00305
Update encryption/decryption PR numbers in changelog
Co-authored-by: Shreya Malviya <shreya.malviya@gmail.com>
2021-06-09 10:02:44 -04:00
Mike Salvatore 945e1adf58 island: Split has_expected_permissions() into os-specific functions 2021-06-09 09:47:23 -04:00
shreyamalviya dc8e2b018d Fix/ignore flake8 and fix isort warnings 2021-06-09 07:39:56 -04:00
shreyamalviya cd2f627cc1 Add tests for Windows file permissions checking 2021-06-09 07:39:56 -04:00
shreyamalviya fcd758e24f Fix Windows file permissions checking 2021-06-09 07:39:56 -04:00
Shreya 438a63b0f4 Fix Windows file permission checking 2021-06-09 07:39:56 -04:00
Shreya f1d85dbc44 Change default cert permissions in bat script for creating default cert 2021-06-09 07:39:56 -04:00
Shreya 011ab2a393 Modify `has_expected_permissions()` to check files on Windows 2021-06-09 07:39:56 -04:00
Shreya 10e7b19669 Fix consts.py (mix up during rebase) 2021-06-09 07:39:56 -04:00
shreyamalviya ef17b7f9c8 Add unit tests for windows directory permission setting 2021-06-09 16:31:27 +05:30
Mike Salvatore 3841dd7f7b island: Set tighter permissions on certs in create_certificate.sh 2021-06-08 07:17:59 -04:00
Mike Salvatore 93e18a525c
Merge pull request #1212 from guardicore/docs-appimage-signed-certs
Docs appimage signed certs
2021-06-08 06:55:51 -04:00
Mike Salvatore 526019a6ea docs: Make chmod command less specific in linux setup 2021-06-08 06:51:25 -04:00
Mike Salvatore 7fe3dcecef
Merge pull request #1210 from guardicore/docs-docker-signed-certs
Docs docker signed certs
2021-06-08 06:45:44 -04:00
Mike Salvatore 9086d93137 docs: Make chmod command less specific in docker setup 2021-06-08 06:40:59 -04:00
Mike Salvatore 4b119ab4ce island: Skip some island_config_options_validator tests on Windows 2021-06-08 06:35:15 -04:00
Mike Salvatore 63fb396bbb island: Add unit tests for island_config_options_validator 2021-06-07 19:55:33 -04:00
Mike Salvatore b80dd59352 tests: move create_empty_file() to conftest.py 2021-06-07 19:44:06 -04:00
Mike Salvatore 78af0d86aa island: Move IslandConfigOptions validation to separate module 2021-06-07 19:28:03 -04:00
Mike Salvatore c19dc9dcad island: Add config validation to IslandConfigOptions 2021-06-07 14:41:05 -04:00
Mike Salvatore a45848ce0c island: Move file_has_expected_permissions() to file_utils.py
Rename to `has_expected_permissions()` as
`file_has_expected_permissions()` is now reduntant.

Add unit tests
2021-06-07 14:12:48 -04:00
Mike Salvatore 36314f09ae island: Use certificate provided in config, not environment variables 2021-06-07 13:24:31 -04:00
Mike Salvatore 4e1b4fbf6b island: Replace calls to os.{expandpath,expandusers} with expand_path() 2021-06-07 13:21:16 -04:00
Mike Salvatore bf0fe10ea9 island: Add unit tests for expand_path() 2021-06-07 13:18:04 -04:00
Mike Salvatore 8744011297 island: move set_home_env() to conftest.py so it can be reused 2021-06-07 13:17:22 -04:00
Mike Salvatore 0519153aaf island: Move _expand_path() to file_utils.py so it can be reused 2021-06-07 13:04:38 -04:00
Mike Salvatore e4866b1286 island: Change _expand_path() from a static to regular function
_expand_path() is a utility function used by IslandConfigOptions. It
doesn't need to be part of the class. It can potentially be reused by
other modules that require the same functionality.
2021-06-07 12:57:42 -04:00
Mike Salvatore f0a109a145 island: Add tests for ssl_certificate_key_file 2021-06-07 12:53:32 -04:00
Mike Salvatore 4231f316db island: Add tests for ssl_certificate_file 2021-06-07 12:41:11 -04:00
Mike Salvatore f2a2efc2a7 island: Remove redundant "test_island_config_options" from tests
The file is named "test_island_config_options.py". Including
"island_config_options" in every test/function name is reduntant.
2021-06-07 12:30:03 -04:00
Mike Salvatore ea0d6f0141 island: Add a generalized testing function to test_island_config_options 2021-06-07 12:20:32 -04:00
Mike Salvatore eb044207da docs: Small change to docker setup to keep consistent with linux.md 2021-06-07 11:10:41 -04:00
Mike Salvatore 871fce1549 docs: Add setup instructions for linux AppImage package 2021-06-07 11:10:36 -04:00
Mike Salvatore a42040343b docs: Add a skeleton setup page for Linux AppImage package 2021-06-07 11:08:00 -04:00
Shreya 4f601ca5dc Pass file paths to setup_certificate() instead of IslandConfigOptions 2021-06-07 20:12:29 +05:30
Shreya 42a9a79800 Modify server_config.json ssl cert fields 2021-06-07 20:12:29 +05:30
Shreya 2b73ec75c8 Move monkey_island/cc/setup/certificate/certificate_setup.py to monkey/monkey_island/cc/setup/certificate_setup.py 2021-06-07 20:12:29 +05:30
Shreya 227039f30c Add `_expand_path()` to wrap `os.path.expandvars()\' and `os.path.expanduser()\' 2021-06-07 20:12:27 +05:30
Mike Salvatore 82c3273e69 docs: Fix minor capitalization issue in docker setup 2021-06-07 10:39:44 -04:00
Mike Salvatore 6c04124303 docs: Add `--volume` workaround to docker troubleshooting
Resolves #1032
2021-06-07 10:14:24 -04:00
Mike Salvatore 16ed2e59e8 docs: Add steps for user-provided certificate for docker container 2021-06-07 10:10:27 -04:00
Mike Salvatore 8c1e76ffbe docs: Reword docker supported operating systems 2021-06-07 10:09:59 -04:00
Mike Salvatore a815850c9e Merge branch 'default-data-dir-bug' into develop 2021-06-07 06:41:38 -04:00
Mike Salvatore 2b1af17433
island: Add typehint to create_default_server_config_file()
Co-authored-by: Shreya Malviya <shreya.malviya@gmail.com>
2021-06-07 06:39:05 -04:00
VakarisZ abaeafcb6b Split one unit test test_encrypt_decrypt_config__malformed into two, one for too short configuration, another one for corrupted file. 2021-06-07 11:43:44 +03:00