Back

Secrets management

Latest — Oct 7, 2025
Passwork: Secrets Management und Automatisierung für DevOps

Einführung

In Unternehmensumgebungen steigt die Anzahl der Passwörter, Schlüssel und digitalen Zertifikate rasant an, und Secrets Management wird zu einer der kritischen Aufgaben für IT-Teams.

Secrets Management umfasst den gesamten Lebenszyklus sensibler Daten: von der sicheren Generierung und verschlüsselten Speicherung bis hin zur automatisierten Rotation und Audit-Trails. Mit der Einführung von Cloud-Infrastruktur, Microservices und DevOps-Praktiken in Organisationen verschärft sich die Herausforderung — Anwendungen benötigen nahtlosen Zugriff auf Anmeldedaten unter Einhaltung von Zero-Trust-Sicherheitsprinzipien.

IT-Abteilungen und DevOps-Teams stehen vor Situationen, in denen es zu viele Secrets gibt, die schwer zu strukturieren, zu kontrollieren und zu schützen sind. In realen Projekten verteilen sich diese Secrets über Konfigurationsdateien, Umgebungsvariablen, Deployment-Skripte und tauchen gelegentlich in öffentlichen Repositories auf.

Was ist Secrets Management

Secrets Management ist eine Best Practice der Cybersicherheit und eine Reihe von Tools zur sicheren Speicherung, Verwaltung, zum Zugriff und zur Rotation von digitalen Authentifizierungsdaten, die von nicht-menschlichen Identitäten wie Anwendungen, Diensten, Servern und automatisierten Workloads verwendet werden.

Solche Secrets umfassen Passwörter, Passphrasen, SSH-, API- und Verschlüsselungsschlüssel, Zugangstokens, digitale Zertifikate und alle anderen Anmeldedaten, die sicheren Zugriff auf die Infrastruktur ermöglichen.

Warum Secrets Management wichtig ist

Der Schutz vertraulicher Informationen ist eine zentrale Priorität für jedes Unternehmen. Secrets erfordern strenge Kontrolle in jeder Phase ihres Lebenszyklus. Hier sind einige Vorteile eines ordnungsgemäßen Secrets Managements:

  • Zentralisierte Speicherung. Alle Passwörter, Schlüssel und Tokens werden in einem einzigen geschützten Repository gespeichert, wodurch verhindert wird, dass sie in offenen Dokumenten, Skripten oder Quellcode landen. Dies reduziert das Risiko von Lecks und unbefugtem Zugriff.
  • Flexible Zugriffsverwaltung. Das System ermöglicht die individuelle Festlegung, wer auf welche Secrets zugreifen kann — ob einzelne Mitarbeiter, Gruppen oder Dienstkonten. Dies hilft bei der Umsetzung des Prinzips der minimalen Berechtigung und reduziert potenzielle Angriffsvektoren.
  • Vollständige Kontrolle und operative Transparenz. Jede Anfrage wird protokolliert: Sie können nachverfolgen, wer wann welche Aktionen durchgeführt hat. Auditing erleichtert die Einhaltung von Vorschriften und macht Sicherheitsprozesse maximal transparent.
  • Automatisierte Rotation. Passwörter und Schlüssel werden regelmäßig automatisch aktualisiert — nach Zeitplan oder bei erkannten Bedrohungen. Dies spart IT-Ressourcen und verringert die Wahrscheinlichkeit, veraltete oder kompromittierte Daten zu verwenden.
  • Integration mit Infrastruktur und DevOps. Der Zugriff auf Secrets erfolgt über API, CLI, SDK und Plugins, was die Systemintegration mit CI/CD-Pipelines, Cloud-Plattformen, Containern und Datenbanken vereinfacht.
  • Schnelle Reaktion auf Vorfälle. Ein zentralisierter Ansatz ermöglicht das schnelle Widerrufen oder Ersetzen gefährdeter Secrets, minimiert die Folgen von Vorfällen und verhindert die Ausbreitung von Bedrohungen innerhalb des Unternehmens.

Ohne eine einheitliche Lösung „wandern" Secrets oft durch Konfigurationsdateien und Quellcode, was deren Aktualisierung erschwert und Kompromittierungsrisiken erhöht. Unternehmenspasswort-Manager lösen diese Aufgabe, aber nicht alle unterstützen die für moderne DevOps-Prozesse erforderliche Automatisierung.

Passwork: Mehr als ein Passwort-Manager

Passwork begann als Unternehmenspasswort-Manager — ein einfaches und praktisches Tool zur Speicherung von Anmeldedaten. Aber moderne IT-Teams benötigen mehr: Automatisierung, Integration und programmatischen Zugriff auf Secrets.

Mit Passwork 7 hat sich die Plattform über die traditionelle Passwortspeicherung hinaus zu einem vollwertigen Secrets-Management-System entwickelt.

API-first-Architektur

Passwork basiert auf API-first-Prinzipien. Das bedeutet, dass jede in der Benutzeroberfläche verfügbare Funktion auch über REST API verfügbar ist.

Die API bietet programmatischen Zugriff auf alle Systemfunktionen: Passwortverwaltung, Tresore, Ordner, Benutzer, Rollen, Tags, Dateianhänge und Ereignisprotokolle. Dies ermöglicht die Automatisierung von Zugriffsbereitstellung und -entzug, die programmatische Aktualisierung von Passwörtern, die Integration von Passwork in CI/CD-Pipelines und den Export von Protokollen zur Analyse.

Zwei Produkte in einem

Mit anderen Worten kombiniert Passwork jetzt zwei vollwertige Produkte:

  • Passwort-Manager — intuitive Oberfläche für sichere Speicherung von Anmeldedaten und Teamzusammenarbeit.
  • Secrets-Management-System — programmatischer Zugriff über REST API, Python-Connector, CLI und Docker-Container zur Workflow-Automatisierung.

Automatisierungstools

Python-Connector

Der offizielle Python-Connector von Passwork beseitigt die Komplexität der Arbeit mit Low-Level-API-Aufrufen und Kryptographie. Verwalten Sie Secrets über einfache Methoden — ohne manuelle HTTP-Anfragenbehandlung oder Datentransformationen.

Anwendungsbeispiel:

from passwork_client import PassworkClient

client = PassworkClient(host="https://passwork.example.com")
client.set_tokens("ACCESS_TOKEN", "REFRESH_TOKEN")  # pass tokens
client.set_master_key("MASTER_KEY")  # master key for decryption

# create vault and password
vault_id = client.create_vault(vault_name="DevOps", type_id="vault_id_type")
password_data = {
    "Name": "Database PROD", 
    "vaultId": vault_id,
    "title": "DB prod",
    "login": "admin",
    "password": "secure-password",
    "url": "https://db.example.com"
}
password_id = client.create_item(password_data)

# retrieve and use password
secret = client.get_item(password_id)
print(secret['password'])

Hauptfunktionen:

  • Einfache Methoden wie create_item()get_item()create_vault() erledigen alle Operationen; keine manuellen HTTP-Anfragen erforderlich
  • Client-seitige Kryptographie — der Masterpasswort verlässt nie Ihre Umgebung
  • Der Connector speichert, stellt wieder her und aktualisiert Tokens automatisch
  • Die universelle call()-Methode ermöglicht den Zugriff auf jeden API-Endpunkt, auch solche ohne dedizierte Methoden

Der Python-Connector beschleunigt Automatisierung und Integration ohne unnötige Komplexität.

CLI-Dienstprogramm

Für Shell-Skript- und CI/CD-Automatisierung bietet Passwork CLI ein universelles Tool mit zwei Betriebsmodi:

  • exec — extrahiert Secrets, erstellt Umgebungsvariablen und führt Ihren Prozess aus. Passwörter werden nie gespeichert und sind nur während der Ausführung verfügbar.
  • api — ruft jede Passwork-API-Methode auf und gibt JSON-Antworten zurück.

Hauptfunktionen:

  • Passwörter werden als Umgebungsvariablen eingefügt
  • Secrets werden automatisch in CI/CD-Pipelines geladen
  • Temporäre Variablen ermöglichen Dienstkonto-Operationen
  • Native Integration mit Ansible, Terraform, Jenkins und ähnlichen Tools

Anwendungsbeispiele

Passwort abrufen und Befehl ausführen:

# Export environment variables
export PASSWORK_HOST="https://passwork.example.com"
export PASSWORK_TOKEN="your_token"
export PASSWORK_MASTER_KEY="your_master_key"

# Retrieve password by ID and run MySQL client
passwork-cli exec --password-id "db_password_id" mysql -u admin -h localhost -p $DB_PASSWORD database_name

Skript mit mehreren Secrets ausführen:

passwork-cli exec \
  --password-id "db123,api456,storage789" \
  deploy.sh --db-pass=$DATABASE_PASSWORD --api-key=$API_KEY --storage-key=$STORAGE_KEY

Tresorliste über API abrufen:

passwork-cli api --method GET --endpoint "v1/vaults"

Die CLI unterstützt Tag- und Ordnerfilterung, benutzerdefinierte Felder, Token-Aktualisierung und flexible Konfiguration für diverse Automatisierungsszenarien.

Docker-Container

Für die CI/CD-Integration ermöglicht das offizielle passwork/passwork-cli Docker-Image schnelle CLI-Starts in isolierten Umgebungen.

Startbeispiel:

docker run -it --rm \
  -e PASSWORK_HOST="https://passwork.example.com" \
  -e PASSWORK_TOKEN="your_access_token" \
  -e PASSWORK_MASTER_KEY="your_master_key" \
  passwork-cli exec --password-id "db_password_id" mysql -h db_host -u admin -p $DB_PASSWORD db_name

Hauptfunktionen:

  • Bereit für GitLab, Bitbucket Pipelines und docker-compose-Workflows
  • Secrets können einfach zwischen Containern übergeben werden

Wie Passwort-Rotation automatisiert wird

Regelmäßige Passwortänderungen sind eine grundlegende Sicherheitsanforderung, aber manuelle Rotation birgt Risiken und kostet Zeit. Passwork ermöglicht vollständige Automatisierung über den Python-Connector.

Rotations-Workflow:

  1. Aktuelles Passwort aus Passwork abrufen (get_item)
  2. Neues sicheres Passwort generieren
  3. Passwort im Zielsystem ändern (z. B. ALTER USER für Datenbanken)
  4. Eintrag in Passwork aktualisieren (update_item)
  5. Team über den Abschluss benachrichtigen

Beispielimplementierung:

from passwork_client import PassworkClient
import secrets
import psycopg2

def rotate_db_password(passwork_host, accessToken, refreshToken, master_key, password_id, db_params):
    client = PassworkClient(passwork_host)
    client.set_tokens(accessToken, refreshToken)
    client.set_master_key(master_key)
    
    secret = client.get_item(password_id)
    current_password = secret['password']
    new_password = secrets.token_urlsafe(32)
    
    conn = psycopg2.connect(
        dbname=db_params['db'], 
        user=db_params['user'],
        password=current_password, 
        host=db_params['host']
    )
    
    with conn.cursor() as cur:
        cur.execute(f"ALTER USER {db_params['user']} WITH PASSWORD '{new_password}'")
    conn.commit()
    
    client.update_item(password_id, {"password": new_password})
    print("Password successfully rotated and updated in Passwork")

Vorteile:

  • Vollständig automatisierte Rotation eliminiert manuelle Aktionen und menschliche Fehler
  • Neues Passwort ist sofort für das gesamte Team verfügbar — keine Verzögerungen oder Kommunikationslücken

Sicherheit: Zero Knowledge und Verschlüsselung

Passwork implementiert eine Zero-Knowledge-Architektur: Der Server greift nie auf Secrets im Klartext zu. Selbst Administratoren mit vollem Infrastrukturzugriff können Ihre Daten nicht lesen.

  • Server-seitige Verschlüsselung — Alle Secrets werden verschlüsselt auf dem Server gespeichert. Geeignet für interne Netzwerke und Standard-Sicherheitsanforderungen.
  • Client-seitige Verschlüsselung (CSE) — Secrets werden vor der Übertragung auf dem Client verschlüsselt; nur Chiffretext erreicht den Server. Der Masterpasswort wird aus dem Masterpasswort des Benutzers abgeleitet. Unverzichtbar für Cloud-Deployments oder strenge Compliance-Anforderungen.

Wahl des Modells:

  • Cloud-Deployment oder strenge Compliance → CSE aktivieren
  • Internes Netzwerk mit Standardanforderungen → Server-seitige Verschlüsselung ausreichend

Autorisierung und Tokens

Die Passwork API verwendet ein Token-Paar: accessToken und refreshToken.

  • Access Token — Kurzlebige Anmeldedaten für API-Anfragen
  • Refresh Token — Ermöglicht automatische Access-Token-Erneuerung ohne erneute Autorisierung

Der Python-Connector verwaltet die Token-Aktualisierung automatisch und gewährleistet stabile Integrationen ohne manuellen Eingriff.

Best Practices für die Sicherheit:

  • Dedizierte Dienstkonten erstellen — Minimale Berechtigungen zuweisen, Zugriff nur auf erforderliche Tresore und Ordner gewähren
  • Tokens regelmäßig rotieren — Ablaufrichtlinien festlegen und Anmeldedaten nach Zeitplan aktualisieren
  • Sichere Token-Speicherung — Umgebungsvariablen oder dedizierte Secret-Tresore verwenden (niemals hartcodieren)
  • HTTPS erzwingen — Immer verschlüsselte Verbindungen für die API-Kommunikation verwenden

Fazit

Passwork hat sich von einem Passwort-Manager zu einer umfassenden Secrets-Management-Plattform entwickelt. Die offene API, der Python-Connector, CLI und das Docker-Image ermöglichen nahtlose Integration in jeden Workflow bei gleichzeitiger Zentralisierung von Secrets mit granularer Zugriffskontrolle.

  • Für Administratoren: Zuverlässige Speicherung mit integrierten Automatisierungsfunktionen.
  • Für Entwickler und DevOps: Produktionsreife API und Tools für sichere Secrets-Handhabung.

Passwork konsolidiert, was typischerweise mehrere Lösungen erfordert, in einem einzigen System mit einheitlicher Verwaltung. Dies reduziert den operativen Aufwand, vereinfacht Rotations-Workflows und bietet IT- und Entwicklungsteams transparente Sicherheitskontrollen.

Als Secrets-Management-Plattform liefert Passwork eine geschützte, skalierbare Infrastruktur, die sich an die Bedürfnisse Ihrer Organisation anpasst.

Erfahren Sie, wie Passwork das Credential-Lifecycle-Management in Ihrer Infrastruktur automatisiert. Holen Sie sich eine kostenlose Demo mit vollem API-Zugriff.

Weiterführende Lektüre

Passwork 7.1: Tresortypen
Table of contents * What are vault types * Basic vault types * Advantages of vault types * Managing vault types * Migration from previous versions * Conclusion: Data control and efficiency Vault types Passwork 7.1 introduces a robust vault types architecture, providing enterprise-grade access control for enhanced security and management. Vault types address a
DSGVO-Passwortsicherheit: Leitfaden für effektive Mitarbeiterschulung
Learn proven strategies to train employees for GDPR password security compliance. Reduce breach risks with practical training methods.
HIPAA-Anforderungen für das Passwort-Management
Table of contents * Introduction * How HIPAA works * Cybersecurity and clinical efficiency * HIPAA and password management * How to train staff to meet HIPAA standards * How Passwork supports HIPAA compliance * Sustainable HIPAA compliance Introduction In the complex ecosystem of modern healthcare, patient data is essential for secure management. In 2024, the U.

Passwork: Secrets Management und Automatisierung für DevOps

Oct 7, 2025 — 8 min read
Passwork: Gestión de secretos y automatización para DevOps

Introducción

En el entorno corporativo, el número de contraseñas, claves y certificados digitales está aumentando rápidamente, y la gestión de secretos se está convirtiendo en una de las tareas críticas para los equipos de TI.

La gestión de secretos abarca el ciclo de vida completo de los datos sensibles: desde la generación segura y el almacenamiento cifrado hasta la rotación automatizada y los registros de auditoría. A medida que las organizaciones adoptan infraestructura en la nube, microservicios y prácticas DevOps, el desafío se intensifica — las aplicaciones necesitan acceso fluido a las credenciales mientras mantienen los principios de seguridad de confianza cero.

Los departamentos de TI y los equipos DevOps enfrentan situaciones donde hay demasiados secretos que se vuelven difíciles de estructurar, controlar y proteger. En proyectos reales, estos secretos se dispersan en archivos de configuración, variables de entorno, scripts de despliegue y ocasionalmente aparecen en repositorios públicos.

Qué es la gestión de secretos

La gestión de secretos es una práctica recomendada de ciberseguridad y un conjunto de herramientas para almacenar, gestionar, acceder y rotar de forma segura las credenciales de autenticación digital utilizadas por identidades no humanas como aplicaciones, servicios, servidores y cargas de trabajo automatizadas.

Dichos secretos incluyen contraseñas, frases de contraseña, claves SSH, API y de cifrado, tokens de acceso, certificados digitales y cualquier otra credencial que permita el acceso seguro a la infraestructura.

Por qué es importante la gestión de secretos

Proteger la información confidencial es una prioridad clave para cualquier empresa. Los secretos requieren un control estricto en cada etapa de su ciclo de vida. Estos son solo algunos beneficios de una gestión adecuada de secretos:

  • Almacenamiento centralizado. Todas las contraseñas, claves y tokens se almacenan en un único repositorio protegido, evitando que terminen en documentos abiertos, scripts o código fuente, reduciendo el riesgo de filtraciones y acceso no autorizado.
  • Gestión de acceso flexible. El sistema permite determinar de forma individualizada quién puede acceder a qué secretos, ya sean empleados individuales, grupos o cuentas de servicio. Esto ayuda a implementar el principio de mínimo privilegio y reduce los vectores de ataque potenciales.
  • Control completo y transparencia operativa. Cada solicitud se registra: puede rastrear quién, cuándo y qué acciones se realizaron. La auditoría facilita el cumplimiento normativo y hace que los procesos de seguridad sean máximamente transparentes.
  • Rotación automatizada. Las contraseñas y claves se actualizan regularmente de forma automática, según un horario o cuando se detectan amenazas. Esto ahorra recursos de TI y reduce la probabilidad de usar datos obsoletos o comprometidos.
  • Integración con infraestructura y DevOps. El acceso a los secretos se proporciona a través de API, CLI, SDK y plugins, simplificando la integración del sistema con pipelines CI/CD, plataformas en la nube, contenedores y bases de datos.
  • Respuesta rápida a incidentes. Un enfoque centralizado permite revocar o reemplazar rápidamente secretos vulnerables, minimizando las consecuencias de los incidentes y previniendo la propagación de amenazas dentro de la empresa.

Sin una solución unificada, los secretos a menudo «deambulan» por archivos de configuración y código fuente, complicando sus actualizaciones y aumentando los riesgos de compromiso. Los gestores de contraseñas corporativos resuelven esta tarea, pero no todos admiten la automatización necesaria para los procesos DevOps modernos.

Passwork: Más que un gestor de contraseñas

Passwork comenzó como un gestor de contraseñas corporativo — una herramienta simple y conveniente para almacenar credenciales. Pero los equipos de TI modernos necesitan más: automatización, integración y acceso programático a los secretos.

Con Passwork 7, la plataforma evolucionó más allá del almacenamiento tradicional de contraseñas hacia un sistema de gestión de secretos completo.

Arquitectura API-first

Passwork está construido sobre principios API-first. Esto significa que cada función disponible en la interfaz de usuario está disponible a través de REST API.

La API proporciona acceso programático a todas las funciones del sistema: gestión de contraseñas, bóvedas, carpetas, usuarios, roles, etiquetas, archivos adjuntos y registros de eventos. Esto permite automatizar el aprovisionamiento y revocación de acceso, actualizar contraseñas de forma programática, integrar Passwork en pipelines CI/CD y exportar registros para análisis.

Dos productos en uno

En otras palabras, Passwork ahora combina dos productos completos:

  • Gestor de contraseñas — interfaz intuitiva para almacenamiento seguro de credenciales y colaboración en equipo.
  • Sistema de gestión de secretos — acceso programático a través de REST API, conector Python, CLI y contenedor Docker para automatización de flujos de trabajo.

Herramientas de automatización

Conector Python

El conector Python oficial de Passwork elimina la complejidad de trabajar con llamadas API de bajo nivel y criptografía. Gestione secretos mediante métodos simples — sin necesidad de manejo manual de solicitudes HTTP ni transformaciones de datos.

Ejemplo de uso:

from passwork_client import PassworkClient

client = PassworkClient(host="https://passwork.example.com")
client.set_tokens("ACCESS_TOKEN", "REFRESH_TOKEN")  # pass tokens
client.set_master_key("MASTER_KEY")  # master key for decryption

# create vault and password
vault_id = client.create_vault(vault_name="DevOps", type_id="vault_id_type")
password_data = {
    "Name": "Database PROD", 
    "vaultId": vault_id,
    "title": "DB prod",
    "login": "admin",
    "password": "secure-password",
    "url": "https://db.example.com"
}
password_id = client.create_item(password_data)

# retrieve and use password
secret = client.get_item(password_id)
print(secret['password'])

Características principales:

  • Métodos simples como create_item()get_item()create_vault() manejan todas las operaciones; no se necesitan solicitudes HTTP manuales
  • Criptografía del lado del cliente — la clave maestra nunca sale de su entorno
  • El conector guarda, restaura y actualiza tokens automáticamente
  • El método universal call() permite acceder a cualquier endpoint de la API, incluso aquellos sin métodos dedicados

El conector Python acelera la automatización e integración sin complejidad innecesaria.

Utilidad CLI

Para la automatización de scripts de shell y CI/CD, Passwork CLI proporciona una herramienta universal con dos modos de operación:

  • exec — extrae secretos, crea variables de entorno y ejecuta su proceso. Las contraseñas nunca se guardan y solo están disponibles durante la ejecución.
  • api — llama a cualquier método de la API de Passwork y devuelve respuestas JSON.

Características principales:

  • Contraseñas inyectadas como variables de entorno
  • Secretos cargados automáticamente en pipelines CI/CD
  • Variables temporales permiten operaciones de cuentas de servicio
  • Integración nativa con Ansible, Terraform, Jenkins y herramientas similares

Ejemplos de uso

Recuperar una contraseña y ejecutar un comando:

# Export environment variables
export PASSWORK_HOST="https://passwork.example.com"
export PASSWORK_TOKEN="your_token"
export PASSWORK_MASTER_KEY="your_master_key"

# Retrieve password by ID and run MySQL client
passwork-cli exec --password-id "db_password_id" mysql -u admin -h localhost -p $DB_PASSWORD database_name

Ejecutar script con múltiples secretos:

passwork-cli exec \
  --password-id "db123,api456,storage789" \
  deploy.sh --db-pass=$DATABASE_PASSWORD --api-key=$API_KEY --storage-key=$STORAGE_KEY

Obtener lista de bóvedas a través de la API:

passwork-cli api --method GET --endpoint "v1/vaults"

El CLI admite filtrado por etiquetas y carpetas, campos personalizados, actualización de tokens y configuración flexible para diversos escenarios de automatización.

Contenedor Docker

Para la integración CI/CD, la imagen oficial passwork/passwork-cli Docker permite lanzamientos rápidos del CLI en entornos aislados.

Ejemplo de lanzamiento:

docker run -it --rm \
  -e PASSWORK_HOST="https://passwork.example.com" \
  -e PASSWORK_TOKEN="your_access_token" \
  -e PASSWORK_MASTER_KEY="your_master_key" \
  passwork-cli exec --password-id "db_password_id" mysql -h db_host -u admin -p $DB_PASSWORD db_name

Características principales:

  • Listo para GitLab, Bitbucket Pipelines y flujos de trabajo docker-compose
  • Secretos fácilmente compartidos entre contenedores

Cómo automatizamos la rotación de contraseñas

Los cambios regulares de contraseña son un requisito fundamental de seguridad, pero la rotación manual introduce riesgos y desperdicia tiempo. Passwork permite una automatización completa a través del conector Python.

Flujo de trabajo de rotación:

  1. Recuperar la contraseña actual de Passwork (get_item)
  2. Generar nueva contraseña segura
  3. Cambiar la contraseña en el sistema de destino (por ejemplo, ALTER USER para bases de datos)
  4. Actualizar el registro en Passwork (update_item)
  5. Notificar al equipo de la finalización

Ejemplo de implementación:

from passwork_client import PassworkClient
import secrets
import psycopg2

def rotate_db_password(passwork_host, accessToken, refreshToken, master_key, password_id, db_params):
    client = PassworkClient(passwork_host)
    client.set_tokens(accessToken, refreshToken)
    client.set_master_key(master_key)
    
    secret = client.get_item(password_id)
    current_password = secret['password']
    new_password = secrets.token_urlsafe(32)
    
    conn = psycopg2.connect(
        dbname=db_params['db'], 
        user=db_params['user'],
        password=current_password, 
        host=db_params['host']
    )
    
    with conn.cursor() as cur:
        cur.execute(f"ALTER USER {db_params['user']} WITH PASSWORD '{new_password}'")
    conn.commit()
    
    client.update_item(password_id, {"password": new_password})
    print("Password successfully rotated and updated in Passwork")

Beneficios:

  • La rotación completamente automatizada elimina acciones manuales y errores humanos
  • La nueva contraseña está disponible inmediatamente para todo el equipo — sin retrasos ni brechas de comunicación

Seguridad: Zero knowledge y cifrado

Passwork implementa arquitectura Zero knowledge: el servidor nunca accede a los secretos en texto plano. Incluso los administradores con acceso completo a la infraestructura no pueden leer sus datos.

  • Cifrado del lado del servidor — Todos los secretos se almacenan cifrados en el servidor. Adecuado para redes internas y requisitos de seguridad estándar.
  • Cifrado del lado del cliente (CSE) — Los secretos se cifran en el cliente antes de la transmisión; solo el texto cifrado llega al servidor. La clave maestra se deriva de la contraseña maestra del usuario. Esencial para despliegues en la nube o requisitos de cumplimiento estrictos.

Elegir su modelo:

  • Despliegue en la nube o cumplimiento estricto → Habilitar CSE
  • Red interna con requisitos estándar → El cifrado del lado del servidor es suficiente

Autorización y tokens

La API de Passwork utiliza un par de tokens: accessToken y refreshToken.

  • Token de acceso — Credencial de corta duración para solicitudes API
  • Token de actualización — Permite la renovación automática del token de acceso sin reautorización

El conector Python maneja la actualización de tokens automáticamente, asegurando integraciones estables sin intervención manual.

Mejores prácticas de seguridad:

  • Crear cuentas de servicio dedicadas — Asignar permisos mínimos, otorgar acceso solo a las bóvedas y carpetas requeridas
  • Rotar tokens regularmente — Establecer políticas de expiración y actualizar credenciales según un horario
  • Almacenamiento seguro de tokens — Usar variables de entorno o bóvedas de secretos dedicadas (nunca codificar directamente)
  • Aplicar HTTPS — Siempre usar conexiones cifradas para la comunicación API

Conclusiones

Passwork ha evolucionado de un gestor de contraseñas a una plataforma integral de gestión de secretos. La API abierta, el conector Python, CLI e imagen Docker permiten una integración perfecta en cualquier flujo de trabajo mientras centralizan los secretos con control de acceso granular.

  • Para administradores: Almacenamiento confiable con capacidades de automatización integradas.
  • Para desarrolladores y DevOps: API y herramientas listas para producción para el manejo seguro de secretos.

Passwork consolida lo que típicamente requiere múltiples soluciones en un único sistema con gestión unificada. Esto reduce la sobrecarga operativa, simplifica los flujos de trabajo de rotación y proporciona a los equipos de TI y desarrollo controles de seguridad transparentes.

Como plataforma de gestión de secretos, Passwork ofrece una infraestructura protegida y escalable que se adapta a las necesidades de su organización.

Descubra cómo Passwork automatiza la gestión del ciclo de vida de credenciales en su infraestructura. Obtenga una demostración gratuita con acceso completo a la API.

Lecturas adicionales

Passwork 7.1: Tipos de bóvedas
Table of contents * What are vault types * Basic vault types * Advantages of vault types * Managing vault types * Migration from previous versions * Conclusion: Data control and efficiency Vault types Passwork 7.1 introduces a robust vault types architecture, providing enterprise-grade access control for enhanced security and management. Vault types address a
Seguridad de contraseñas GDPR: Guía para una formación eficaz del personal
Learn proven strategies to train employees for GDPR password security compliance. Reduce breach risks with practical training methods.
Requisitos de HIPAA para la gestión de contraseñas
Table of contents * Introduction * How HIPAA works * Cybersecurity and clinical efficiency * HIPAA and password management * How to train staff to meet HIPAA standards * How Passwork supports HIPAA compliance * Sustainable HIPAA compliance Introduction In the complex ecosystem of modern healthcare, patient data is essential for secure management. In 2024, the U.

Passwork: gestión de secretos y automatización para DevOps

Oct 7, 2025 — 7 min read
Passwork: Secrets management and automation for DePasswork: Secrets management and automation for DevOpsvOps

Introduction

In corporate environment, the number of passwords, keys, and digital certificates is rapidly increasing, and secrets management is becoming one of the critical tasks for IT teams.

Secrets management addresses the complete lifecycle of sensitive data: from secure generation and encrypted storage to automated rotation and audit trails. As organizations adopt cloud infrastructure, microservices, and DevOps practices, the challenge intensifies — applications need seamless access to credentials while maintaining zero-trust security principles.

IT departments and DevOps teams face situations where there are too many secrets that become difficult to structure, control, and protect. In real-world projects, these secrets scatter across config files, environment variables, deployment scripts, and occasionally surface in public repositories.

What is secrets management

Secrets management is a cybersecurity best practice and set of tools for securely storing, managing, accessing, and rotating digital authentication credentials used by non-human identities such as applications, services, servers, and automated workloads.

Such secrets include passwords, passphrases, SSH, API and encryption keys, access tokens, digital certificates, and any other credentials that enable secure access to infrastructure.

Why secrets management matters

Protecting confidential information is a key priority for any business. Secrets require strict control at every stage of their lifecycle. That's just a few benefits of proper secrets management:

  • Centralized storage. All passwords, keys, and tokens are stored in a single protected repository, preventing them from ending up in open docs, scripts, or source code, reducing the risk of leaks and unauthorized access.
  • Flexible access management. The system allows individualized determination of who can access which secrets, whether individual employees, groups, or service accounts. This helps implement the principle of least privilege and reduces potential attack vectors.
  • Complete control and operational transparency. Every request is logged: you can track who, when, and what actions were performed. Auditing facilitates regulatory compliance and makes security processes maximally transparent.
  • Automated rotation. Passwords and keys are regularly updated automatically, on schedule or when threats are detected. This saves IT resources and reduces the likelihood of using outdated or compromised data.
  • Integration with infrastructure and DevOps. Access to secrets is provided through API, CLI, SDK, and plugins, simplifying system integration with CI/CD pipelines, cloud platforms, containers, and databases.
  • Rapid incident response. A centralized approach allows quick revocation or replacement of vulnerable secrets, minimizing incident consequences and preventing threat propagation within the company.

Without a unified solution, secrets often "wander" through configuration files and source code, complicating their updates and increasing compromise risks. Corporate password managers solve this task, but not all of them support the necessary automation for modern DevOps processes.

Passwork: More than a password manager

Passwork started as a corporate password manager — a simple and convenient tool for storing credentials. But modern IT teams need more: automation, integration, and programmatic access to secrets.

With Passwork 7, the platform evolved beyond traditional password storage into a full-fledged secrets management system.

API-first architecture

Passwork is built on API-first principles. This means that every function available in the UI is available through REST API.

The API provides programmatic access to all system functions: password management, vaults, folders, users, roles, tags, file attachments, and event logs. This enables you to automate access provisioning and revocation, update passwords programmatically, integrate Passwork into CI/CD pipelines, and export logs for analysis.

Two products in one

In other words, Passwork now combines two full-fledged products:

  • Password manager — intuitive interface for secure credential storage and team collaboration.
  • Secrets management system — programmatic access through REST API, Python connector, CLI, and Docker container for workflow automation.

Automation tools

Python connector

Passwork's official Python connector eliminates the complexity of working with low-level API calls and cryptography. Manage secrets through simple methods—no manual HTTP request handling or data transformations required.

Usage example:

from passwork_client import PassworkClient

client = PassworkClient(host="https://passwork.example.com")
client.set_tokens("ACCESS_TOKEN", "REFRESH_TOKEN")  # pass tokens
client.set_master_key("MASTER_KEY")  # master key for decryption

# create vault and password
vault_id = client.create_vault(vault_name="DevOps", type_id="vault_id_type")
password_data = {
    "Name": "Database PROD", 
    "vaultId": vault_id,
    "title": "DB prod",
    "login": "admin",
    "password": "secure-password",
    "url": "https://db.example.com"
}
password_id = client.create_item(password_data)

# retrieve and use password
secret = client.get_item(password_id)
print(secret['password'])

Key features:

  • Simple methods like create_item()get_item()create_vault() handle all operations; no manual HTTP requests needed
  • Client-side cryptography — master key never leaves your environment
  • Connector automatically saves, restores, and refreshes tokens
  • Universal call() method enables access to any API endpoint, even those without dedicated methods

The Python connector accelerates automation and integration without unnecessary complexity.

CLI utility

For shell script and CI/CD automation, Passwork CLI provides a universal tool with two operating modes:

  • exec — extracts secrets, creates environment variables, and runs your process. Passwords are never saved and are only available during execution.
  • api — calls any Passwork API method and returns JSON responses.

Key features:

  • Passwords injected as environment variables
  • Secrets automatically loaded in CI/CD pipelines
  • Temporary variables enable service account operations
  • Native integration with Ansible, Terraform, Jenkins, and similar tools

Usage examples

Retrieve a password and execute a command:

# Export environment variables
export PASSWORK_HOST="https://passwork.example.com"
export PASSWORK_TOKEN="your_token"
export PASSWORK_MASTER_KEY="your_master_key"

# Retrieve password by ID and run MySQL client
passwork-cli exec --password-id "db_password_id" mysql -u admin -h localhost -p $DB_PASSWORD database_name

Running script with multiple secrets:

passwork-cli exec \
  --password-id "db123,api456,storage789" \
  deploy.sh --db-pass=$DATABASE_PASSWORD --api-key=$API_KEY --storage-key=$STORAGE_KEY

Getting vault list through API:

passwork-cli api --method GET --endpoint "v1/vaults"

The CLI supports tag and folder filtering, custom fields, token refresh, and flexible configuration for diverse automation scenarios.

Docker container

For CI/CD integration, the official passwork/passwork-cli Docker image enables quick CLI launches in isolated environments.

Launch example:

docker run -it --rm \
  -e PASSWORK_HOST="https://passwork.example.com" \
  -e PASSWORK_TOKEN="your_access_token" \
  -e PASSWORK_MASTER_KEY="your_master_key" \
  passwork-cli exec --password-id "db_password_id" mysql -h db_host -u admin -p $DB_PASSWORD db_name

Key features:

  • Ready for GitLab, Bitbucket Pipelines, and docker-compose workflows
  • Secrets easily passed between containers

How we automate password rotation

Regular password changes are a fundamental security requirement, but manual rotation introduces risk and wastes time. Passwork enables complete automation through the Python connector.

Rotation workflow:

  1. Retrieve current password from Passwork (get_item)
  2. Generate new secure password
  3. Change password in target system (e.g., ALTER USER for databases)
  4. Update record in Passwork (update_item)
  5. Notify team of completion

Example implementation:

from passwork_client import PassworkClient
import secrets
import psycopg2

def rotate_db_password(passwork_host, accessToken, refreshToken, master_key, password_id, db_params):
    client = PassworkClient(passwork_host)
    client.set_tokens(accessToken, refreshToken)
    client.set_master_key(master_key)
    
    secret = client.get_item(password_id)
    current_password = secret['password']
    new_password = secrets.token_urlsafe(32)
    
    conn = psycopg2.connect(
        dbname=db_params['db'], 
        user=db_params['user'],
        password=current_password, 
        host=db_params['host']
    )
    
    with conn.cursor() as cur:
        cur.execute(f"ALTER USER {db_params['user']} WITH PASSWORD '{new_password}'")
    conn.commit()
    
    client.update_item(password_id, {"password": new_password})
    print("Password successfully rotated and updated in Passwork")

Benefits:

  • Fully automated rotation eliminates manual actions and human error
  • New password immediately available to the entire team—no delays or communication gaps

Security: Zero knowledge and encryption

Passwork implements Zero knowledge architecture: the server never accesses secrets in plain text. Even administrators with full infrastructure access cannot read your data.

  • Server-side encryption — All secrets stored encrypted on the server. Suitable for internal networks and standard security requirements.
  • Client-side encryption (CSE) — Secrets encrypted on the client before transmission; only ciphertext reaches the server. Master key derived from user's master password. Essential for cloud deployments or strict compliance requirements.

Choosing your model:

  • Cloud deployment or strict compliance → Enable CSE
  • Internal network with standard requirements → Server-side encryption sufficient

Authorization and tokens

Passwork API uses a token pair: accessToken and refreshToken.

  • Access token — Short-lived credential for API requests
  • Refresh token — Enables automatic access token renewal without re-authorization

The Python connector handles token refresh automatically, ensuring stable integrations without manual intervention.

Security best practices:

  • Create dedicated service accounts — Assign minimal permissions, grant access only to required vaults and folders
  • Rotate tokens regularly — Set expiration policies and refresh credentials on schedule
  • Secure token storage — Use environment variables or dedicated secret vaults (never hardcode)
  • Enforce HTTPS — Always use encrypted connections for API communication

Conclusions

Passwork has evolved from a password manager into a comprehensive secrets management platform. The open API, Python connector, CLI, and Docker image enable seamless integration into any workflow while centralizing secrets with granular access control.

  • For administrators: Reliable storage with built-in automation capabilities.
  • For developers and DevOps: Production-ready API and tools for secure secrets handling.

Passwork consolidates what typically requires multiple solutions into a single system with unified management. This reduces operational overhead, simplifies rotation workflows, and provides IT and development teams with transparent security controls.

As a secrets management platform, Passwork delivers protected, scalable infrastructure that adapts to your organization's needs.

See how Passwork automates credential lifecycle management in your infrastructure. Get free demo with full API access.

Further reading

Passwork 7.1: Vault types
Table of contents * What are vault types * Basic vault types * Advantages of vault types * Managing vault types * Migration from previous versions * Conclusion: Data control and efficiency Vault types Passwork 7.1 introduces a robust vault types architecture, providing enterprise-grade access control for enhanced security and management. Vault types address a
GDPR password security: Guide to effective staff training
Learn proven strategies to train employees for GDPR password security compliance. Reduce breach risks with practical training methods.
HIPAA requirements for password management
Table of contents * Introduction * How HIPAA works * Cybersecurity and clinical efficiency * HIPAA and password management * How to train staff to meet HIPAA standards * How Passwork supports HIPAA compliance * Sustainable HIPAA compliance Introduction In the complex ecosystem of modern healthcare, patient data is essential for secure management. In 2024, the U.

Passwork: Secrets management and automation for DevOps