47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
52 lines
1.4 KiB
Markdown
52 lines
1.4 KiB
Markdown
---
|
|
name: keepass_get
|
|
kind: function
|
|
lang: bash
|
|
domain: infra
|
|
version: "1.0.0"
|
|
purity: impure
|
|
signature: "keepass_get(entry: string, attr?: string) -> string"
|
|
description: "Lee un atributo (Password por defecto) de una entry del KeePassXC database via keepassxc-cli. Resuelve master password desde pass (meta/keepassxc-master) o env KEEPASS_PASSWORD."
|
|
tags: [keepass, keepassxc, secret, credential, get, pendiente-usar]
|
|
uses_functions: []
|
|
uses_types: []
|
|
returns: []
|
|
returns_optional: false
|
|
error_type: "error_go_core"
|
|
imports: []
|
|
params:
|
|
- name: entry
|
|
desc: "path de la entry dentro del .kdbx (ej. 'Servers/prod-mysql')"
|
|
- name: attr
|
|
desc: "atributo a leer (Password, UserName, URL, Notes, Title); default Password"
|
|
output: "valor del atributo en texto plano (sin newline final)"
|
|
tested: false
|
|
tests: []
|
|
test_file_path: ""
|
|
file_path: "bash/functions/infra/keepass_get.sh"
|
|
---
|
|
|
|
## Ejemplo
|
|
|
|
```bash
|
|
export KEEPASS_DB="/mnt/d/Tr4Shhh_FOLDER/Sync/PssDtbs/PassDataBase.kdbx"
|
|
source keepass_get.sh
|
|
|
|
pwd=$(keepass_get "Servers/prod-mysql")
|
|
user=$(keepass_get "Servers/prod-mysql" UserName)
|
|
```
|
|
|
|
## Setup
|
|
|
|
Master password se guarda una vez en pass:
|
|
|
|
```bash
|
|
pass insert meta/keepassxc-master
|
|
```
|
|
|
|
## Notas
|
|
|
|
- Wrappea `keepassxc-cli show -s -a <attr>`.
|
|
- Cada call reabre la BD (CLI stateless). Para batch, usa `keepass_dump`.
|
|
- `KEEPASS_PASSWORD` env tiene prioridad sobre `pass`.
|