Skip to content

Proposal: Enhanced Certificate Authentication Helpers #713

@marlon-costa-dc

Description

@marlon-costa-dc

Summary

I'd like to contribute enhanced authentication helpers to libplugin/ that add:

  • SSH certificate validation against trusted CAs
  • Multiple CA key sources (file, base64, Vault)
  • Standardized helpers to reduce code duplication

Motivation

The current certificate authentication works but enterprise deployments need:

  1. Multiple CA sources - Not just files, but also inline base64 and Vault secrets
  2. Certificate validation helpers - Reusable MatchAndValidateCACert() function
  3. Code deduplication - Same patterns repeated across yaml, docker, kubernetes plugins

Proposed Changes (Incremental PRs)

I plan to submit this as small, incremental PRs:

Phase File Lines Description
1 libplugin/sshutil.go ~90 Certificate validation, known_hosts verification
2 libplugin/skelhelpers.go ~200 StandardTrustedUserCAKeys, StandardAuthorizedKeys
3 libplugin/skelhelpers.go ~150 StandardTestPassword, StandardPrivateKey
4 libplugin/authutil.go ~300 Vault integration (optional)
5 libplugin/authutil.go ~250 Multi-source aggregation

Each PR builds on the previous and can be reviewed independently.

Questions

  1. Would you prefer this approach or a single larger PR?
  2. Is Vault integration welcome? (Can be made optional via build tags)
  3. Any concerns about adding helpers to libplugin?

Implementation Ready

I have working implementations tested in a fork. Happy to adjust based on feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions