-
Notifications
You must be signed in to change notification settings - Fork 60
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
SoupAPI Action password Encryption #4038
Conversation
WalkthroughThis pull request introduces enhanced password handling and encryption mechanisms across multiple files in the Ginger project. The changes focus on improving security by adding methods to decrypt and encrypt passwords in various web service and action-related components. The modifications include adding Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Nitpick comments (7)
Ginger/Ginger/Run/RunSetActions/RunSetActionDeliveryMethodConfigPage.xaml (1)
41-41
: LGTM! Consider adding password masking.The switch to UCValueExpression with LostKeyboardFocus event handler is a good security improvement. The increased dimensions and centered alignment enhance usability.
Consider adding a password masking feature to prevent shoulder surfing:
- <Actions:UCValueExpression x:Name="CertificatePasswordUCValueExpression" HorizontalAlignment="Left" Width="260" VerticalContentAlignment="Center" Height="30" LostKeyboardFocus="CertificatePasswordUCValueExpression_LostKeyboardFocus" Margin="2,0,0,0"/> + <Actions:UCValueExpression x:Name="CertificatePasswordUCValueExpression" HorizontalAlignment="Left" Width="260" VerticalContentAlignment="Center" Height="30" LostKeyboardFocus="CertificatePasswordUCValueExpression_LostKeyboardFocus" Margin="2,0,0,0" PasswordChar="●"/>Ginger/GingerCoreCommon/Actions/Webservices/ActSoapUI.cs (1)
202-225
: Add null check for 'password' parameter in 'DecryptPassword' methodSimilar to other instances, the
DecryptPassword
method lacks a null check for thepassword
parameter. Adding this check will prevent potentialNullReferenceException
errors.Apply this diff to add the null check:
public string DecryptPassword(string password, bool isPasswordValueExpression) { + if (password == null) + { + throw new ArgumentNullException(nameof(password)); + } string decryptedPassword = string.Empty; // Rest of the methodGinger/GingerCoreNET/ActionsLib/Webservices/ActWebAPIBase.cs (1)
408-431
: LGTM! Well-structured password decryption implementation.The implementation correctly handles both regular passwords and value expressions, with proper encryption detection and decryption using the
EncryptionHandler
.Consider adding the following to the method documentation:
Ginger/Ginger/Actions/ActionEditPages/WebServices/ActSoapUIEditPage.xaml (1)
197-197
: LGTM! Good password field security implementation.The
LostKeyboardFocus
event handler ensures immediate password encryption when the user leaves the field, enhancing security.Consider adding an accessibility tooltip to indicate that the password will be automatically encrypted for security.
Ginger/GingerCoreNET/Drivers/WebServicesDriver/SoapUIUtils.cs (1)
153-158
: LGTM! Secure password handling in command generation.The implementation correctly uses the new
DecryptPassword
method and properly handles the decrypted password in the command string.Consider adding error handling for potential decryption failures:
if (!string.IsNullOrEmpty(password)) { + try { var decryptedPassword = mAct.DecryptPassword(password, ValueExpression.IsThisAValueExpression(password)); commandParam = commandParam + " -p" + Quotationmark + decryptedPassword + Quotationmark; + } catch (Exception ex) { + mAct.Error = "Failed to decrypt password"; + mAct.ExInfo = ex.Message; + throw; + } }Ginger/GingerCoreNET/Drivers/WebServicesDriver/HttpWebClientUtils.cs (1)
253-253
: LGTM! Password decryption implementation looks secure.The implementation correctly decrypts the certificate password while maintaining support for value expressions. This ensures sensitive certificate passwords are not stored in plain text.
Consider adding a debug log statement (with masked password) to help with troubleshooting certificate loading issues.
Ginger/Ginger/Actions/ActionEditPages/WebServices/ActSoapUIEditPage.xaml.cs (1)
713-741
: LGTM! Password encryption implementation is consistent with ActWebAPIEditPage.The implementation correctly handles password encryption with the same security considerations as ActWebAPIEditPage.
Consider extracting the common password encryption logic into a shared base class or utility class to reduce code duplication between ActSoapUIEditPage and ActWebAPIEditPage. This would improve maintainability and ensure consistent behavior.
Example refactor:
+ public static class PasswordEncryptionUtils { + public static void EncryptPasswordIfNeeded(string password, bool isValueExpression, Action<string> updatePassword) { + if (!string.IsNullOrEmpty(password) && !isValueExpression && !EncryptionHandler.IsStringEncrypted(password)) { + updatePassword(EncryptionHandler.EncryptwithKey(password)); + } + } + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
Ginger/Ginger/Actions/ActionEditPages/WebServices/ActSoapUIEditPage.xaml
(1 hunks)Ginger/Ginger/Actions/ActionEditPages/WebServices/ActSoapUIEditPage.xaml.cs
(2 hunks)Ginger/Ginger/Actions/ActionEditPages/WebServices/ActWebAPIEditPage.xaml
(1 hunks)Ginger/Ginger/Actions/ActionEditPages/WebServices/ActWebAPIEditPage.xaml.cs
(2 hunks)Ginger/Ginger/Run/RunSetActions/RunSetActionDeliveryMethodConfigPage.xaml
(1 hunks)Ginger/Ginger/Run/RunSetActions/RunSetActionDeliveryMethodConfigPage.xaml.cs
(1 hunks)Ginger/GingerCoreCommon/Actions/Webservices/ActSoapUI.cs
(1 hunks)Ginger/GingerCoreCommon/GeneralLib/Email.cs
(1 hunks)Ginger/GingerCoreCommon/GingerCoreCommon.csproj
(1 hunks)Ginger/GingerCoreCommon/Repository/ApplicationModelLib/APIModelLib/ApplicationAPIModel.cs
(1 hunks)Ginger/GingerCoreNET/ActionsLib/Webservices/ActWebAPIBase.cs
(1 hunks)Ginger/GingerCoreNET/Drivers/WebServicesDriver/HttpWebClientUtils.cs
(2 hunks)Ginger/GingerCoreNET/Drivers/WebServicesDriver/SoapUIUtils.cs
(1 hunks)Ginger/GingerCoreNET/GeneralLib/EmailOperations.cs
(2 hunks)Ginger/GingerCoreNET/ValueExpressionLib/ValueExpression.cs
(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- Ginger/GingerCoreCommon/GeneralLib/Email.cs
- Ginger/GingerCoreCommon/Repository/ApplicationModelLib/APIModelLib/ApplicationAPIModel.cs
- Ginger/GingerCoreNET/ValueExpressionLib/ValueExpression.cs
🔇 Additional comments (5)
Ginger/Ginger/Run/RunSetActions/RunSetActionDeliveryMethodConfigPage.xaml.cs (1)
136-164
: Verify encryption implementation across the codebase.
Let's ensure consistent password encryption handling across different components.
✅ Verification successful
Based on the search results, I can now generate the final response:
Password encryption implementation is consistently handled across the codebase
The verification shows consistent password encryption patterns:
- All sensitive password fields use
EncryptionHandler.EncryptwithKey()
for encryption - Password encryption is triggered on focus loss events
- Value expressions are properly checked before encryption
- Similar pattern is used across different components:
- Email configuration (UCEmailConfigView)
- Web API actions (ActWebAPIEditPage)
- SOAP UI actions (ActSoapUIEditPage)
- Variable password strings (VariablePasswordStringPage)
- Database configurations
- Source control credentials
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for consistent password encryption implementation across components
# Look for similar password handling patterns
echo "Searching for password-related TextBox controls..."
rg -l "Password.*TextBox" --type xaml
echo "Checking for LostKeyboardFocus handlers..."
rg "LostKeyboardFocus.*Password" --type xaml -A 2
echo "Checking for EncryptionHandler usage..."
rg "EncryptionHandler\.Encrypt" --type cs -A 2
echo "Looking for potential unencrypted password handling..."
rg -i "password.*=.*text" --type cs
Length of output: 16489
Ginger/GingerCoreCommon/GingerCoreCommon.csproj (1)
55-58
: Ensure the new ProjectReference does not introduce circular dependencies
Adding a project reference to GingerPluginCore.csproj
is appropriate to support the new functionalities. However, ensure that this addition does not introduce any circular dependencies, which could cause build issues.
Run the following script to check for circular dependencies:
If the second command returns any results, it indicates a circular dependency that needs to be addressed.
✅ Verification successful
No circular dependencies detected - reference structure is valid
The verification confirms that while GingerCoreCommon references GingerPluginCore, there is no reverse reference from GingerPluginCore back to GingerCoreCommon, indicating a clean, unidirectional dependency structure.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for circular dependencies involving GingerCoreCommon and GingerPluginCore.
# Expected result: No circular dependencies found.
# Find all project references in GingerCoreCommon.csproj
grep -r '<ProjectReference Include' Ginger/GingerCoreCommon/ | grep 'GingerPluginCore'
# Find if GingerPluginCore references GingerCoreCommon
grep -r '<ProjectReference Include' Ginger/GingerPluginCore/ | grep 'GingerCoreCommon'
Length of output: 300
Ginger/Ginger/Actions/ActionEditPages/WebServices/ActWebAPIEditPage.xaml (1)
188-188
: Confirm the existence and correctness of the event handler
The LostKeyboardFocus
event has been added to CertificatePasswordUCValueExpression
, which is appropriate for handling password encryption when the user leaves the control. Ensure that the corresponding event handler CertificatePasswordUCValueExpression_LostKeyboardFocus
is implemented correctly in the code-behind file ActWebAPIEditPage.xaml.cs
and that it properly encrypts the certificate password.
Ginger/GingerCoreNET/Drivers/WebServicesDriver/HttpWebClientUtils.cs (1)
867-868
: LGTM! Null check prevents potential NullReferenceException.
The defensive null check ensures that ContentType is properly initialized before use.
Ginger/Ginger/Actions/ActionEditPages/WebServices/ActWebAPIEditPage.xaml.cs (1)
682-710
: LGTM! Password encryption implementation is robust and secure.
The implementation:
- Encrypts passwords automatically when focus is lost from the input field
- Preserves value expressions without encryption
- Prevents double encryption of already encrypted passwords
- Uses a centralized encryption handler
Ginger/Ginger/Run/RunSetActions/RunSetActionDeliveryMethodConfigPage.xaml.cs
Outdated
Show resolved
Hide resolved
Ginger/Ginger/Run/RunSetActions/RunSetActionDeliveryMethodConfigPage.xaml.cs
Outdated
Show resolved
Hide resolved
Ginger/Ginger/Run/RunSetActions/RunSetActionDeliveryMethodConfigPage.xaml.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (6)
Ginger/GingerCoreCommon/Actions/Act.cs (2)
2131-2134
: Consider throwing an exception for null passwords.
Currently, the method returnsnull
ifpassword
isnull
. While this is acceptable, you may consider throwing anArgumentNullException
or logging a warning, depending on whether your code expects non-null passwords. This ensures that any accidental null usage is caught early.+ // Potential alternative: throw new ArgumentNullException(nameof(password)); if (password == null) { return null; }
2145-2146
: Add try-catch for decryption.
Decryption can fail if the string is malformed or if there are encryption key issues. Consider wrapping the decryption logic in a try-catch block and logging or re-throwing to ensure robust error handling.string decryptedPassword = string.Empty; try { decryptedPassword = EncryptionHandler.IsStringEncrypted(evaluatedValue) ? EncryptionHandler.DecryptwithKey(evaluatedValue) : evaluatedValue; } catch (Exception ex) { // Log or handle as desired throw new SecurityException("Decryption failed.", ex); }Ginger/Ginger/Run/RunSetActions/RunSetActionDeliveryMethodConfigPage.xaml.cs (2)
137-151
: Encapsulate UI exception handling.
WithinCertificatePasswordUCValueExpression_LostKeyboardFocus
, the method already catches exceptions. However, consider centralizing or re-throwing them after logging for standardized error handling across the UI.
157-160
: Check for password with only whitespace.
IsPasswordValueExpression
currently validates againstnull
. Consider trimming the string and verifying if it’s empty or whitespace-only to be even more robust and guard against accidental trailing spaces.- return CertificatePasswordUCValueExpression?.ValueTextBox?.Text != null + var text = CertificatePasswordUCValueExpression?.ValueTextBox?.Text?.Trim(); + return !string.IsNullOrEmpty(text) && ValueExpression.IsThisAValueExpression(text);Ginger/GingerCoreNET/GeneralLib/EmailOperations.cs (1)
291-314
: Confirm robust encryption error handling.
TheDecryptPassword
method correctly checks if the original string is encrypted. However, a failed decryption could still return unexpected results. Consider adding a try-catch to handle anyCryptographicException
or unexpected states from theEncryptionHandler
.+try +{ decryptedPassword = EncryptionHandler.IsStringEncrypted(password) ? EncryptionHandler.DecryptwithKey(password) : password; +} +catch (CryptographicException ex) +{ + throw new InvalidOperationException("Failed to decrypt password.", ex); +}Ginger/GingerCoreNET/Drivers/WebServicesDriver/HttpWebClientUtils.cs (1)
867-868
: Add fallback for unknown content type.
WhenContentType
is null, you set it based oneContentType
. IfeContentType
is not among the listed enum values, you may end up with an unexpected fallback. Consider logging or throwing an error if no suitable fallback is found, ensuring consistency.default: + // Possibly log or throw an exception if an unrecognized content type occurs. break;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
Ginger/Ginger/Run/RunSetActions/RunSetActionDeliveryMethodConfigPage.xaml.cs
(2 hunks)Ginger/GingerCoreCommon/Actions/Act.cs
(1 hunks)Ginger/GingerCoreCommon/Actions/Webservices/ActSoapUI.cs
(1 hunks)Ginger/GingerCoreNET/Drivers/WebServicesDriver/HttpWebClientUtils.cs
(2 hunks)Ginger/GingerCoreNET/Drivers/WebServicesDriver/SoapUIUtils.cs
(1 hunks)Ginger/GingerCoreNET/GeneralLib/EmailOperations.cs
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- Ginger/GingerCoreCommon/Actions/Webservices/ActSoapUI.cs
- Ginger/GingerCoreNET/Drivers/WebServicesDriver/SoapUIUtils.cs
🔇 Additional comments (3)
Ginger/GingerCoreCommon/Actions/Act.cs (1)
2122-2123
: Use consistent naming in the method summary.
The XML documentation refers to "the given password" across both parameters and summary, maintaining clarity. This is good. Just ensure that references to various parameter names are consistent throughout the documentation for better readability.
Ginger/Ginger/Run/RunSetActions/RunSetActionDeliveryMethodConfigPage.xaml.cs (1)
162-183
: 🛠️ Refactor suggestion
Prevent repeated encryptions.
In EncryptPasswordIfNeeded
, after you replace the plain password with its encrypted counterpart, the method does not track whether encryption has already been performed. Consider storing a flag or verifying with IsStringEncrypted
again to ensure you don't re-encrypt an already encrypted password in subsequent calls.
if (!string.IsNullOrEmpty(password)
&& !IsPasswordValueExpression()
&& !EncryptionHandler.IsStringEncrypted(password))
{
CertificatePasswordUCValueExpression.ValueTextBox.Text
= EncryptionHandler.EncryptwithKey(password);
}
+ // else if(EncryptionHandler.IsStringEncrypted(password))
+ // {
+ // // Possibly skip
+ // }
Likely invalid or redundant comment.
Ginger/GingerCoreNET/Drivers/WebServicesDriver/HttpWebClientUtils.cs (1)
253-253
: Verify null or invalid certificateKey.
Here, certificateKey
is overwritten with the decrypted result. If decryption fails or certificateKey
was already invalid, certificateKey
will be empty or null. Consider verifying the outcome, and handling it before proceeding to add the client certificate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
Ginger/GingerCoreNET/GeneralLib/EmailOperations.cs (2)
151-154
:⚠️ Potential issueEnhance certificate password handling security
The certificate password decryption and usage needs additional security measures:
- Add validation for the decrypted password before using it
- Wrap the certificate operations in a try-catch block to handle cryptographic exceptions
- Consider securely clearing sensitive data from memory after use
Apply this diff to improve the security:
if (!string.IsNullOrEmpty(CertificateKey)) { - CertificateKey = DecryptPassword(CertificateKey, ValueExpression.IsThisAValueExpression(CertificateKey)); + try + { + CertificateKey = DecryptPassword(CertificateKey, ValueExpression.IsThisAValueExpression(CertificateKey)); + if (string.IsNullOrEmpty(CertificateKey)) + { + Email.Event = "Certificate password decryption failed"; + return false; + } + } + catch (Exception ex) + { + Email.Event = $"Certificate password error: {ex.Message}"; + return false; + } }
291-310
: 🛠️ Refactor suggestionAdd parameter validation and documentation to DecryptPassword method
The method needs input validation and XML documentation to improve security and maintainability:
- Add null check for the password parameter
- Add XML documentation
- Consider making the method internal or private if not needed outside the assembly
- Remove unnecessary empty lines
Apply this diff to improve the implementation:
+ /// <summary> + /// Decrypts the provided password string. + /// </summary> + /// <param name="password">The password to decrypt. Can be encrypted or plain text.</param> + /// <param name="isPasswordValueExpression">True if the password is a value expression, false otherwise.</param> + /// <returns>The decrypted password string.</returns> + /// <exception cref="ArgumentNullException">Thrown when password is null.</exception> - public string DecryptPassword(string password, bool isPasswordValueExpression) + internal string DecryptPassword(string password, bool isPasswordValueExpression) { + if (password == null) + { + throw new ArgumentNullException(nameof(password)); + } string decryptedPassword = string.Empty; if (isPasswordValueExpression) { - - mVE.Value = password; string evaluatedValue = mVE.ValueCalculated; decryptedPassword = EncryptionHandler.IsStringEncrypted(evaluatedValue) ? EncryptionHandler.DecryptwithKey(evaluatedValue) : evaluatedValue; } else { decryptedPassword = EncryptionHandler.IsStringEncrypted(password) ? EncryptionHandler.DecryptwithKey(password) : password; } return decryptedPassword; }
🧹 Nitpick comments (1)
Ginger/GingerCoreNET/GeneralLib/EmailOperations.cs (1)
291-310
: Consider additional security measures for handling sensitive dataTo enhance security when handling sensitive information:
- Use SecureString for storing decrypted passwords in memory
- Implement proper logging that excludes sensitive data
- Consider adding rate limiting for failed decryption attempts
Would you like me to provide an example implementation using SecureString and proper logging practices?
/// <param name="isPasswordValueExpression">Indicates if the password is a value expression.</param> | ||
/// <param name="act">The Act instance containing the value expression.</param> | ||
/// <returns>The decrypted password.</returns> | ||
public static string DecryptPassword(string password, bool isPasswordValueExpression, Act act) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this method to GingerCoreNet proejct - > GeneralLib/General.cs class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
Ginger/GingerCoreNET/GeneralLib/General.cs (3)
714-714
: Use more descriptive naming for clarity.
originalExternalFields = [];
is concise, but consider making the initialization more descriptive, such asvar originalExternalFields = new ObservableList<ExternalItemFieldBase>();
for future maintainability.
761-762
: Check for possible null or whitespace values.When assigning
value = externalItemField.SelectedValue;
, ensureSelectedValue
is not null or empty. Using.Trim()
might also help remove accidental whitespace.
835-862
: Exercise caution with unencrypted transitions.The
DecryptPassword
method properly handles password evaluation and decryption. However, ensure you do not accidentally log or print the unencrypted password in higher-level logging or exceptions. Also confirm you have adequate testing for various encryption states.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
Ginger/GingerCoreCommon/Actions/Act.cs
(1 hunks)Ginger/GingerCoreNET/Drivers/WebServicesDriver/HttpWebClientUtils.cs
(3 hunks)Ginger/GingerCoreNET/Drivers/WebServicesDriver/SoapUIUtils.cs
(2 hunks)Ginger/GingerCoreNET/GeneralLib/General.cs
(6 hunks)
✅ Files skipped from review due to trivial changes (1)
- Ginger/GingerCoreCommon/Actions/Act.cs
🚧 Files skipped from review as they are similar to previous changes (1)
- Ginger/GingerCoreNET/Drivers/WebServicesDriver/HttpWebClientUtils.cs
🔇 Additional comments (3)
Ginger/GingerCoreNET/GeneralLib/General.cs (2)
154-154
: Ensure pattern correctness and test thoroughly.
You introduced a compiled regex here to capture variables named like {Var Name=XYZ}
, but note that the pattern assumes strict word characters (\w+
). If variable names expand to include special chars, or spaces, they won't match correctly. Please verify your test coverage for different naming styles to ensure the pattern is robust.
731-731
: Validate object creation logic.
You check if (item != null)
before adding the mapped external item to the collection. Consider logging or handling cases where item
could be null to avoid silent failures.
Ginger/GingerCoreNET/Drivers/WebServicesDriver/SoapUIUtils.cs (1)
24-24
: Remove unnecessary using if not needed.
using GingerCoreNET.GeneralLib;
is valid if you're using General.DecryptPassword
. Ensure there are no warnings about unused imports.
@@ -795,7 +796,7 @@ private static ExternalItemFieldBase MapExternalField(ExternalItemFieldBase exte | |||
} | |||
catch (Exception ex) | |||
{ | |||
Reporter.ToLog(eLogLevel.ERROR,"Failed to Map External Fields",ex.InnerException); | |||
Reporter.ToLog(eLogLevel.ERROR, "Failed to Map External Fields", ex.InnerException); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid potential null reference when logging.
ex.InnerException
might be null, resulting in a potential NullReferenceException. You may want to log ex.Message
or default to ex.ToString()
if InnerException
is unavailable.
- Reporter.ToLog(eLogLevel.ERROR, "Failed to Map External Fields", ex.InnerException);
+ Reporter.ToLog(eLogLevel.ERROR,
+ "Failed to Map External Fields",
+ ex.InnerException ?? ex);
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Reporter.ToLog(eLogLevel.ERROR, "Failed to Map External Fields", ex.InnerException); | |
Reporter.ToLog(eLogLevel.ERROR, | |
"Failed to Map External Fields", | |
ex.InnerException ?? ex); |
string password = mAct.GetInputParamCalculatedValue(ActSoapUI.Fields.Password); | ||
if (!string.IsNullOrEmpty(password)) | ||
{ | ||
var decryptedPassword = General.DecryptPassword(password, ValueExpression.IsThisAValueExpression(password), mAct); | ||
commandParam = commandParam + " -p" + Quotationmark + decryptedPassword + Quotationmark; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Prevent potential security exposure in command string.
The decrypted password is appended in plain text to the command line. This might be visible in logs or process viewers. If feasible, consider an alternative approach to avoid exposing credentials via command-line arguments.
Thank you for your contribution.
Before submitting this PR, please make sure:
Summary by CodeRabbit
New Features
PasswordTextBox
andCertificatePasswordUCValueExpression
.Bug Fixes
Documentation
Chores