Skip to content

Commit

Permalink
snyk and sdk aws-securityhub
Browse files Browse the repository at this point in the history
  • Loading branch information
rmurray-r7 committed Nov 1, 2024
1 parent a784d88 commit 2d32c7c
Show file tree
Hide file tree
Showing 20 changed files with 1,066 additions and 4,057 deletions.
12 changes: 6 additions & 6 deletions plugins/aws_securityhub/.CHECKSUM
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"spec": "e8c60e8e6d2cef74b29c0f018ca1c7cc",
"manifest": "55a81b8f634d5315e63df8b70849606f",
"setup": "946769d6ab46e81c65cfc562b4ea8e6b",
"spec": "b6597778f9a5ad4ad0bb28e4b411dbf9",
"manifest": "bb79ec4cba92bd39e2a880bd5810ac84",
"setup": "556656c4d2bbb0fa2f4c8b7ec5e93bc4",
"schemas": [
{
"identifier": "get_findings/schema.py",
"hash": "a0d1ce5adb9702c6542e223c8f571968"
"hash": "d6bb8f66b043a5c27fec35e85065a037"
},
{
"identifier": "connection/schema.py",
"hash": "56abf7bde85feb428c6a5c4606d30ad2"
"hash": "8b2ce51a053bec430d0b45e205930db1"
},
{
"identifier": "sqs_feed/schema.py",
"hash": "356ef906803ecefcb67e1b2244401973"
"hash": "c893c7004ea029cd51db3f3b163d9a31"
}
]
}
18 changes: 6 additions & 12 deletions plugins/aws_securityhub/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
FROM komand/python-3-37-slim-plugin:3
# Refer to the following documentation for available SDK parent images: https://docs.rapid7.com/insightconnect/sdk-guide/#sdk-guide
FROM --platform=linux/amd64 rapid7/insightconnect-python-3-slim-plugin:6.1.4

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
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 root
USER nobody

ENTRYPOINT ["/usr/local/bin/icon_aws_securityhub"]
16 changes: 8 additions & 8 deletions plugins/aws_securityhub/bin/icon_aws_securityhub
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python
# GENERATED BY KOMAND SDK - DO NOT EDIT
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
import os
import json
from sys import argv

Name = "AWS Security Hub"
Vendor = "rapid7"
Version = "2.0.3"
Version = "2.0.4"
Description = "This plugin utilizes AWS Security Hub to lists and describes security hub-aggregated findings and retrieve SQS messages"


Expand All @@ -22,10 +22,10 @@ def main():
from gevent import monkey
monkey.patch_all()

import komand
from icon_aws_securityhub import connection, actions, triggers
import insightconnect_plugin_runtime
from icon_aws_securityhub import connection, actions, triggers, tasks

class ICONAwsSecurityhub(komand.Plugin):
class ICONAwsSecurityhub(insightconnect_plugin_runtime.Plugin):
def __init__(self):
super(self.__class__, self).__init__(
name=Name,
Expand All @@ -35,12 +35,12 @@ def main():
connection=connection.Connection()
)
self.add_trigger(triggers.SqsFeed())

self.add_action(actions.GetFindings())


"""Run plugin"""
cli = komand.CLI(ICONAwsSecurityhub())
cli = insightconnect_plugin_runtime.CLI(ICONAwsSecurityhub())
cli.run()


Expand Down
Loading

0 comments on commit 2d32c7c

Please sign in to comment.