Skip to content

Commit e635c25

Browse files
authored
Update additional-settings.rst (#1763)
1 parent d556329 commit e635c25

1 file changed

Lines changed: 34 additions & 38 deletions

File tree

docs/setup-robusta/additional-settings.rst

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -144,65 +144,61 @@ To **enable** interactivity, set the following in your `generated_values.yaml` f
144144
Censoring Logs
145145
----------------
146146

147-
Pod logs gathered by Robusta can be censored using regexes. For example, a payment processing pod might have credit card numbers in its log. These can be sanitized in-cluster.
147+
Pod logs gathered by Robusta can be censored using `Python regular expressions <https://www.w3schools.com/python/python_regex.asp>`_. For example, a payment processing pod might have credit card numbers or other sensitive information in its logs. These can be automatically sanitized before they appear in notifications.
148148

149-
This feature applies to the following Robusta actions:
149+
**How to Enable Log Censoring for All Logs**
150150

151-
- :code:`logs_enricher`
152-
- :code:`report_crash_loop`
151+
To censor sensitive information in all logs, add the following to your Helm values file:
153152

154-
To censor logs, define a `python regex <https://www.w3schools.com/python/python_regex.asp>`_ for expressions you wish to filter.
153+
.. code-block:: yaml
155154
156-
For example:
155+
globalConfig:
156+
regex_replacement_style: SAME_LENGTH_ASTERISKS # Alternative: NAMED
157+
regex_replacer_patterns:
158+
- name: CreditCard
159+
regex: "[0-9]{4}[- ][0-9]{4}[- ][0-9]{4}[- ][0-9]{4}"
160+
- name: Email
161+
regex: "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}"
162+
- name: UUID
163+
regex: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
157164
158-
.. code-block:: yaml
165+
After adding these values, perform a Helm upgrade:
166+
167+
.. code-block:: bash
159168
160-
- logs_enricher:
161-
regex_replacement_style: SAME_LENGTH_ASTERISKS # You can also use NAMED
162-
regex_replacer_patterns:
163-
- name: MySecretPort
164-
regex: "my secret port \\d+"
165-
- name: UUID
166-
regex: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
169+
helm upgrade robusta robusta/robusta -f values.yaml
167170
168-
Given the following input:
171+
**Example: Before and After Censoring**
172+
173+
Given the following pod log:
169174

170175
.. code-block::
171176
172-
# Input (actual pod log):
177+
# Original pod log:
173178
2022-07-28 08:24:45.283 INFO user's uuid: '193836d9-9cce-4df9-a454-c2edcf2e80e5'
174-
2022-07-28 08:35:00.762 INFO Successfully loaded some critical module
175-
2022-07-28 08:35:01.090 INFO using my secret port 114, ip: ['172.18.0.3']
179+
2022-07-28 08:35:00.762 INFO Customer email: user@example.com
180+
2022-07-28 08:35:01.090 INFO Payment processed with card: 4111-1111-1111-1111
176181
177-
The censored output will be:
182+
The censored output will appear as:
178183

179184
.. code-block::
180185
181-
# Output for SAME_LENGTH_ASTERISKS (How it will appear in Slack, for example):
182-
186+
# Using SAME_LENGTH_ASTERISKS style:
183187
2022-07-28 08:24:45.283 INFO user's uuid: '************************************'
184-
2022-07-28 08:35:00.762 INFO Successfully loaded some critical module
185-
2022-07-28 08:35:01.090 INFO using ******************, ip: ['172.18.0.3']
186-
187-
# Output for NAMED (How it will appear in Slack, for example):
188+
2022-07-28 08:35:00.762 INFO Customer email: ****************
189+
2022-07-28 08:35:01.090 INFO Payment processed with card: *******************
188190
191+
# Using NAMED style:
189192
2022-07-28 08:24:45.283 INFO user's uuid: '[UUID]'
190-
2022-07-28 08:35:00.762 INFO Successfully loaded some critical module
191-
2022-07-28 08:35:01.090 INFO using [MySecretPort], ip: ['172.18.0.3']
192-
193-
It is best to define this in a :ref:`Global Config`, so it will be applied everywhere.
193+
2022-07-28 08:35:00.762 INFO Customer email: [Email]
194+
2022-07-28 08:35:01.090 INFO Payment processed with card: [CreditCard]
194195
195-
.. code-block:: yaml
196+
**Note:** This censoring applies to logs displayed in Robusta's built-in notifications, including those shown by the following Robusta actions:
196197

197-
globalConfig: # Note: no need to specify logs_enricher or report_crash_loop by name here.
198-
regex_replacement_style: SAME_LENGTH_ASTERISKS
199-
regex_replacer_patterns:
200-
- name: MySecretPort
201-
regex: "my secret port \\d+"
202-
- name: UUID
203-
regex: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
198+
- :code:`logs_enricher` - Shows container logs in various alerts
199+
- :code:`report_crash_loop` - Shows container logs for crashing pods
204200

205-
Place these values inside Robusta's Helm values and perform a :ref:`Helm Upgrade <Simple Upgrade>`.
201+
For specific actions, you can also override these settings in your playbook definitions if needed.
206202

207203

208204
Memory allocation on big clusters

0 commit comments

Comments
 (0)