8000 Remove custom singleton mutex name option by shreyamalviya · Pull Request #1589 · guardicore/monkey · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove custom singleton mutex name option #1589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/).
- Checkbox for file logging. #1537
- Remove serialization of config. #1537
- Checkbox that gave the option to not try to first move the dropper file. #1537
- Custom singleton mutex name config option. #1589

### Fixed
- A bug in network map page that caused delay of telemetry log loading. #1545
Expand Down
3 changes: 0 additions & 3 deletions monkey/infection_monkey/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ def as_dict(self):
# sets whether or not the monkey is alive. if false will stop scanning and exploiting
alive = True

# string of the mutex name for single instance
singleton_mutex_name = "{2384ec59-0df8-4ab9-918c-843740924a28}"

# how long to wait between scan iterations
timeout_between_iterations = 100

Expand Down
1 change: 0 additions & 1 deletion monkey/infection_monkey/example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"smb_service_name": "InfectionMonkey",
"retry_failed_explotation": true,
"self_delete_in_cleanup": true,
"singleton_mutex_name": "{2384ec59-0df8-4ab9-918c-843740924a28}",
"skip_exploit_if_file_exist": false,
"exploit_user_list": [],
"exploit_password_list": [],
Expand Down
9 changes: 5 additions & 4 deletions monkey/infection_monkey/system_singleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import sys
from abc import ABCMeta, abstractmethod

from infection_monkey.config import WormConfiguration

logger = logging.getLogger(__name__)


SINGLETON_MUTEX_NAME = "{2384ec59-0df8-4ab9-918c-843740924a28}"


class _SystemSingleton(object, metaclass=ABCMeta):
@abstractmethod
def try_lock(self):
Expand All @@ -20,7 +21,7 @@ def unlock(self):

class WindowsSystemSingleton(_SystemSingleton):
def __init__(self):
self._mutex_name = r"Global\%s" % (WormConfiguration.singleton_mutex_name,)
self._mutex_name = r"Global\%s" % (SINGLETON_MUTEX_NAME,)
self._mutex_handle = None

def try_lock(self):
Expand Down Expand Up @@ -55,7 +56,7 @@ def unlock(self):

class LinuxSystemSingleton(_SystemSingleton):
def __init__(self):
self._unix_sock_name = str(WormConfiguration.singleton_mutex_name)
self._unix_sock_name = str(SINGLETON_MUTEX_NAME)
self._sock_handle = None

def try_lock(self):
Expand Down
7 changes: 0 additions & 7 deletions monkey/monkey_island/cc/services/config_schema/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
"title": "General",
"type": "object",
"properties": {
"singleton_mutex_name": {
"title": "Singleton mutex name",
"type": "string",
"default": "{2384ec59-0df8-4ab9-918c-843740924a28}",
"description": "The name of the mutex used to determine whether the monkey is "
"already running",
},
"keep_tunnel_open_time": {
"title": "Keep tunnel open time",
"type": "integer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
},
"internal": {
"general": {
"singleton_mutex_name": "{2384ec59-0df8-4ab9-918c-843740924a28}",
"keep_tunnel_open_time": 60,
"monkey_dir_name": "monkey_dir",
"started_on_island": false
Expand Down
0