Mike Salvatore
54c1eef309
Island: Make IEncryptor interface consistent
...
An IEncryptor could take Any type and encrypt it, returning Any other
type. This is a poorly defined interface and, IIRC, it was defined this
way so some encryptors could take strings and others could take bytes.
This commit modifies the interface so that it accepts and returns bytes
in all cases. If a string encryptor is needed for convenience, we can
add IStringEncryptor and write a decorator that wraps IEncryptors.
2022-07-11 10:01:37 -04:00
Mike Salvatore
f7e632025f
Island: Reformat IEncryptor docstrings
2022-07-11 09:29:02 -04:00
Mike Salvatore
a733886365
Merge pull request #2075 from guardicore/1965-mongo-credentials-repository
...
1965 mongo credentials repository
2022-07-11 09:28:00 -04:00
Ilija Lazoroski
ae3357a1b6
UT: Remove removal of collection in MongoCredentialsRepository
2022-07-11 15:09:10 +02:00
Ilija Lazoroski
4dd4b38fc9
UT: Use Credentials object instead of dict in MongoCredentialsRepository
2022-07-11 15:04:29 +02:00
Mike Salvatore
14cbf07a21
Island: Register mongo client as instance, not convention
2022-07-11 09:02:57 -04:00
Ilija Lazoroski
b7786e2d0a
Island: Register mongo client in DI container
2022-07-11 14:24:57 +02:00
Mike Salvatore
0bddef7078
Island: Add pymongo as an explicit dependency
2022-07-11 08:10:58 -04:00
Mike Salvatore
088ec94269
Island: Rename _delete_collection -> _remove_credentials_fom_collection
2022-07-11 08:02:20 -04:00
Mike Salvatore
8a7e89e733
Common: Fix minor grammar mistake
2022-07-11 07:58:18 -04:00
Ilija Lazoroski
efb12df483
Island: Build MongoCredentialsRepository with a mongo connection
2022-07-11 12:41:23 +02:00
Ilija Lazoroski
1b1bd7fcc2
UT: Use mongomock in MongoCredentialsRepository
2022-07-11 12:26:00 +02:00
Ilija Lazoroski
4226cb5b9e
Island: Move error handling to private methods in
...
MongoCredentialsRepository
2022-07-11 12:25:08 +02:00
Ilija Lazoroski
c48b38fb01
Island: Refactor MongoCredentialsRepository
...
* Remove code duplication
* Init with PyMongo object
2022-07-08 19:20:25 +02:00
Ilija Lazoroski
c808d50948
Island: Add note to fix duplication of Credentials in database
2022-07-08 17:50:18 +02:00
Ilija Lazoroski
45a6693263
Island: Register MongoCredentialsRepository in DI container
2022-07-08 17:34:45 +02:00
Ilija Lazoroski
8ff8ad1f17
Island: Modify MongoCredentialsRepository
2022-07-08 17:32:28 +02:00
Ilija Lazoroski
7062aaf261
Common: Add to_mapping in Credentials
2022-07-08 17:26:23 +02:00
Mike Salvatore
cd839884eb
Merge pull request #2070 from guardicore/2003-remove-unused-endpoints
...
2003 remove unused endpoints
2022-07-08 09:12:12 -04:00
Mike Salvatore
3f04aaa383
Merge pull request #2068 from guardicore/1965-deserialize-credentials-array
...
1965 deserialize credentials array
2022-07-08 08:33:14 -04:00
vakarisz
ea7b816264
Changelog: Add entries about changed configuration
2022-07-08 15:16:59 +03:00
vakarisz
475f6bc567
Island: Remove outdated "island_configuration" endpoints
2022-07-08 15:16:59 +03:00
VakarisZ
62f6a7a1a8
Merge pull request #2069 from guardicore/2003-retrieve-submit-config
...
2003 retrieve submit config
2022-07-08 15:10:38 +03:00
Mike Salvatore
cec2962fe3
Island: Remove unused import in ClearSimulationData
2022-07-08 07:52:45 -04:00
vakarisz
fde719ce94
UI: Remove last unused method, improve style
2022-07-08 14:41:24 +03:00
vakarisz
50540da780
UI: Remove renderUnsafeAttackOptionsWarningModal from ConfigurePage
...
Nothing was using this function
2022-07-08 12:16:30 +03:00
vakarisz
bac091f185
UI: Remove renderAttackAlertModal from ConfigurePage.js
...
Nothing was using this function
2022-07-08 12:14:22 +03:00
vakarisz
efe77e2150
UI: Remove userChangedConfig from ConfigurePage.js
...
Nothing was using this function
2022-07-08 12:12:24 +03:00
vakarisz
ef8d52b96f
UI: Fix error in ConfigurePage.js after refresh of the page
2022-07-08 12:04:43 +03:00
vakarisz
5a52ceaa4c
UI: Reset last action on in ConfigurePage.js
...
Last action, like "Configuration was reset successfully" shouldn't linger in the page for long. It should reset upon modifying the configuration or changing the tab
2022-07-08 12:04:43 +03:00
vakarisz
6725b01342
UI: Adjust config page to use new reset endpoint
2022-07-08 12:04:43 +03:00
vakarisz
d1b586d260
UI: Adjust config to interact with new agent-configuration endpoint
...
Submit, export and import were adjusted to match and reformat config.
2022-07-08 12:04:43 +03:00
vakarisz
30f122dfc3
UI: Use updated configuration endpoint in ConfigurePage.js
2022-07-08 12:04:43 +03:00
vakarisz
c8ed409e9e
Island: Change agent_configuration.py POST to parse from json
2022-07-08 12:04:43 +03:00
Mike Salvatore
77143ee765
Island: Use common.credentials.Credentials in resource
2022-07-07 15:35:56 -04:00
Mike Salvatore
938aec9d49
Island: Reorder repository/__init.py
...
Group the interfaces and implementations together to make it easier to
understand what functionality has been implemented so far.
2022-07-07 15:27:38 -04:00
Mike Salvatore
d0cb0d63cc
Island: Export MongoCredentialsRepository from repository package
2022-07-07 15:27:38 -04:00
Mike Salvatore
7bcf49daf9
Island: Modify ICredentialsRepository to save a Sequence of Credentials
2022-07-07 15:27:38 -04:00
Ilija Lazoroski
68fe2edd08
Island: Init MongoCredentialsRepository
2022-07-07 15:27:38 -04:00
Mike Salvatore
4edb4f6971
Common: Add Credentials.to_json_array()
2022-07-07 15:26:17 -04:00
Mike Salvatore
6bd0e7dc3a
Common: Add doctrings for Credential serialization
2022-07-07 15:08:17 -04:00
Mike Salvatore
4d753a808b
Common: Add Credentials.from_json_array()
2022-07-07 14:58:07 -04:00
Mike Salvatore
1ab190cd2a
Merge pull request #2065 from guardicore/1965-modify-clear-simulation-data
...
Modify /api/clear-simulation-data to clear stolen credentials
2022-07-07 12:56:50 -04:00
Mike Salvatore
bd810440af
Island: Remove unnecessary error handling
...
Flask automatically catches exceptions and returns a 500 response, so
there's no need to add extra code to do this.
2022-07-07 12:55:46 -04:00
Mike Salvatore
402a5f5860
Merge pull request #2067 from guardicore/1965-credentials-serialization
...
1965 credentials serialization
2022-07-07 11:31:41 -04:00
Mike Salvatore
5211045194
Common: Reformat docstring for del_key()
2022-07-07 11:30:05 -04:00
Mike Salvatore
d0fa9a7dcf
Common: Use the imperative in del_key() docstring
2022-07-07 11:29:08 -04:00
Mike Salvatore
08bb49af0f
Common: Add ssh-key-regex note to TODO
2022-07-07 11:25:33 -04:00
Shreya Malviya
d16b3e6bef
Island: Update HTTP status code when RemovalError is encountered in ClearSimulationData
2022-07-07 08:22:52 -07:00
Mike Salvatore
e921f90e00
Agent: Use Credentials.to_json() for CredentialsTelem serialization
2022-07-07 09:15:01 -04:00