惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - Franky
MyScale Blog
MyScale Blog
A
About on SuperTechFans
博客园_首页
B
Blog RSS Feed
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
C
Check Point Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 【当耐特】
M
MIT News - Artificial intelligence
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
I
InfoQ
罗磊的独立博客

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Part 9: Security First - Credentials, Auth, and Secrets M...
Nick · 2026-06-18 · via DEV Community

Building a workflow engine that interacts with external APIs, databases, and internal systems means you are constantly handling sensitive data. If you get security wrong here, the consequences are severe. Today, we are discussing how we handle credentials, authentication, and secrets management in Vyshyvanka.

The Problem: Where do secrets live?

The biggest mistake developers make when building automation tools is hard-coding credentials. Whether it is an API key in a config file or a database password in an environment variable, these secrets eventually leak. We needed a way to manage secrets that is both developer-friendly and secure enough for production environments.

The Credential Store

In Vyshyvanka, we do not store raw secrets in the workflow definition. Instead, we use a dedicated Credential Store. When you add a new service integration to your workflow, you create a Credential object through the Credential Manager UI. This object holds the encrypted access data for that service.

Each node that needs authentication is assigned a CredentialId in its configuration. At runtime, the engine resolves that reference through the ICredentialProvider, decrypts the credential in-memory, and provides it to the node instance. The raw secrets never appear in workflow JSON, API responses, or execution logs.

// How a node receives its credential at execution time
var input = new NodeInput
{
    Data = inputData,
    Configuration = evaluatedConfig,
    CredentialId = node.CredentialId  // Reference, not the actual secret
};

Three Storage Backends

We support three credential storage providers, configurable via appsettings.json:

Provider Config Value How Secrets Are Stored
Built-in BuiltIn AES-256 encrypted in the database
HashiCorp Vault HashiCorpVault Vault KV v2 secret engine
OpenBao OpenBao OpenBao KV v2 secret engine

All three share the same ICredentialService interface and CredentialValidator logic. The choice of backend is transparent to the rest of the system — nodes never know where their credentials are stored.

Encryption at Rest (Built-in Provider)

For the built-in provider, we use AesCredentialEncryption with AES-256. The master encryption key is managed via environment variables — never stored in appsettings.json or committed to source control.

public sealed class AesCredentialEncryption : ICredentialEncryption
{
    // Encrypts credential data before DB persistence
    // Decrypts on-demand when a node needs access
}

Even if a database backup is compromised, the actual credentials remain encrypted and unusable without the master key.

External Secrets Managers (Vault / OpenBao)

For enterprises that already manage secrets centrally, the VaultCredentialService delegates all secret storage to HashiCorp Vault or OpenBao. Metadata (name, type, associations) stays in the database, but the actual sensitive values live in the vault's KV v2 engine.

This gives you:

  • Centralized secret rotation without touching Vyshyvanka
  • Audit trails from the vault itself
  • Integration with existing enterprise key management

Authentication Providers

Vyshyvanka supports four authentication strategies, selectable at deployment time:

Provider Session Tokens Login Flow
Built-in Local JWT Username/password via API
Keycloak External OIDC Redirect to Keycloak
Authentik External OIDC Redirect to Authentik
LDAP Local JWT Verify against directory

For OIDC providers, the API validates external tokens and an OidcClaimsTransformation middleware provisions local users on first login. For LDAP, the LdapAuthenticationService verifies credentials against the directory server.

Additionally, API key authentication (X-API-Key header) is always available regardless of the primary provider — useful for CI/CD integrations and automated workflow triggers.

Node-Level Auth Strategies

Our node architecture supports various authentication strategies per credential type:

  • Basic Auth: Username/password for legacy services
  • Bearer Tokens: The standard for most modern REST APIs
  • API Keys: Header or query parameter based
  • Custom Headers: For services with non-standard auth schemes

Each node that requires credentials declares this with the [RequiresCredential] attribute, and the Designer UI automatically shows the credential picker for that node.

Security Rules We Enforce

Always:

  • Encrypt credentials at rest (AES-256 or delegate to Vault/OpenBao)
  • Validate resource ownership via ICurrentUserService before any operation
  • Use parameterized queries for all database operations
  • Sanitize user input in expressions to prevent injection

Never:

  • Return credential values in any API response
  • Log credentials or sensitive data at any log level
  • Allow cross-user workflow access without explicit sharing
  • Store Vault/OpenBao tokens in plain text in config files

Best Practices

  • Rotate your keys: The credential store allows you to update a secret without modifying workflow logic. The CredentialId reference stays the same.
  • Use scoped permissions: If a service supports it, create API keys with minimum required permissions.
  • Choose the right backend: Use Vault/OpenBao for production environments where compliance and audit trails matter. The built-in provider works well for development and small deployments.

Security is not a feature you add at the end; it is the foundation on which everything else is built.

In the next part, we will discuss Part 10: Plugin System Architecture - Extensibility by Design. Stay tuned!


Check out the project source code here: https://github.com/homolibere/Vyshyvanka