Skip to content

Commit

Permalink
Carbon Black Cloud - 386 - Updated the SDK version | Cloud enabled (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
igorski-r7 authored Oct 2, 2023
1 parent 4648235 commit ded2ebf
Show file tree
Hide file tree
Showing 28 changed files with 906 additions and 448 deletions.
12 changes: 6 additions & 6 deletions plugins/carbon_black_cloud/.CHECKSUM
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"spec": "e5b6b3d9aa6cbf29b762b7765f740eb0",
"manifest": "3731ceb2c2b1ec3bd60bf42390a63baa",
"setup": "1cd2b92709a21e8fd13f17723054758c",
"spec": "7a5657896c1f07e826c5c384f218ebeb",
"manifest": "d2e7fc2babe82cd2cc3a65d6b30c25a7",
"setup": "cc8128ff5f6d2041b968dbf96d81cd6d",
"schemas": [
{
"identifier": "get_agent_details/schema.py",
"hash": "82b1b8b683b6666cbca53a6d847bbb23"
"hash": "a4103fd58ab7f8d0437b352fe09f669d"
},
{
"identifier": "quarantine/schema.py",
"hash": "dfd6d7b199db55b1cd8be36d15e96eba"
"hash": "e595e1f63ac67839d1cc429af097a0c6"
},
{
"identifier": "connection/schema.py",
"hash": "5bafa80ff66a658d16d6c71a60c4e173"
"hash": "b055776a3ea5e159540fcda6a7d13f6c"
}
]
}
18 changes: 6 additions & 12 deletions plugins/carbon_black_cloud/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
FROM rapid7/insightconnect-python-3-38-plugin:4
# Refer to the following documentation for available SDK parent images: https://docs.rapid7.com/insightconnect/sdk-guide/#sdk-guide
FROM rapid7/insightconnect-python-3-38-plugin:5

LABEL organization=rapid7
LABEL sdk=python

# Add any custom package dependencies here
# NOTE: Add pip packages to requirements.txt

# End package dependencies

# Add source code
WORKDIR /python/src

ADD ./plugin.spec.yaml /plugin.spec.yaml
ADD . /python/src
ADD ./requirements.txt /python/src/requirements.txt

# Install pip dependencies
RUN if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

# Install plugin
RUN python setup.py build && python setup.py install
ADD . /python/src

RUN python setup.py build && python setup.py install

# User to run plugin code. The two supported users are: root, nobody
USER nobody
Expand Down
46 changes: 30 additions & 16 deletions plugins/carbon_black_cloud/bin/icon_carbon_black_cloud
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
#!/usr/bin/env python
# GENERATED BY KOMAND SDK - DO NOT EDIT
import insightconnect_plugin_runtime
from icon_carbon_black_cloud import connection, actions, triggers

# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
import os
import json
from sys import argv

Name = "VMware Carbon Black Cloud"
Vendor = "rapid7"
Version = "1.0.2"
Version = "2.0.0"
Description = "Quarantine endpoints and get device details with the VMware Carbon Black Cloud plugin"


class ICONCarbonBlackCloud(insightconnect_plugin_runtime.Plugin):
def __init__(self):
super(self.__class__, self).__init__(
name=Name,
vendor=Vendor,
def main():
if 'http' in argv:
if os.environ.get("GUNICORN_CONFIG_FILE"):
with open(os.environ.get("GUNICORN_CONFIG_FILE")) as gf:
gunicorn_cfg = json.load(gf)
if gunicorn_cfg.get("worker_class", "sync") == "gevent":
from gevent import monkey
monkey.patch_all()
elif 'gevent' in argv:
from gevent import monkey
monkey.patch_all()

import insightconnect_plugin_runtime
from icon_carbon_black_cloud import connection, actions, triggers, tasks

class ICONCarbonBlackCloud(insightconnect_plugin_runtime.Plugin):
def __init__(self):
super(self.__class__, self).__init__(
name=Name,
vendor=Vendor,
version=Version,
description=Description,
connection=connection.Connection()
)
self.add_action(actions.GetAgentDetails())

self.add_action(actions.Quarantine())
)
self.add_action(actions.GetAgentDetails())

self.add_action(actions.Quarantine())



def main():
"""Run plugin"""
cli = insightconnect_plugin_runtime.CLI(ICONCarbonBlackCloud())
cli.run()
Expand Down
Loading

0 comments on commit ded2ebf

Please sign in to comment.