Skip to content

Hardening, flow logging, and revocation status fix#6

Open
bhillkeyfactor wants to merge 10 commits intorelease-1.0from
hardening-flow-logging
Open

Hardening, flow logging, and revocation status fix#6
bhillkeyfactor wants to merge 10 commits intorelease-1.0from
hardening-flow-logging

Conversation

@bhillkeyfactor
Copy link
Copy Markdown
Collaborator

Summary

  • Bug fix: Revoke no longer sets certificate status to FAILED when revocation fails — certificate retains its current active status
  • Feature: Added FlowLogger utility and comprehensive hardening/defensive logging across all plugin methods, matching CSC Global patterns
  • Hardening: Guard clauses, null response guards, AggregateException flattening, per-cert error isolation in sync, input validation throughout

Azure DevOps

Files Changed

  • New: HydrantCAProxy/FlowLogger.cs — IDisposable flow diagram logger with Step/Fail/Skip tracking
  • Modified: HydrantCAProxy/HydrantIdCAPlugin.cs — FlowLogger in all public methods, guard clauses, revocation fix
  • Modified: HydrantCAProxy/RequestManager.cs — Input validation, null-safe logging, structured error messages
  • Modified: HydrantCAProxy/Client/HydrantIdClient.cs — Null guards, input validation, HTTP error handling
  • Modified: CHANGELOG.md — v1.0.2 entries

Test plan

  • Verify new enrollment succeeds with flow logging visible in trace logs
  • Verify certificate revocation succeeds and returns REVOKED status
  • Verify failed revocation throws exception (certificate stays Active, not FAILED)
  • Verify sync completes and skips bad certs without aborting
  • Verify GetSingleRecord with invalid/short caRequestID returns meaningful error
  • Review trace logs for FlowLogger ASCII diagrams on each operation

🤖 Generated with Claude Code

bhillkeyfactor and others added 10 commits December 2, 2025 10:30
The HID Global HydrantId AnyCA Gateway REST plugin extends the capabilities of HydrantId Certificate Authority Service to Keyfactor Command via the Keyfactor AnyCA Gateway. This plugin leverages the HydrantId REST API with Hawk authentication to provide comprehensive certificate lifecycle management. The plugin represents a fully featured AnyCA Plugin with the following capabilities:

*   **CA Sync**:
    *   Download all certificates issued by the HydrantId CA
    *   Support for incremental and full synchronization
    *   Automatic extraction of end-entity certificates from PEM chains
*   **Certificate Enrollment**:
    *   Support certificate enrollment with new key pairs
    *   Dynamic policy (profile) discovery from the CA
    *   Intelligent renewal vs. re-issue logic based on certificate expiration
    *   Support for PKCS#10 CSR format
    *   Configurable certificate validity periods
*   **Certificate Revocation**:
    *   Request revocation of previously issued certificates
    *   Support for standard CRL revocation reasons

---------

Co-authored-by: Keyfactor <keyfactor@keyfactor.github.io>
* feat: release 1.0 (#1)

The HID Global HydrantId AnyCA Gateway REST plugin extends the capabilities of HydrantId Certificate Authority Service to Keyfactor Command via the Keyfactor AnyCA Gateway. This plugin leverages the HydrantId REST API with Hawk authentication to provide comprehensive certificate lifecycle management. The plugin represents a fully featured AnyCA Plugin with the following capabilities:

*   **CA Sync**:
    *   Download all certificates issued by the HydrantId CA
    *   Support for incremental and full synchronization
    *   Automatic extraction of end-entity certificates from PEM chains
*   **Certificate Enrollment**:
    *   Support certificate enrollment with new key pairs
    *   Dynamic policy (profile) discovery from the CA
    *   Intelligent renewal vs. re-issue logic based on certificate expiration
    *   Support for PKCS#10 CSR format
    *   Configurable certificate validity periods
*   **Certificate Revocation**:
    *   Request revocation of previously issued certificates
    *   Support for standard CRL revocation reasons

---------

Co-authored-by: Keyfactor <keyfactor@keyfactor.github.io>

* release: 1.0.1

---------

Co-authored-by: Brian Hill <76450501+bhillkeyfactor@users.noreply.github.com>
Co-authored-by: Keyfactor <keyfactor@keyfactor.github.io>
Resolves diverged commit histories between main and release-1.0 that
were caused by duplicate squash-merge commits (c038522 vs 98581fa).
Keeps hardened code from HEAD for all conflicts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Keyfactor gateway framework sets the Microsoft.Extensions.Logging
minimum level above Trace, causing all LogTrace calls to be silently
dropped before reaching NLog. Flow diagram and step logging now uses
LogDebug (visible), and failure steps use LogWarning for visibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
LogTrace works in the CSC Global plugin with the same gateway framework,
so the MEL minimum level is not the issue. Reverting to match the
established pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants