-
Notifications
You must be signed in to change notification settings - Fork 786
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
SMB: Add SMBOptions to SMBPlugin #3089
Conversation
cd92d3b
to
d8af95c
Compare
@ybasford Option descriptions could use your expert opinion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vulture fails
agent_binary_upload_timeout: float = Field( | ||
default=30.0, | ||
gt=0.0, | ||
le=100.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These maximums seem somewhat arbitrary. Are they based on anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we get rid of the maximums altogether?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if we add a note to the description that this could cause the agent to hang on manual shutdown if it's set too high. Realistically, we shutdown after I think 120 seconds if things are hung.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should also change things in Hadoop
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## 2952-smb-exploiter-plugin #3089 +/- ##
=============================================================
+ Coverage 67.58% 67.63% +0.05%
=============================================================
Files 444 446 +2
Lines 12730 12755 +25
=============================================================
+ Hits 8603 8627 +24
- Misses 4127 4128 +1 see 11 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
4bfe266
to
04b6cb0
Compare
04b6cb0
to
278845a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider adding the option of choosing both or one of port 445 and port 139 instead of hard-coding it to be both. Probably checkboxes.
use_kerberos: bool = Field( | ||
default=False, description="Use Kerberos authentication for RPC transport." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't need this. We don't have any exploiter logic for when Kerberos auth is set to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, we don't but RPC transport has that option which we were hard-coding to False
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, we don't specifically handle cases where Kerberos is used. Do we need anything else for it to work or is our existing logic enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probablyyyy. We need to check that.
rpc_connect_timeout: float = Field( | ||
default=15.0, | ||
gt=0.0, | ||
le=100.0, | ||
description="The maximum time (in seconds) to wait for a response on an RPC connection.", | ||
) | ||
smb_connect_timeout: float = Field( | ||
default=15.0, | ||
gt=0.0, | ||
le=100.0, | ||
description="The maximum time (in seconds) to wait for a response on an SMB connection.", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also wondering if this should just be one option (smb_connect_timeout
) which is used in both places. The user doesn't know about the internal workings of the exploiter i.e. where/when/why RPC is being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That probably make sense.
@shreyamalviya We discussed it on Friday. The issue is that 445 and 139 aren't really the right configuration options. The right set of configuration options are checkboxes regarding whether or not we should use the protocol over NetBIOS (see https://www.upguard.com/blog/smb-port). After some discussion, we decided this requires the user to have more knowledge of SMB and its history than they probably want. We decided that, since it's so easy to modify and release new versions of the plugin, we could add this option at a later date if a user requests it. For now, we decided to just hard code both. |
rpc_connect_timeout: float = Field( | ||
default=15.0, | ||
gt=0.0, | ||
le=100.0, | ||
description="The maximum time (in seconds) to wait for a response on an RPC connection.", | ||
) | ||
smb_connect_timeout: float = Field( | ||
default=15.0, | ||
gt=0.0, | ||
le=100.0, | ||
description="The maximum time (in seconds) to wait for a response on an SMB connection.", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these just be the same option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3089 (comment) Yep.
rpc protocol is part of smb so we can use the same timeout
default=30.0, | ||
gt=0.0, | ||
le=100.0, | ||
description="The timeout (in seconds) for uploading the Agent binary" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change description text: "Timeout (in seconds) for uploading the Agent binary."
Issue: #2952
What does this PR do?
Fixes part of #2952
Add any further explanations here.
PR Checklist
Testing Checklist