Sensitive Attributes
Overview
Sensitive attributes let you mask a log attribute for most users while keeping the real value available to the people who need it. When a log is processed, groundcover replaces the value with a placeholder (***** by default). The original value goes to a separate, access-controlled column. Users whose RBAC policy grants sensitive data access can reveal the real value. Everyone else sees only the masked one.
This differs from Obfuscate Logs. Obfuscation removes the original value for good. A sensitive attribute keeps the original value in storage and controls who can read it.
Best for: Values that most users must not see but that some teams still need, such as customer IDs, account numbers, or email addresses needed during an investigation.
How It Works
Setting up sensitive attributes takes four steps:
Enable the feature on the backend.
Grant access in a policy. Turn on Allow access to sensitive data in the RBAC policies of the users who should see real values.
Mark attributes as sensitive. Add an OTTL rule that calls
sensitive()on each attribute you want to protect.Query and reveal. Users see the masked value by default. Users with access can reveal it in the log drawer or query it with
sensitive.<key>.
Let's go over each of these steps:
1. Enable the Feature on Your Backend
Reach out to the groundcover team in order to enable the feature on your backend first.
2. Grant Access in RBAC Policies
No policy grants sensitive access by default. This includes the default Admin, Editor, and Viewer policies. You must turn it on explicitly in each policy that needs it.
From the UI
Go to Settings → Policies and create or edit a custom policy.
Set the Data Scope to Simple or Advanced.
Turn on Allow access to sensitive data.
The toggle appears only after the backend reports the sensitive-data feature (see step 1). It is hidden when the data scope is set to No data.
Through the API
Set sensitiveAccess to true when you create or update a policy:
How the data scope limits reveal
Sensitive access follows the policy's logs data scope. A user can reveal values only on log rows that match the scope of a policy granting sensitive access:
A policy with full data scope and sensitive access lets the user reveal values on every log.
A policy scoped to
namespace = paymentswith sensitive access lets the user reveal values only on logs from thepaymentsnamespace. On other logs, the user still sees the masked value.
Multiple policies
When a user has more than one policy:
Only policies with Allow access to sensitive data turned on count toward sensitive access. A policy without the toggle never widens it, even if that policy has a broader data scope.
The scopes of all granting policies merge with OR logic, just like regular data scope merging.
Example: A user has Policy A (Viewer, all clusters, no sensitive access) and Policy B (Viewer, cluster = prod-eu, sensitive access). They can see logs from every cluster, but can reveal sensitive values only on prod-eu logs.
3. Mark Attributes as Sensitive with OTTL
Use the sensitive function in a logs pipeline rule to mark an attribute as sensitive.
Usage
Arguments:
target
Yes
A single attribute, attributes["<key>"].
replacement
No
The masked value shown in place of the original. Defaults to *****
What it does to each matching log:
The attribute keeps its key, but its value is replaced with
replacement. This is the value most users see.The original value is saved under the same key in an access-controlled column.
If the attribute is missing or empty, nothing happens.
Basic Configuration
Mark a single attribute as sensitive:
💡 Example: customer_id: "cus_9f3a1b" is stored as customer_id: "*****". Users with sensitive access can reveal cus_9f3a1b.
Multiple Attributes and a Custom Replacement
A rule can mark several attributes. Each statement handles one attribute:
Parse First, Then Mark as Sensitive
sensitive works only on attributes, so values inside the log body must be extracted first. sensitive sees changes made by earlier rules in the same pipeline, so you can parse in one rule and mark the result in a later one:
Run the simulation to test your rule against a real log before saving it. You can start from the Mark as sensitive template.
4. Query and Use Sensitive Attributes
What users see by default
Logs queries return the masked value for a sensitive attribute, whatever the user's permissions. Searching, grouping, and showing customer_id all use the masked value, e.g. ***** by default. A user must ask for the real value explicitly.
Revealing a value in the log drawer
Open a log and go to its Attributes tab:
Users with sensitive access for that log see an eye icon next to each sensitive attribute. Clicking it fetches the real value for that one log only. Clicking again masks it.
Users without access see the masked value with a lock icon. Hovering over the icon explains that they don't have permission to view the value.
Revealed values aren't kept on the page. Closing the drawer masks them again.
Querying real values with sensitive.<key>
Add the sensitive. prefix to an attribute key to read its real value in a logs query:
Filter
sensitive.customer_id:"cus_9f3a1b"
Select a field
workload:payment-service | fields sensitive.customer_id
Rename a field
| fields sensitive.customer_id as customer
How sensitive.<key> resolves depends on the row and the user:
The user has sensitive access and the log row is within their sensitive scope: the real value.
The user has no sensitive access, or the row is outside their scope: the masked value, the same as querying
<key>directly. No error is returned.The row has no sensitive value for that key: the regular attribute value.
The logs search bar shows a Sensitive Data Access hint (sensitive.key:value) when the selected backend supports the feature.
Where real values are never shown
Grafana. The built-in Grafana datasource uses a default user, which never has the relevant permissions. It always returns masked values.
SELECT *over the logs tables. The column holding the sensitive attributes is excluded, so queries that useSELECT *never include it.
Troubleshooting
The Allow access to sensitive data toggle doesn't appear
The backend doesn't report sensitive-data yet. Check that sensitiveRole.enabled is true, the ClickHouse rolling restart has finished, and db-manager has finished setup on every shard
sensitive.<key> returns the masked value
The user has no policy with sensitive access, or the log is outside the scope of their granting policies
The attribute is still shown in plain text
The sensitive rule didn't match. Check the rule's conditions and that the attribute exists when the rule runs. Run the simulation on a sample log to test
The value is masked in attributes but visible in the log body
sensitive masks attributes only. Add obfuscate_pii or replace_pattern on body
The rule fails to save with sensitive target must be attributes["<key>"]
The target is body, a whole map, or a column. Target a single attribute key
Last updated
