Community Blog Essential Data Privacy Practices for Automakers: Protecting Sensitive Information in Logs with SLS Mask

Essential Data Privacy Practices for Automakers: Protecting Sensitive Information in Logs with SLS Mask

This article introduces Alibaba Cloud SLS mask to protect sensitive automotive data in logs while keeping them useful for troubleshooting.

Logs from connected vehicles, vehicle owner services, and intelligent cockpits may contain VINs, identity information, contact details, and addresses alongside operational status and business parameters. This information is scattered across requests, responses, and interaction text, and may also flow into queries, alerts, and analytics. Overseas operations and large language model applications further complicate identification.

1
In the figure: · 1 Article 6 of the Automotive Data Management Provisions · 2 GDPR Protection Principles.

Article 6 of the Provisions on the Management of Automotive Data Security (Trial) encourages data masking, with anonymization and de-identification wherever possible. Automotive services for users in the European Union must also take into account the GDPR principles of data minimization and data protection by design and by default.

Themaskfunction in Alibaba Cloud Simple Log Service (SLS) can replace matching sensitive values during collection or ingestion while preserving business status and call chains. Combined with access control and retention period management, it helps reduce exposure. The following sections use four sets of logs from three types of business—vehicle and vehicle owner services, overseas connectivity subscriptions, and intelligent cockpit interactions—to explain rule selection and masking results.

Choosing Where to Apply Masking and How to Identify Sensitive Data

These logs may be collected through LoongCollector or written directly to SLS through SDKs or OpenAPI. On the collector side, mask can apply buildin and keyword rules before transmission to replace matching sensitive content. On the server side, the ingestion processor applies masking after logs reach SLS but before they are written to a Logstore. Enterprises can choose the processing location based on their ingestion method and processing requirements, or configure both in combination.

After deciding where to process the logs, choose the identification method based on the content: for VINs, mobile phone numbers, IMSIs, and similar values, use the built-in rules in buildin; for names, addresses, user identifiers, and custom credentials associated with fixed keys, use keyword. Both modes are supported on the collector and server sides. For names and addresses in Chinese natural-language text, use semantic mode, which enables a model on the server side to identify them.

The configurations below are shown in SPL for the ingestion processor. Multiple rules can be combined in a single mask call. Coverage is determined by the ingestion configuration, business conditions, and specified fields. The processed logs remain available for queries, alerts, and analytics.

2

Protecting Vehicle Identifiers and Vehicle Owners’ Personal Information

Vehicle event processing, identity verification, and after-sales fulfillment rely on different troubleshooting evidence and therefore retain different fields: vehicle logs retain signals and rule results, identity APIs retain verification status, and work order records retain entitlements and service progress. Sensitive values are replaced according to built-in types or fixed keys. The following three cases illustrate these configurations.

Case 1: Connected-Vehicle Event Processing Logs

Vehicle signals flow through a message queue into rule evaluation and cloud diagnostics services. Event logs record the VIN, software version, signal values, and rule results. The same VIN may appear in both the event header and a nested payload, so the rules must cover every match in the body.

In the coolant temperature evaluation log below, both VIN occurrences are replaced with placeholders, the first two characters of the license plate number are retained, and the API token is replaced based on its business key. The configuration identifies sensitive values throughout the entire content field.

Original Log

{
  "time": "2026-10-13T09:18:42.036+08:00",
  "level": "INFO",
  "service": "vehicle-event-processor",
  "trace_id": "demo-event-a201",
  "event": "vehicle_signal_evaluated",
  "vin": "LZZAB12C7T1006842",
  "plate_no": "Guangdong License Plate B24680",
  "payload": {
    "vin": "LZZAB12C7T1006842",
    "signal": "coolant_temperature",
    "value": 94,
    "rule_id": "coolant_temp_guard",
    "rule_version": "r12",
    "decision": "NORMAL"
  },
  "software_version": "5.4.0",
  "mq": {
    "topic": "vehicle.signal.events",
    "partition": 3,
    "offset": 873204
  },
  "latency_ms": 21,
  "token": "demo_vehicle_token_82"
}

SPL Configuration

* | extend content = mask(content, '[
  {"mode":"buildin","types":["VIN"],"maskType":"placeholder"},
  {"mode":"buildin","types":["LICENSE_PLATE"],"keepPrefix":2},
  {"mode":"keyword","keys":["token"],"maskType":"placeholder"}
]')

Masked Log

3

After processing, both the outer vin and payload.vin become [VIN_MASKED], and the license plate number becomes Guangdong License Plate B*****. The signal value 94, the decision NORMAL, the rule version r12, and the software version 5.4.0 remain unchanged, so the event content and versions can still be checked. mq.offsetretains the consumer offset, and latency_ms retains the processing time.

Built-in VIN identification includes format and validation requirements. Vehicle identifiers with nonstandard formats can be handled with additional rules based on known keys. When events need to be traced across logs, use an event ID or Trace ID that has been evaluated for this purpose. Placeholders and partially masked vehicle identifiers cannot serve as unique correlation keys.

Case 2: Vehicle Owner Real-Name Verification and Vehicle Binding

In the user center, logs also record requests for vehicle owner real-name verification and vehicle binding. Identity information may appear in request parameters, while user identifiers may appear in both requests and database query contexts. When inspecting these APIs, personal information must be hidden while verification results and binding status are retained.

owner_name and user_id are replaced with keyword placeholders. Mainland China mobile phone numbers retain the first three and last four digits, while ID card numbers are replaced in full. User identifiers are recorded as strings, so the JSON body remains parseable after replacement.

Original Log

2026-10-13 09:24:16.218 INFO [owner-identity-service] trace_id=demo-owner-b018 uri=/api/owners/bind method=POST cost_ms=38 status=200
{
  "request": {
    "owner_name": "Chen Ning",
    "phone": "13900004567",
    "id_card": "320104199408190028",
    "user_id": "owner-demo-018"
  },
  "response": {
    "verification": "PASS",
    "binding_status": "SUCCESS",
    "code": "OK"
  },
  "query": {
    "mapper": "OwnerBindingRepository.findByUser",
    "user_id": "owner-demo-018"
  }
}

SPL Configuration

* | extend content = mask(content, '[
  {"mode":"buildin","types":["PHONE"],"keepPrefix":3,"keepSuffix":4},
  {"mode":"buildin","types":["IDCARD"],"maskType":"placeholder"},
  {"mode":"keyword","keys":["owner_name","user_id"],"maskType":"placeholder"}
]')

Masked Log

4

Both occurrences of user_id in the request and query are replaced, and the name and full ID card number no longer appear in the body. verification=PASS, binding_status=SUCCESS, and code=OK are retained, confirming that the request passed verification and completed binding. The API path, Trace ID, and 38-millisecond duration in the log header also remain unchanged, making it easier to locate call records by request.

keyword configurations must include the actual key names. Naming variants such as owner_name and userName must each be checked. Retaining some digits of the mobile phone number is a choice made in this example; services that do not require manual number verification can use placeholders instead. The processing scope should also be checked for duplicate information in requests, responses, and query contexts.

Identifying Overseas Mobile Phone Numbers and Communication Subscription Identifiers by Region

The preceding mobile phone number configuration is intended for domestic operations. When enterprises provide overseas connectivity services, logs still need to retain subscription status and plan information, but mobile phone numbers and communication subscription identifiers must be matched according to their actual country or network affiliation. Simply reusing domestic rules may miss overseas data.

Case 3: Querying European Connectivity Subscription Status

A vehicle’s T-Box or communication module accesses the mobile network through a SIM or eSIM. When a connectivity management platform queries subscription status and data allowances, the carrier API may return an IMSI, or International Mobile Subscriber Identity. An IMSI identifies a communication subscription and can link service records for the same subscription, so it should also be included in the masking scope.

This example is a business summary log from a connectivity management platform: phone and email are the contact details for the subscription account, while imsi, SIM status, and data allowances come from communication subscription information.

The following two subscription records, from Germany and the United Kingdom, use regions=["DE","GB"] to identify mobile phone numbers and IMSIs. For email addresses, the local part before @ is hidden, and the carrier API token is handled using a keyword rule.

Original Log

2026-10-13 09:41:22.075 INFO [connectivity-subscription-service] trace_id=demo-connect-d005 uri=/api/subscriptions/status method=GET cost_ms=34 status=200
{
  "code": "OK",
  "subscriptions": [
    {
      "market": "DE",
      "phone": "+4915700002468",
      "imsi": "262010000345678",
      "email": "driver.de@example.com",
      "sim_status": "ACTIVE",
      "connection_status": "CONNECTED",
      "quota_mb": 4096
    },
    {
      "market": "GB",
      "phone": "+447700900123",
      "imsi": "234100000456789",
      "email": "driver.gb@example.com",
      "sim_status": "ACTIVE",
      "connection_status": "CONNECTED",
      "quota_mb": 2048
    }
  ],
  "token": "demo_subscription_token_05"
}

SPL Configuration

* | extend content = mask(content, '[
  {"mode":"buildin","types":["PHONE","IMSI"],"regions":["DE","GB"],"maskType":"placeholder"},
  {"mode":"buildin","types":["EMAIL"],"maskType":"anchor","maskBeforeChar":"@"},
  {"mode":"keyword","keys":["token"],"maskType":"placeholder"}
]')

Masked Log

5

Currently, buildin supports mobile phone numbers and IMSIs from Germany (DE) and the United Kingdom (GB). In this example, mobile phone numbers are output as [PHONE_MASKED] and IMSIs as [IMSI_MASKED]. Email addresses use anchor to retain the domain name, and the token is output as a keyword placeholder. After the numbers and subscription identifiers are hidden, the market, connection status, and data allowances remain unchanged.

In both records, sim_status=ACTIVE and connection_status=CONNECTED are retained, with data allowances of 4096 MB and 2048 MB, respectively, so subscription status and plan information can still be viewed. regions selects identification rules. The market where a vehicle is sold is not necessarily the country or home network associated with its number or IMSI; the actual numbers used in cross-border connectivity solutions must be checked in particular. Support for German and UK mobile phone numbers and IMSIs does not mean that all European countries, identity document types, or license plate types are covered.

Identifying Chinese Names and Addresses in Cockpit Interaction Text

The preceding cases locate sensitive values using format rules or business keys. In cockpit interaction logs, names and destinations are embedded in natural-language sentences, and the same information may appear in different forms. Processing this type of Chinese text requires context to determine entity boundaries, followed by masking in combination with built-in rules for mobile phone numbers, credentials, and other data.

Case 4: Cockpit Voice Commands and Large Language Model Calls

The cockpit passes speech transcripts to intent recognition services or a large language model, then invokes tools such as contacts and navigation. The same name and destination may appear repeatedly in the transcript, tool responses, and model replies. Log masking must cover all of these locations.

In the following combined calling and navigation command, the semantic mode of mask identifies Chinese names and addresses, buildin handles mobile phone numbers and API keys that match supported patterns, and keyword handles custom credential keys. The model name, intent, tool status, and durations are retained.

Original Log

{
  "time": "2026-10-13T09:48:30.906+08:00",
  "service": "cockpit-assistant-gateway",
  "session_id": "session-demo-047",
  "trace_id": "demo-cockpit-e047",
  "model": "cockpit-text-model",
  "intent": "NAVIGATE_AND_CALL",
  "asr_text": "Please call Lin Chen at 13600007890, and then navigate to No. 28 Shili Road, Xihu District, Hangzhou.",
  "tool_calls": [
    {
      "name": "contacts.lookup",
      "result_text": "Contact: Lin Chen, Phone Number 13600007890。",
      "status": "SUCCESS"
    },
    {
      "name": "navigation.search",
      "result_text": "Destination: No. 28 Shili Road, Xihu District, Hangzhou.",
      "status": "SUCCESS"
    }
  ],
  "assistant_text": "Lin Chen has been found. Navigating to No. 28 Shili Road, Xihu District, Hangzhou.",
  "llm_api_key": "sk-DemoCockpitKeyAbcdef0123456789",
  "input_tokens": 96,
  "output_tokens": 27,
  "cost_ms": 463
}

SPL Configuration

* | extend content = mask(content, '[
  {"mode":"semantic","types":["NAME","ADDRESS"],"maskType":"placeholder"},
  {"mode":"buildin","types":["PHONE","API_KEY"],"maskType":"placeholder"},
  {"mode":"keyword","keys":["token","api_key"],"maskType":"placeholder"}
]')

Illustration of Masking Results

6

The masked log shows that names and addresses in asr_text, bothresult_text fields, and assistant_text are replaced at their entity positions, while mobile phone numbers and the API key are also hidden. The model name, intent NAVIGATE_AND_CALL, the SUCCESS status of both tools, input and output token counts, and the total duration of 463 milliseconds are retained. Developers can check the intent and tool results and compile overall response-time statistics. Analyzing the duration of each stage requires the corresponding timing fields to be recorded.

Using Type Markers and Masking Preview Parameters to Balance Privacy Protection and Troubleshooting

In natural-language and mixed-text logs, it may still be necessary to distinguish information types such as mobile phone numbers and credentials after masking, and to retain essential clues for verification. prependPlaceholder:true adds a type marker around the result of character masking or anchor-based masking, typically producing [TYPE_MASKED]{masked preview}, making it easier to identify the categories of processed information during queries and audits.

Taking Case 4 as an example, names and addresses continue to be replaced in full with placeholders, while mobile phone numbers and API keys retain the first three and last four characters and receive a type marker. The configuration is as follows:

* | extend content = mask(content, '[
  {"mode":"semantic","types":["NAME","ADDRESS"],"maskType":"placeholder"},
  {"mode":"buildin","types":["PHONE","API_KEY"],"keepPrefix":3,"keepSuffix":4,"prependPlaceholder":true},
  {"mode":"keyword","keys":["token","api_key"],"keepPrefix":3,"keepSuffix":4,"prependPlaceholder":true}
]')

Masking Results

7

Use [PHONE_MASKED] to identify a masked mobile phone number, use the retained prefix and suffix to help verify the call recipient, and then use trace_id to correlate the call chain and inspect tool call status and durations. The middle portion of the mobile phone number is hidden, while the business context remains usable. Choose how many characters to retain based on troubleshooting needs.

This parameter also applies to types such as names and addresses. For example, when a semantic rule identifies the Chinese name Lin Chen, setting keepPrefix: 1 and prependPlaceholder: true can produce [NAME_MASKED]{林*}.

Key mask Configuration Points and Regional Support

The function call takes the form mask(field, params): field is the string field to be processed, and params is a string containing a JSON array of rules. The following lists the main parameters used in the five cases.

Main Parameters

Parameter Purpose
mode Required.
+ buildin uses built-in identification rules
+ keyword matches by key name
+ semantic identifies Chinese names and addresses (currently supported only in certain regions)
types, keys buildin and semantic use types to specify types; keyword uses keys to specify business key names. The semantic types are NAME and ADDRESS.
regions Selects built-in regional rules. Applies only to PHONE, IDCARD, and IMSI. Coverage is shown in the table below. If this field is omitted, the default is CN.
maskChar The replacement character; defaults to *. Used for default character masking and anchor-based masking.
keepPrefix, keepSuffix The numbers of leading and trailing characters to retain in default character masking. Both default to 0. For example, a mobile phone number can retain the first three and last four digits.
maskType + Uses character masking when omitted
+ placeholder replaces values with placeholders
+ anchor masks values based on an anchor
maskBeforeChar Used with anchor. In Case 4, this is set to @ to replace the email username while retaining @ and the domain name.
prependPlaceholder An optional Boolean value; defaults to false. When set to true, adds a type label around the result of character or anchor-based masking. For example, retaining the first three and last four digits of a mobile phone number produces: 13600007890 → [PHONE_MASKED]{136****7890}; when not enabled, the result is 136****7890.

The numbers of prefix and suffix characters to retain apply only to default character masking; anchor uses anchor parameters, and placeholder uses placeholders.

Built-in Types and Regional Coverage

types Information Identified regions Support
PHONE Mobile phone numbers Supported; see the regional support matrix below
IDCARD ID card numbers or personal identification numbers Supported; see the regional support matrix below
IMSI Mobile communication subscription identifiers Supported; see the regional support matrix below
VIN 17-character vehicle identification numbers Does not support switching regions; uses built-in format and validation rules for identification
LICENSE_PLATE Mainland China license plate numbers Does not support switching regions; Mainland China rules only
LANDLINE_PHONE Mainland China landline phone numbers Does not support switching regions; Mainland China rules only
EMAIL Email addresses Rules are not selected by region
CREDIT_CARD Bank card numbers Rules are not selected by region; values must satisfy built-in format and validation rules
IP_ADDRESS IPv4 addresses Rules are not selected by region
ACCESSKEY Alibaba Cloud AccessKey IDs with the LTAI prefix Rules are not selected by region
API_KEY API keys in sk- or GitHub Token formats that match built-in rules Rules are not selected by region

Only PHONE, IDCARD, and IMSI support switching regions. “—” indicates that no corresponding built-in rule is currently available.

regions Code Country or Region PHONE IDCARD IMSI
CN Mainland China Supported Supported Supported
HK Hong Kong, China Supported Supported Supported
DE Germany Supported — Supported
GB United Kingdom Supported — Supported
AE United Arab Emirates Supported — Supported
SA Saudi Arabia Supported — Supported
SG Singapore Supported — Supported
KZ Kazakhstan Supported Supported —
UZ Uzbekistan Supported Supported —
RU Russia Supported — —

For more ways to use data masking, see Plaintext Stays Put, Logs Stay Useful: Sensitive Data Protection with Alibaba Cloud Observability.

0 0 0
Share on

Alibaba Cloud Native Community

849 posts | 61 followers

Comments