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

IntSights plugin #1009

Merged
merged 72 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
145aa20
[MC-683] Init plugin | Add action Get Indicator by Value
r7-mgorny Sep 17, 2021
77a6ef4
IntSights new actions and trigger draft
r7-kszczepanskagorna Sep 17, 2021
daf88b3
[MC-717] Add action Get Indicator By Value
r7-mgorny Sep 21, 2021
fe752ba
Merge branch 'master' of github.com:rapid7/insightconnect-plugins int…
r7-mgorny Sep 30, 2021
8c7c1b8
[MC-683][MC-673][MC-681][MC-682][MC-684][MC-686][MC-688][MC-687] Add …
r7-mgorny Sep 30, 2021
b9bbc7d
[MC-717][MC-718][MC-719][MC-720][MC-721][MC-722][MC-723][MC-725] Upda…
r7-mgorny Oct 1, 2021
d63344c
Revert: Add microsoft ATP
r7-mgorny Oct 1, 2021
9c7071e
Merge branch 'master' into new_plugin_intsights
mrinehart-r7 Oct 5, 2021
17a9bfc
Merge branch 'master' into new_plugin_intsights
mrinehart-r7 Oct 5, 2021
83773b4
Merge branch 'master' into new_plugin_intsights
mrinehart-r7 Oct 5, 2021
f4db6c2
Merge branch 'master' into new_plugin_intsights
mrinehart-r7 Oct 6, 2021
f30b8d9
Merge branch 'master' into new_plugin_intsights
mrinehart-r7 Oct 15, 2021
56f4064
Merge branch 'master' into new_plugin_intsights
mrinehart-r7 Oct 20, 2021
658d421
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
7b79c3d
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
a280af0
Update plugins/intsights/icon_intsights/actions/takedown_request/acti…
r7-mgorny Oct 25, 2021
0d130dd
Update plugins/intsights/icon_intsights/connection/connection.py
r7-mgorny Oct 25, 2021
35048b6
Update plugins/intsights/icon_intsights/util/api.py
r7-mgorny Oct 25, 2021
0bc83b5
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
15459fd
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
848ad4f
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
ec21384
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
d301da0
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
a7f5518
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
1180a25
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
1104392
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
57e61c9
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
74dbc2c
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
d52bdb0
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
884ee1c
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
93e184c
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
c441d46
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
fb591ac
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
23b1898
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
52be923
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
d917639
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
fbb4977
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
47462d3
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
bfa254a
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
72ca31e
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
f80095b
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
baf884a
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
1421402
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
7b6aebd
[MC-683] Fix help
r7-mgorny Oct 25, 2021
3dcd7bf
[MC-683] Fix help
r7-mgorny Oct 25, 2021
246b9f3
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
4d2f577
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
7d46a8d
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
f9a7eda
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
0c021cc
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
d04cfe9
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
7fcdcdc
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
ba9187e
Update plugins/intsights/plugin.spec.yaml
r7-mgorny Oct 25, 2021
55314a7
[MC-683] Change plugin name to rapid7_intsights
r7-mgorny Oct 25, 2021
5cff8db
Merge branch 'new_plugin_intsights' of github.com:rapid7/insightconne…
r7-mgorny Oct 25, 2021
18679ef
[MC-683] Change plugin name to rapid7_intsights
r7-mgorny Oct 25, 2021
4ce1904
[MC-683] Fix unit tests
r7-mgorny Oct 25, 2021
349398a
[MC-683] Fix unit tests
r7-mgorny Oct 25, 2021
04d95e5
[MC-683] Add clean to enrich_indicator output
r7-mgorny Oct 25, 2021
a0edfa6
[MC-683] Add clean to enrich_indicator output
r7-mgorny Oct 26, 2021
e06be20
Add icon
mrinehart-r7 Oct 26, 2021
dc62b6a
New graphics
mrinehart-r7 Oct 27, 2021
57c698c
Merge branch 'master' of github.com:rapid7/insightconnect-plugins int…
r7-mgorny Oct 28, 2021
8670318
Merge branch 'master' into new_plugin_intsights
mrinehart-r7 Oct 28, 2021
25f22c4
Fix unit_test path while getting payload
r7-mgorny Oct 28, 2021
4158cb8
Merge branch 'new_plugin_intsights' of github.com:rapid7/insightconne…
r7-mgorny Oct 28, 2021
fc1ee56
Add cutom type
r7-mgorny Oct 31, 2021
56e4d81
Regenerate plugin and Black format
mberezin-r7 Nov 1, 2021
e1ba917
Update help.md for validator
mberezin-r7 Nov 1, 2021
95280ca
Update plugins/rapid7_intsights/help.md
mrinehart-r7 Nov 2, 2021
a814760
[MC-683] Set some output to required false
r7-mgorny Nov 2, 2021
f4760e3
Merge branch 'master' of github.com:rapid7/insightconnect-plugins int…
r7-mgorny Nov 2, 2021
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
43 changes: 43 additions & 0 deletions plugins/rapid7_intsights/.CHECKSUM
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"spec": "23fa055c61c44298f0bd3a8550f3edfa",
"manifest": "9a1c0ed12f4a14563a7e6ee8431fcb56",
"setup": "03540fca0745c2f43e81830a80d402bb",
"schemas": [
{
"identifier": "add_manual_alert/schema.py",
"hash": "66fe76d79131cfff95fd23f003539a3d"
},
{
"identifier": "enrich_indicator/schema.py",
"hash": "d65d91c1451a8e7de47b9e709590f5ea"
},
{
"identifier": "get_alerts/schema.py",
"hash": "8bc5304d87461a5b72da0982032bb73a"
},
{
"identifier": "get_complete_alert_by_id/schema.py",
"hash": "e1caf7b9e81e3e8ccff0dec44f5ec2b7"
},
{
"identifier": "get_indicator_by_value/schema.py",
"hash": "39a599120e9f7d02c34a36f607085ae5"
},
{
"identifier": "get_indicator_scan_status/schema.py",
"hash": "da46d94cb70a3ad32d719881a4fde656"
},
{
"identifier": "rescan_indicator/schema.py",
"hash": "9d70900a799a50bafa5b1ba9245b8fe3"
},
{
"identifier": "takedown_request/schema.py",
"hash": "623d2b1efc3739038015ed9904bea097"
},
{
"identifier": "connection/schema.py",
"hash": "4d9563dcc56614543713c05f554ef869"
}
]
}
9 changes: 9 additions & 0 deletions plugins/rapid7_intsights/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
unit_test/**/*
unit_test
examples/**/*
examples
tests
tests/**/*
**/*.json
**/*.tar
**/*.gz
26 changes: 26 additions & 0 deletions plugins/rapid7_intsights/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM rapid7/insightconnect-python-3-38-plugin:4
# Refer to the following documentation for available SDK parent images: https://komand.github.io/python/sdk.html#version

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

# 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

# User to run plugin code. The two supported users are: root, nobody
USER nobody

ENTRYPOINT ["/usr/local/bin/icon_rapid7_intsights"]
53 changes: 53 additions & 0 deletions plugins/rapid7_intsights/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Include other Makefiles for improved functionality
INCLUDE_DIR = ../../tools/Makefiles
MAKEFILES := $(wildcard $(INCLUDE_DIR)/*.mk)
# We can't guarantee customers will have the include files
# - prefix to ignore Makefiles when not present
# https://www.gnu.org/software/make/manual/html_node/Include.html
-include $(MAKEFILES)

ifneq ($(MAKEFILES),)
$(info [$(YELLOW)*$(NORMAL)] Use ``make menu`` for available targets)
$(info [$(YELLOW)*$(NORMAL)] Including available Makefiles: $(MAKEFILES))
$(info --)
else
$(warning Makefile includes directory not present: $(INCLUDE_DIR))
endif

VERSION?=$(shell grep '^version: ' plugin.spec.yaml | sed 's/version: //')
NAME?=$(shell grep '^name: ' plugin.spec.yaml | sed 's/name: //')
VENDOR?=$(shell grep '^vendor: ' plugin.spec.yaml | sed 's/vendor: //')
CWD?=$(shell basename $(PWD))
_NAME?=$(shell echo $(NAME) | awk '{ print toupper(substr($$0,1,1)) tolower(substr($$0,2)) }')
PKG=$(VENDOR)-$(NAME)-$(VERSION).tar.gz

# Set default target explicitly. Make's default behavior is the first target in the Makefile.
# We don't want that behavior due to includes which are read first
.DEFAULT_GOAL := default # Make >= v3.80 (make -version)


default: image tarball

tarball:
$(info [$(YELLOW)*$(NORMAL)] Creating plugin tarball)
rm -rf build
rm -rf $(PKG)
tar -cvzf $(PKG) --exclude=$(PKG) --exclude=tests --exclude=run.sh *

image:
$(info [$(YELLOW)*$(NORMAL)] Building plugin image)
docker build --pull -t $(VENDOR)/$(NAME):$(VERSION) .
docker tag $(VENDOR)/$(NAME):$(VERSION) $(VENDOR)/$(NAME):latest

regenerate:
$(info [$(YELLOW)*$(NORMAL)] Regenerating schema from plugin.spec.yaml)
icon-plugin generate python --regenerate

export: image
$(info [$(YELLOW)*$(NORMAL)] Exporting docker image)
@printf "\n ---> Exporting Docker image to ./$(VENDOR)_$(NAME)_$(VERSION).tar\n"
@docker save $(VENDOR)/$(NAME):$(VERSION) | gzip > $(VENDOR)_$(NAME)_$(VERSION).tar

# Make will not run a target if a file of the same name exists unless setting phony targets
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: default tarball image regenerate
60 changes: 60 additions & 0 deletions plugins/rapid7_intsights/bin/icon_rapid7_intsights
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env python
# GENERATED BY KOMAND SDK - DO NOT EDIT
import os
import json
from sys import argv

Name = "Rapid7 IntSights"
Vendor = "rapid7"
Version = "1.0.0"
Description = "Rapid7 IntSights is disrupting external threat intelligence with a combination of human and automated collection, intelligent analysis, and strategic threat hunting that turns the clear, deep, and dark webs into an intelligence resource that any company can deploy"


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_rapid7_intsights import connection, actions, triggers

class ICONRapid7Intsights(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.AddManualAlert())

self.add_action(actions.EnrichIndicator())

self.add_action(actions.GetAlerts())

self.add_action(actions.GetCompleteAlertById())

self.add_action(actions.GetIndicatorByValue())

self.add_action(actions.GetIndicatorScanStatus())

self.add_action(actions.RescanIndicator())

self.add_action(actions.TakedownRequest())


"""Run plugin"""
cli = insightconnect_plugin_runtime.CLI(ICONRapid7Intsights())
cli.run()


if __name__ == "__main__":
main()
Binary file added plugins/rapid7_intsights/extension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading