Skip to content
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

Define credentials collectors plugin interface #3167

Closed
4 of 6 tasks
mssalvatore opened this issue Mar 28, 2023 · 7 comments · Fixed by #3247
Closed
4 of 6 tasks

Define credentials collectors plugin interface #3167

mssalvatore opened this issue Mar 28, 2023 · 7 comments · Fixed by #3247

Comments

@mssalvatore
Copy link
Collaborator

mssalvatore commented Mar 28, 2023

Description

In order to migrate the SSH and Mimikatz credentials collectors to plugins, we must first define a plugin interface for credentials collectors.

Tasks

  • Define what should be passed to Plugin.__init__() for credentials collector plugins (0d) @cakekoa
  • Define what should be passed to Plugin.run() for credentials collector plugins and modify the puppet as necessary (0d) @ilija-lazoroski
  • Define what should be returned from Plugin.run() for credentials collector plugins and modify the puppet as necessary (0d) @ilija-lazoroski
  • Modify PluginLoader._load_plugin_from_island() to load credentials collector plugins (0d) @cakekoa
  • Make the UI work for credentials collector plugins (0.25d) @ilija-lazoroski
  • Build a mock/test credentials collector plugin and test the system end-to-end (0.5d) @cakekoa
@cakekoa
Copy link
Contributor

cakekoa commented Apr 24, 2023

For Plugin.__init__():

Our existing credentials collectors require an IAgentEventQueue and an AgentID. We use IAgentEventPublisher in our plugins, which allows us to pass data from the plugin process to the main process agent event queue. These dependencies are used for publishing the credentials stolen event.

  • IAgentEventPublisher
  • AgentID

@ilija-lazoroski
Copy link
Contributor

ilija-lazoroski commented Apr 24, 2023

For Plugin.run() we should only pass host, optionsand interrupt.

host is needed so we can specify the target when sending CredentialStolenEvent.
For the options I am not 100% sure because that is something that we will decide when we actually do the collectors. The only thing that I can see that could be an option is CREDENTIAL_TYPES from MimikatzCollector .

@ilija-lazoroski
Copy link
Contributor

The collectors are returning a list of Credentials which the master only uses to log a debug message. I think we don't really need to return anything as we publish the credentials in CredentialStolenEvent.

@shreyamalviya
Copy link
Contributor

host is needed so we can specify the target when sending CredentialStolenEvent.

Plugin.run() doesn't need the host since credential collectors run on the local system. In the events, target will be None meaning the event took place on the local system.

For the options I am not 100% sure because that is something that we will decide when we actually do the collectors.

We're implementing the plugin system so that everyone can write their own plugins. We can't foresee what kind of plugins will be written so we need to pass options to all of them regardless of whether it's useful for us right now.

@shreyamalviya
Copy link
Contributor

The collectors are returning a list of Credentials which the master only uses to log a debug message. I think we don't really need to return anything as we publish the credentials in CredentialStolenEvent.

We don't need to return the credentials stolen because the event handles it, but we do need a CredentialCollectorResultData (just like we have ExploiterResultData).

@ilija-lazoroski
Copy link
Contributor

The collectors are returning a list of Credentials which the master only uses to log a debug message. I think we don't really need to return anything as we publish the credentials in CredentialStolenEvent.

We don't need to return the credentials stolen because the event handles it, but we do need a CredentialCollectorResultData (just like we have ExploiterResultData).

CredentialCollectorResultData should have collection_success, os?, info? and error_message?

@cakekoa
Copy link
Contributor

cakekoa commented Apr 25, 2023

We've settled on the following interface:

  • __init__() will accept an IAgentEventPlubisher and an AgentID
  • run() will accept an options dict and an interrupt event, and return the sequence of credentials stolen

mssalvatore added a commit that referenced this issue Apr 27, 2023
mssalvatore added a commit that referenced this issue Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants