|
| 1 | +{ |
| 2 | + "author": { |
| 3 | + "link": "https://www.linkedin.com/in/roei-sabag-247aa18/", |
| 4 | + "name": "Roei Sabag" |
| 5 | + }, |
| 6 | + "categories": [ |
| 7 | + "DataSecurity" |
| 8 | + ], |
| 9 | + "context": { |
| 10 | + "integration": { |
| 11 | + "github": { |
| 12 | + "document": "https://github.com/g4-api/g4-plugins/blob/main/docs/Actions/ProtectData.md", |
| 13 | + "source": "https://github.com/g4-api/g4-plugins/blob/main/src/G4.Plugins.Common/Actions/ProtectData.cs" |
| 14 | + }, |
| 15 | + "rag": { |
| 16 | + "description": "The ProtectData plugin encrypts a plaintext value using a caller-supplied key and encodes the encrypted output as Base64. The Value parameter supplies the plaintext and the Key parameter supplies the encryption key. The protected result is stored in the session parameter ProtectData:Result and exposed in the response entity under the key Result for downstream use.", |
| 17 | + "qa": [ |
| 18 | + { |
| 19 | + "question": "What does the ProtectData plugin do?", |
| 20 | + "answer": "It encrypts the Value parameter with the Key parameter and stores the Base64-encoded encrypted result in the session parameter ProtectData:Result." |
| 21 | + }, |
| 22 | + { |
| 23 | + "question": "How are the Value and Key parameters supplied to the plugin?", |
| 24 | + "answer": "Both are passed through the Argument property using the G4 parameter expression syntax, for example: {{$ --Value:MySecret --Key:MyEncryptionKey}}." |
| 25 | + }, |
| 26 | + { |
| 27 | + "question": "Where is the protected result available after the plugin runs?", |
| 28 | + "answer": "The Base64-encoded encrypted value is stored in the session parameter ProtectData:Result and is also accessible through the response entity under the key Result." |
| 29 | + }, |
| 30 | + { |
| 31 | + "question": "How can the protected result be recovered?", |
| 32 | + "answer": "Decode the session parameter value from Base64 using ConvertFromBase64, then decrypt the result with the same key that was used during encryption." |
| 33 | + } |
| 34 | + ] |
| 35 | + }, |
| 36 | + "sequentialWorkflow": { |
| 37 | + "$type": "Action", |
| 38 | + "componentType": "task", |
| 39 | + "iconProvider": { |
| 40 | + "name": "lock", |
| 41 | + "svg": null |
| 42 | + }, |
| 43 | + "label": "Protect Data", |
| 44 | + "model": "ActionRuleModel" |
| 45 | + }, |
| 46 | + "mcp": { |
| 47 | + "title": "Protect Data" |
| 48 | + } |
| 49 | + } |
| 50 | + }, |
| 51 | + "description": [ |
| 52 | + "### Purpose", |
| 53 | + "", |
| 54 | + "Encrypts a plaintext value with a caller-supplied key and encodes the result to Base64 for safe storage and transport.", |
| 55 | + "It takes the `Value` and `Key` parameters from the `Argument` expression, applies symmetric encryption, and stores the protected output.", |
| 56 | + "The encoded result is stored in the session as `ProtectData:Result` and exposed through the response entity.", |
| 57 | + "", |
| 58 | + "### Key Features and Functionality", |
| 59 | + "", |
| 60 | + "| Feature | Description |", |
| 61 | + "|-----------------|-------------------------------------------------------------------------------------------|", |
| 62 | + "| Encryption | Encrypts the `Value` parameter using the `Key` parameter before encoding. |", |
| 63 | + "| Base64 Encoding | Encodes the encrypted output to Base64 for safe transport and storage. |", |
| 64 | + "| Session Output | Stores the protected result in the session as `ProtectData:Result` for downstream access. |", |
| 65 | + "", |
| 66 | + "### Usages in RPA", |
| 67 | + "", |
| 68 | + "| Use Case | Description |", |
| 69 | + "|-------------------------|-------------------------------------------------------------------------------------------|", |
| 70 | + "| Credential Protection | Encrypt passwords or tokens before storing them in session parameters. |", |
| 71 | + "| Secure Data Hand-off | Pass encrypted values between workflow steps without exposing plaintext in logs or state. |", |
| 72 | + "| Config Value Protection | Protect sensitive configuration values before writing them to shared storage. |", |
| 73 | + "", |
| 74 | + "### Usages in Automation Testing", |
| 75 | + "", |
| 76 | + "| Use Case | Description |", |
| 77 | + "|------------------------|-------------------------------------------------------------------------------------------------|", |
| 78 | + "| Test Secret Management | Encrypt test credentials at runtime so they are never present in plaintext during a test run. |", |
| 79 | + "| Roundtrip Validation | Encrypt a known value and assert that decryption with the same key recovers the original input. |", |
| 80 | + "| Key Sensitivity Check | Verify that different encryption keys produce different protected outputs for the same value. |" |
| 81 | + ], |
| 82 | + "entity": [ |
| 83 | + { |
| 84 | + "description": [ |
| 85 | + "Contains the Base64-encoded encrypted string produced from the Value parameter.", |
| 86 | + "The value is available in the response entity under the key `Result` and also stored in the session as `ProtectData:Result`." |
| 87 | + ], |
| 88 | + "name": "Result", |
| 89 | + "type": "String" |
| 90 | + } |
| 91 | + ], |
| 92 | + "examples": [ |
| 93 | + { |
| 94 | + "context": { |
| 95 | + "annotations": { |
| 96 | + "edge_cases": [ |
| 97 | + "Empty Value produces an encrypted empty string encoded to Base64", |
| 98 | + "Empty Key may result in unkeyed or weakly keyed encryption depending on the underlying algorithm", |
| 99 | + "Value containing special characters is encrypted and encoded without alteration" |
| 100 | + ], |
| 101 | + "expected_result": "The value 'MySecret' is encrypted with the key 'SuperSecret' and the Base64-encoded result is stored in ProtectData:Result.", |
| 102 | + "notes": "The plaintext value is never stored; only the encrypted Base64 output is retained.", |
| 103 | + "use_case": "protect_data_static_value", |
| 104 | + "version": "1.0" |
| 105 | + }, |
| 106 | + "labels": [ |
| 107 | + "DataSecurity", |
| 108 | + "Encryption", |
| 109 | + "StaticValue" |
| 110 | + ] |
| 111 | + }, |
| 112 | + "description": [ |
| 113 | + "### Encrypt a Static Value", |
| 114 | + "", |
| 115 | + "Encrypt a fixed plaintext value using a known key during automation execution.", |
| 116 | + "It uses the `ProtectData` plugin with `--Value:MySecret` and `--Key:SuperSecret`.", |
| 117 | + "The value is encrypted and the result is Base64-encoded before being stored in the session as `ProtectData:Result`." |
| 118 | + ], |
| 119 | + "rule": { |
| 120 | + "$type": "Action", |
| 121 | + "argument": "{{$ --Value:MySecret --Key:SuperSecret}}", |
| 122 | + "pluginName": "ProtectData" |
| 123 | + } |
| 124 | + }, |
| 125 | + { |
| 126 | + "context": { |
| 127 | + "annotations": { |
| 128 | + "edge_cases": [ |
| 129 | + "Session parameter does not exist — the expression resolves to an empty string which is then encrypted", |
| 130 | + "Session parameter value contains special characters — encryption handles the full resolved value" |
| 131 | + ], |
| 132 | + "expected_result": "The runtime value of the Password session parameter is encrypted with the key 'VaultKey' and stored as Base64 in ProtectData:Result.", |
| 133 | + "notes": "The G4 expression resolves the session parameter value at runtime before encryption. The plaintext is never retained in the output.", |
| 134 | + "use_case": "protect_data_expression_value", |
| 135 | + "version": "1.0" |
| 136 | + }, |
| 137 | + "labels": [ |
| 138 | + "DataSecurity", |
| 139 | + "Encryption", |
| 140 | + "Expression", |
| 141 | + "SessionParameter" |
| 142 | + ] |
| 143 | + }, |
| 144 | + "description": [ |
| 145 | + "### Encrypt a Session Parameter Value", |
| 146 | + "", |
| 147 | + "Encrypt the runtime value of a session parameter using a known key.", |
| 148 | + "It uses the `ProtectData` plugin with `--Value:{{$Get-Parameter --Name:Password --Scope:Session}}` and `--Key:VaultKey`.", |
| 149 | + "The G4 expression is resolved at runtime, the resolved value is encrypted, and the Base64 result is stored in the session as `ProtectData:Result`." |
| 150 | + ], |
| 151 | + "rule": { |
| 152 | + "$type": "Action", |
| 153 | + "argument": "{{$ --Value:{{$Get-Parameter --Name:Password --Scope:Session}} --Key:VaultKey}}", |
| 154 | + "pluginName": "ProtectData" |
| 155 | + } |
| 156 | + } |
| 157 | + ], |
| 158 | + "key": "ProtectData", |
| 159 | + "namespace": "G4.Plugins.Common", |
| 160 | + "outputParameters": [ |
| 161 | + { |
| 162 | + "description": [ |
| 163 | + "The session parameter that holds the Base64-encoded encrypted result.", |
| 164 | + "Its value can be decoded from Base64 and decrypted with the original key to recover the plaintext.", |
| 165 | + "It can be referenced by other parameters or expressions in downstream workflow steps." |
| 166 | + ], |
| 167 | + "mandatory": true, |
| 168 | + "name": "ProtectData:Result", |
| 169 | + "type": "String" |
| 170 | + } |
| 171 | + ], |
| 172 | + "platforms": [ |
| 173 | + "Any" |
| 174 | + ], |
| 175 | + "pluginType": "Action", |
| 176 | + "properties": [ |
| 177 | + { |
| 178 | + "description": [ |
| 179 | + "Supplies the `Value` and `Key` parameters using the G4 parameter expression syntax.", |
| 180 | + "Use `--Value` to provide the plaintext to encrypt and `--Key` to provide the encryption key.", |
| 181 | + "Both parameters are required; omitting either will result in an empty or unkeyed encryption." |
| 182 | + ], |
| 183 | + "mandatory": true, |
| 184 | + "name": "Argument", |
| 185 | + "type": "String|Expression" |
| 186 | + } |
| 187 | + ], |
| 188 | + "parameters": [ |
| 189 | + { |
| 190 | + "description": [ |
| 191 | + "The plaintext value to encrypt.", |
| 192 | + "Accepts a literal string or a G4 expression that resolves at runtime.", |
| 193 | + "This value is never stored in plaintext; only the encrypted Base64 output is retained." |
| 194 | + ], |
| 195 | + "mandatory": true, |
| 196 | + "name": "Value", |
| 197 | + "type": "String" |
| 198 | + }, |
| 199 | + { |
| 200 | + "description": [ |
| 201 | + "The encryption key used to protect the value.", |
| 202 | + "Must be the same key used during any subsequent decryption step.", |
| 203 | + "Keep this key secure; loss of the key makes the encrypted value unrecoverable." |
| 204 | + ], |
| 205 | + "mandatory": true, |
| 206 | + "name": "Key", |
| 207 | + "type": "String" |
| 208 | + } |
| 209 | + ], |
| 210 | + "protocol": { |
| 211 | + "apiDocumentation": "None", |
| 212 | + "w3c": "None" |
| 213 | + }, |
| 214 | + "summary": [ |
| 215 | + "Encrypts a plaintext value with a caller-supplied key and encodes the result to Base64.", |
| 216 | + "Stores the protected output in the session as ProtectData:Result for downstream access.", |
| 217 | + "The original value can be recovered by decoding from Base64 and decrypting with the same key." |
| 218 | + ], |
| 219 | + "version": "4" |
| 220 | +} |
0 commit comments