You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.MD
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,12 @@
1
+
## February 2, 2026
2
+
3
+
-**Security** Implemented automatic sensitive data masking in API logs. [🎟️ DEP-161](https://citz-gdx.atlassian.net/browse/DEP-161)
4
+
- Added logging filter to automatically mask passwords, tokens, API keys, and database credentials
5
+
- Replaced print() statements with logger calls to ensure masking coverage
6
+
- Added linting rules (pylint + flake8) to prevent print statements and enforce logging
7
+
- Updated logging configuration to apply masking app-wide
8
+
- See `met_api.utils.logging_masker` for implementation details
9
+
1
10
## January 28, 2026
2
11
3
12
- Added documentation for enabling and logging into the Sysdig monitoring platform for OpenShift projects. [🎟️ DEP-160](https://citz-gdx.atlassian.net/browse/DEP-160)
This directory contains custom Pylint checkers for the MET API.
4
+
5
+
## no_print_checker
6
+
7
+
**Purpose:** Prevents use of `print()` statements which bypass sensitive data masking.
8
+
9
+
**Why:** Print statements output directly to stdout/stderr and bypass the logging system's `SensitiveDataFilter`. This creates a security risk where passwords, tokens, API keys, and other credentials could be exposed in logs.
10
+
11
+
**What it does:**
12
+
- Flags any use of `print()` function with error code **W9001**
13
+
- Exception: Allows print in `config.py` for startup messages before logging is initialized
14
+
15
+
**Usage:**
16
+
Instead of:
17
+
```python
18
+
print(f'User ID: {user_id}')
19
+
print(f'Database URL: {db_url}')
20
+
```
21
+
22
+
Use:
23
+
```python
24
+
from flask import current_app
25
+
current_app.logger.info('User ID: %s', user_id)
26
+
27
+
# or
28
+
import logging
29
+
logger = logging.getLogger(__name__)
30
+
logger.info('Database URL: %s', db_url)
31
+
```
32
+
33
+
**Configuration:**
34
+
The checker is automatically loaded via `.pylintrc`:
35
+
```ini
36
+
load-plugins=pylint_plugins.no_print_checker
37
+
```
38
+
39
+
**Testing:**
40
+
```bash
41
+
# Test with a file containing print statements
42
+
pylint --rcfile=.pylintrc path/to/file.py
43
+
44
+
# Should show:
45
+
# W9001: Print statement found - use logging to ensure sensitive data masking
46
+
```
47
+
48
+
## Adding New Checkers
49
+
50
+
1. Create a new file in this directory (e.g., `my_checker.py`)
51
+
2. Implement a class that inherits from `pylint.checkers.BaseChecker`
0 commit comments