Komand

Latest version: v3.2.0

Safety actively analyzes 683322 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

3.2.0

Description

* Add new presets: `UNKNOWN`, `BASE64_ENCODE`, `BASE64_DECODE`, `INVALID_JSON`
* Add an optional `data` parameter for formatting response output

Tests


msg = 'blah'
raise PluginException(preset=PluginException.Preset.BASE64_ENCODE, data=msg)

Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 311, in handle_step
output = self.start_step(input_message['body'], 'action', logger, log_stream, is_test, is_debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 413, in start_step
output = func(params)
File "build/bdist.linux-x86_64/egg/icon_crap/actions/upper/action.py", line 20, in run
data=msg
PluginException: An error occurred during plugin execution!

Unable to base64 encode content due to incorrect padding length. This is likely a programming error, if the issue persists please contact support. Response was: blah



msg = 'blah'
raise PluginException(preset=PluginException.Preset.BASE64_DECODE, data=msg)

Traceback (most recent call last):
File "/usr/local/bin/icon_crap", line 4, in <module>
__import__('pkg_resources').run_script('crap-rapid7-plugin==1.0.0', 'icon_crap')
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 38, in <module>

File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 34, in main

File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 188, in run
args.func(args)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 138, in run_step
return self.execute_step(is_test=False, is_debug=args.debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 135, in execute_step
raise exception
komand.exceptions.LoggedException: An error occurred during plugin execution!

Unable to base64 decode content due to incorrect padding length. This is likely a programming error, if the issue persists please contact support. Response was: blah



msg = 'Unknown data'
raise PluginException(preset=PluginException.Preset.UNKNOWN, data=msg)

Traceback (most recent call last):
File "/usr/local/bin/icon_crap", line 4, in <module>
__import__('pkg_resources').run_script('crap-rapid7-plugin==1.0.0', 'icon_crap')
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 38, in <module>

File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 34, in main

File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 188, in run
args.func(args)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 138, in run_step
return self.execute_step(is_test=False, is_debug=args.debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 135, in execute_step
raise exception
komand.exceptions.LoggedException: An error occurred during plugin execution!

Something unexpected occurred. Check the logs and if the issue persists please contact support. Response was: Unknown data



msg = '{ \"asdf\": asdf }'
raise PluginException(preset=PluginException.Preset.UNKNOWN, data=msg)

Traceback (most recent call last):
File "/usr/local/bin/icon_crap", line 4, in <module>
__import__('pkg_resources').run_script('crap-rapid7-plugin==1.0.0', 'icon_crap')
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 38, in <module>

File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 34, in main

File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 188, in run
args.func(args)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 138, in run_step
return self.execute_step(is_test=False, is_debug=args.debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 135, in execute_step
raise exception
komand.exceptions.LoggedException: An error occurred during plugin execution!

Received an unexpected response from the server. (non-JSON or no response was received). Response was: { "asdf": asdf }



Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 311, in handle_step
output = self.start_step(input_message['body'], 'action', logger, log_stream, is_test, is_debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 413, in start_step
output = func(params)
File "build/bdist.linux-x86_64/egg/icon_crap/actions/lower/action.py", line 21, in run
data=msg
PluginException: An error occurred during plugin execution!

Something caused this. I don't have assistance but I have data! Response was: Blah


* Without `data`


Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 311, in handle_step
output = self.start_step(input_message['body'], 'action', logger, log_stream, is_test, is_debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 413, in start_step
output = func(params)
File "build/bdist.linux-x86_64/egg/icon_crap/actions/split_to_list/action.py", line 19, in run
assistance="I don't have assistance"
PluginException: An error occurred during plugin execution!

Something caused this. I don't have assistance

3.1.1

This release implements the following change(s):

Fix: PluginException now prints the proper message instead of `Connection test failed!`

3.1.0

This release implements the following change(s):

- New Exception type available: PluginException


from komand.exceptions import PluginException
import requests

r = requests.get(url="https://httpbin.org/status/404")
if r.status_code == 404:
raise PluginException(cause="Endpoint not found", assistance="Sketchy API ;)")
...

3.0.0

This release implements the following change(s):

New SDKs!

- Python 3 updated to 3.7 from 3.6
- Slim (Alpine-based) for Python 2.7.10 and Python 3.7
- Fat Python image replaced with Debian-slim Stretch

2.5.0

This release implements the following changes:

Workflow metadata can now be accessed within a plugin.
Example `self.connection.meta.workflow.__dict__`

Added additional support for easy python debugging.
When testing a plugin with the SDK you now just need to copy a JSON test to the komand_<plugin name> in main assigning it a variable and replacing `cli.run()` with `cli.execute_step()` passing it the variable of the JSON test.

2.4.1

This release implements the following change(s):

- All logging to stdout during plugin component sampling is suppressed to allow for easier sample generation.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.