Chunk #522
Aus: Sicherheit (Index: 10)
85
Tokens
Synced
Status
Taxonomie
| Kategorie | Sicherheit |
|---|---|
| Pfad | Sicherheit > MCP-DB Sicherheit > Migration |
| Heading-Pfad | Sicherheit > MCP-DB Sicherheit > Migration von direkten DB-Zugriffen > Migration Schritt-für-Schritt > 3. Python-Hooks auf Environment-Variablen umstellen |
Entities
| Name | Typ |
|---|---|
| DB_CONFIG | CONFIG |
| Python-Hooks | COMMAND |
| dotenv | SERVICE |
| os.environ.get | COMMAND |
Keywords
Inhalt
# Vorher (unsicher)
DB_CONFIG = {
'user': 'claude_code',
'password': 'klartext_passwort' # UNSICHER
}
# Nachher (sicher)
from dotenv import load_dotenv
load_dotenv(Path(__file__).parent / '.env')
DB_CONFIG = {
'user': os.environ.get('CLAUDE_DB_USER', 'claude_code'),
'password': os.environ.get('CLAUDE_DB_PASSWORD', '')
}Clean Content
```
`# Vorher (unsicher)
DB_CONFIG = {
'user': 'claude_code',
'password': 'klartext_passwort' # UNSICHER
}
# Nachher (sicher)
from dotenv import load_dotenv
load_dotenv(Path(__file__).parent / '.env')
DB_CONFIG = {
'user': os.environ.get('CLAUDE_DB_USER', 'claude_code'),
'password': os.environ.get('CLAUDE_DB_PASSWORD', '')
}`
```
Metadaten
| Analysiert am | 20.12.2025 12:42:32 |
|---|---|
| Analyse-Modell | gemma3:4b-it-qat |
| Embedding-Modell | mxbai-embed-large |
| Qdrant-ID | 17a4f451-b57d-4fdb-a06b-86e54d1888e5 |
| Erstellt | 20.12.2025 12:34:42 |
| Aktualisiert | 20.12.2025 12:53:38 |