From 7a8fa7721d57fa1dbeb29cf26fe95a4610cd9e53 Mon Sep 17 00:00:00 2001 From: Robert <144030336+rbowden-r7@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:58:49 +0000 Subject: [PATCH] String 1.4.2 Release (fedRAMP) (#3006) * SOAR-18473: bump SDK and address vulnerabilities (#3000) * [SOAR-18526] String (fedRAMP) plugin.spec sync (#3044) * plugin.spec sync * updaing help.md * Updating help.md --------- Co-authored-by: rmurray-r7 --- plugins/string/.CHECKSUM | 8 +-- plugins/string/Dockerfile | 2 +- plugins/string/bin/komand_string | 4 +- plugins/string/help.md | 56 +++++++++---------- .../actions/split_to_object/schema.py | 2 +- plugins/string/plugin.spec.yaml | 13 +++-- plugins/string/setup.py | 4 +- 7 files changed, 43 insertions(+), 46 deletions(-) diff --git a/plugins/string/.CHECKSUM b/plugins/string/.CHECKSUM index f482dcb19d..6c72bc9922 100644 --- a/plugins/string/.CHECKSUM +++ b/plugins/string/.CHECKSUM @@ -1,7 +1,7 @@ { - "spec": "2d872dd50b19daa898791255146106af", - "manifest": "922ea555f44944378c4f1b096747bd0c", - "setup": "c44b119f9f8f9981c367bc04a6dc9234", + "spec": "f712d68ed3cdd1ab0abb816e1500f77d", + "manifest": "ff9feb5c62cc6078a3212085652011c3", + "setup": "394787d1ead943699cecc2712c114b1b", "schemas": [ { "identifier": "length/schema.py", @@ -25,7 +25,7 @@ }, { "identifier": "split_to_object/schema.py", - "hash": "d39a4841d4f5601bc93f5a28ae286eeb" + "hash": "67ae59d7cf96ba0f195ab4e26dfa6592" }, { "identifier": "trim/schema.py", diff --git a/plugins/string/Dockerfile b/plugins/string/Dockerfile index a9094f6b81..c398da6653 100755 --- a/plugins/string/Dockerfile +++ b/plugins/string/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 rapid7/insightconnect-python-3-slim-plugin:6.1.0 +FROM --platform=linux/amd64 rapid7/insightconnect-python-3-slim-plugin:6.2.2 LABEL organization=rapid7 LABEL sdk=python diff --git a/plugins/string/bin/komand_string b/plugins/string/bin/komand_string index b9f0777c7a..c8f9c9228e 100755 --- a/plugins/string/bin/komand_string +++ b/plugins/string/bin/komand_string @@ -6,8 +6,8 @@ from sys import argv Name = "String Operations" Vendor = "rapid7" -Version = "1.4.1" -Description = "The String plugin provides common programmatic string operations" +Version = "1.4.2" +Description = "The String Operations plugin allows easy manipulation of string data.This plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods)" def main(): diff --git a/plugins/string/help.md b/plugins/string/help.md index 0488b090b0..208a435c3f 100644 --- a/plugins/string/help.md +++ b/plugins/string/help.md @@ -2,7 +2,7 @@ The String Operations plugin allows easy manipulation of string data. -This plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods). +This plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods) # Key Features @@ -168,7 +168,7 @@ Example output: #### Split String to List -This action is used to convert a string to a list of strings. +This action is used to converts a string to a list of strings ##### Input @@ -206,16 +206,22 @@ Example output: ``` #### Split String to Object - + This action is used to convert a string to an object containing key:value strings. -Any input requiring more than a single key:value pair, e.g. `USER=Bob` needs to use the `block_delimiter` option. -In this case, the input string is split by the `block_delimiter` character first, and the resulting items are then split -by the `string_delimiter` option. Stripping of double-quotes is automatically applied in this situation for each item before the plugin returns it. +Any input requiring more than a +single key:value pair, e.g. `USER=Bob` needs to use the `block_delimiter` option. In this case, the input string is +split by the `block_delimiter` character first, and the resulting items are then split by the `string_delimiter` option. + Stripping of double-quotes is automatically applied in this situation for each item before the plugin returns it. + +The +[output object](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema) +on the action's page can be modified to pre-populate the workflow with the names of the keys. It allows users the +ability to use the green selector and choose a specific variable later in the workflow by name. [Input +templating](https://docs.komand.com/docs/input-templating) would need to be used to obtain variables by name otherwise. -The [output schema object](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema) on the action's page can be modified to pre-populate the workflow with the names of the keys. -It allows users the ability to use the green selector and choose a specific variable later in the workflow by name. -[Input templating](https://docs.komand.com/docs/input-templating) would need to be used to obtain variables by name otherwise. + +Please refer to troubleshooting section for a more complex example ##### Input @@ -251,27 +257,6 @@ Example output: } ``` -Here is another example with a slightly more complex string input that contains multiple key:value pairs. -These pairs are separated from each other by a space, and the keys and values within each pair are separated by an equal sign: - -``` -Computer_ID="bef41e8b-47b8-e188-8e43-3a2b662dd55d" Computer_Name="dgdemo\RGWin64" Computer_Type="Windows" -``` - -Setting `block_delimiter` to ` ` and `string_delimiter` to `=` will return the information presented in the example below. - -Example output: - -``` -{ - "object": { - "Computer_ID": "bef41e8b-47b8-e188-8e43-3a2b662dd55d", - "Computer_Name": "dgdemo\RGWin64", - "Computer_Type": "Windows" - } -} -``` - #### Trim This action is used to trim a string of leading and trailing whitespace @@ -348,10 +333,19 @@ Example output: ## Troubleshooting -There may be complex string manipulation needs that are likely outside the scope of this plugin. If this is the case, consider using the Python 3 Script plugin instead. +* `Split String to Object`: if the input contains multiple key:value pairs and these pairs are separated from each other by a space, and the keys and values within each pair are separated by an equal sign we can follow the below example: + + + Example text: `Computer_ID="bef41e8b-47b8-e188-8e43-3a2b662dd55d" Computer_Name="dgdemo\RGWin64" Computer_Type="Windows"` + + Example Input: `{"block_delimiter": " ","string": +"Computer_ID="bef41e8b-47b8-e188-8e43-3a2b662dd55d" Computer_Name="dgdemo RGWin64" Computer_Type="Windows","string_delimiter": "="}` + + Example output: `{ "object": { "Computer_ID": "bef41e8b-47b8-e188-8e43-3a2b662dd55d", "Computer_Name": "dgdemo RGWin64", "Computer_Type": "Windows" } }` + + +* There may be complex string manipulation needs that are likely outside the scope of this plugin. If this is the case, consider using the Python 3 Script plugin instead. # Version History +* 1.4.2 - Updated SDK to the latest version (v6.2.2) | Address vulnerabilities * 1.4.1 - Initial updates for fedramp compliance | Updated SDK to the latest version * 1.4.0 - New action Replace * 1.3.1 - Update to v4 Python plugin runtime diff --git a/plugins/string/komand_string/actions/split_to_object/schema.py b/plugins/string/komand_string/actions/split_to_object/schema.py index 76a8da5298..62a074997a 100755 --- a/plugins/string/komand_string/actions/split_to_object/schema.py +++ b/plugins/string/komand_string/actions/split_to_object/schema.py @@ -4,7 +4,7 @@ class Component: - DESCRIPTION = "Converts a string to an object containing key:value strings" + DESCRIPTION = "This action is used to convert a string to an object containing key:value strings.Any input requiring more than a single key:value pair, e.g. `USER=Bob` needs to use the `block_delimiter` option. In this case, the input string is split by the `block_delimiter` character first, and the resulting items are then split by the `string_delimiter` option. Stripping of double-quotes is automatically applied in this situation for each item before the plugin returns it.The [output object](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema) on the action's page can be modified to pre-populate the workflow with the names of the keys. It allows users the ability to use the green selector and choose a specific variable later in the workflow by name. [Input templating](https://docs.komand.com/docs/input-templating) would need to be used to obtain variables by name otherwise.Please refer to troubleshooting section for a more complex example" class Input: diff --git a/plugins/string/plugin.spec.yaml b/plugins/string/plugin.spec.yaml index 1961ae7140..ed8427cfa2 100644 --- a/plugins/string/plugin.spec.yaml +++ b/plugins/string/plugin.spec.yaml @@ -3,8 +3,8 @@ extension: plugin products: [insightconnect] name: string title: String Operations -description: The String plugin provides common programmatic string operations -version: 1.4.1 +description: "The String Operations plugin allows easy manipulation of string data.\n\nThis plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods)" +version: 1.4.2 connection_version: 1 vendor: rapid7 support: community @@ -25,7 +25,7 @@ hub_tags: features: [] sdk: type: slim - version: 6.1.0 + version: 6.2.2 user: nobody key_features: - "Split a string to a list of elements" @@ -33,6 +33,7 @@ key_features: - "Upper case, lower case, and trim a string" - "Replace parts of a string" version_history: + - "1.4.2 - Updated SDK to the latest version (v6.2.2) | Address vulnerabilities" - "1.4.1 - Initial updates for fedramp compliance | Updated SDK to the latest version" - "1.4.0 - New action Replace" - "1.3.1 - Update to v4 Python plugin runtime" @@ -42,7 +43,9 @@ version_history: - "1.1.0 - New action Set Encoding" - "1.0.1 - Update plugin tag from `util` to `utilities` for Marketplace searchability" - "1.0.0 - Initial plugin" -troubleshooting: "There may be complex string manipulation needs that are likely outside the scope of this plugin. If this is the case, consider using the Python 3 Script plugin instead." +troubleshooting: + - "`Split String to Object`: if the input contains multiple key:value pairs and these pairs are separated from each other by a space, and the keys and values within each pair are separated by an equal sign we can follow the below example:\n\n + Example text: `Computer_ID=\"bef41e8b-47b8-e188-8e43-3a2b662dd55d\" Computer_Name=\"dgdemo\\RGWin64\" Computer_Type=\"Windows\"`\n + Example Input: `{\"block_delimiter\": \" \",\"string\":\n\"Computer_ID=\"bef41e8b-47b8-e188-8e43-3a2b662dd55d\" Computer_Name=\"dgdemo RGWin64\" Computer_Type=\"Windows\",\"string_delimiter\": \"=\"}`\n + Example output: `{ \"object\": { \"Computer_ID\": \"bef41e8b-47b8-e188-8e43-3a2b662dd55d\", \"Computer_Name\": \"dgdemo RGWin64\", \"Computer_Type\": \"Windows\" } }`\n\n" + - "There may be complex string manipulation needs that are likely outside the scope of this plugin. If this is the case, consider using the Python 3 Script plugin instead." links: - "[Python 3 String Methods](https://docs.python.org/3/library/stdtypes.html#string-methods)" references: @@ -108,7 +111,7 @@ actions: example: '["This", "is", "a", "sentence"]' split_to_object: title: Split String to Object - description: Converts a string to an object containing key:value strings + description: "This action is used to convert a string to an object containing key:value strings.\n\nAny input requiring more than a single key:value pair, e.g. `USER=Bob` needs to use the `block_delimiter` option. In this case, the input string is split by the `block_delimiter` character first, and the resulting items are then split by the `string_delimiter` option. Stripping of double-quotes is automatically applied in this situation for each item before the plugin returns it.\n\nThe [output object](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema) on the action's page can be modified to pre-populate the workflow with the names of the keys. It allows users the ability to use the green selector and choose a specific variable later in the workflow by name. [Input templating](https://docs.komand.com/docs/input-templating) would need to be used to obtain variables by name otherwise.\n\nPlease refer to troubleshooting section for a more complex example" input: string: title: String Input diff --git a/plugins/string/setup.py b/plugins/string/setup.py index b38c31c243..6cf722ca73 100755 --- a/plugins/string/setup.py +++ b/plugins/string/setup.py @@ -3,8 +3,8 @@ setup(name="string-rapid7-plugin", - version="1.4.1", - description="The String plugin provides common programmatic string operations", + version="1.4.2", + description="The String Operations plugin allows easy manipulation of string data.This plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods)", author="rapid7", author_email="", url="",