Skip to main content

Network Data Masking

TestMu AI provides network data masking capability to protect sensitive information during automation testing sessions. This feature automatically masks sensitive data in network logs on the TestMu AI platform, ensuring that confidential information like passwords, tokens, and authentication keys are not exposed in test logs and network traffic reports.

By the end of this document, you will be able to:

  • Enable automatic masking of sensitive data in network logs
  • Protect confidential information

What Is Network Data Masking?


Network data masking automatically identifies and masks sensitive information in HTTP network logs on the TestMu AI platform during test execution.

When enabled, the system scans for predefined sensitive keywords in network requests and responses, replacing their values with masked placeholders to prevent data exposure.

Sensitive Keywords Detected


The system automatically masks values for keys containing the following keywords.

KeywordDescription
keyAPI keys, encryption keys
passwordUser passwords, system passwords
tokenAuthentication tokens, access tokens
authAuthorization headers, auth credentials
emailEmail addresses in headers/cookies
cipherCipher keys, encrypted data
secretSecret keys, client secrets
nonceCryptographic nonces
saltPassword salts, hash salts

Configuration


Set the network.mask capability to true to enable network data masking.

Java Implementation

// Java code for configuring Network Masking in tests on LambdaTest
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("network.mask", "true");
// Add other capabilities as needed

Alternative Language Examples

Python:

capabilities = {
"network.mask": "true"
# Add other capabilities as needed
}

Node.js:

const capabilities = {
"network.mask": "true"
// Add other capabilities as needed
};

Supported Values


The capability accepts the following values.

ValueDescription
trueEnables network data masking for sensitive information
false (default)Disables network data masking (default behavior)

Masking Coverage


Network data masking covers the following areas of HTTP traffic.

Request Headers

  • Authorization headers containing tokens or keys
  • Custom headers with sensitive authentication data
  • API key headers

Response Headers

  • Set-Cookie headers with sensitive session data
  • Authentication response headers
  • Custom security headers

Request/Response Cookies

  • Session cookies containing tokens
  • Authentication cookies
  • Security cookies with sensitive identifiers

Example Scenarios


The following examples show how network logs appear before and after masking.

Before Masking (network.mask: false)

Request Headers:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
X-API-Key: sk_live_abcd1234567890
User-Email: [email protected]

Response Cookies:
auth_token=abc123xyz789; session_key=def456uvw012

After Masking (network.mask: true)

Request Headers:
Authorization: Bearer ********
X-API-Key: ********
User-Email: ********

Response Cookies:
auth_token=********; session_key=********

Use Cases


Network data masking supports several testing and security scenarios.

  • Security Compliance: Ensure sensitive data does not appear in test logs for compliance with security standards and regulations.
  • Team Collaboration: Share test results and network logs safely without exposing production credentials or sensitive user data.
  • CI/CD Pipeline Security: Protect sensitive information in automated test reports that may be stored or shared across development teams.
  • Third-party Integration Testing: Mask API keys and authentication tokens when testing integrations with external services.
  • Debug and Troubleshooting: Review network traffic for debugging while keeping sensitive authentication data protected.

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles