Skip to content

fix: audit logs ACME missing fields#5760

Merged
carlosmonastyrski merged 1 commit intomainfrom
fix/acme-audit-logs
Mar 19, 2026
Merged

fix: audit logs ACME missing fields#5760
carlosmonastyrski merged 1 commit intomainfrom
fix/acme-audit-logs

Conversation

@carlosmonastyrski
Copy link
Copy Markdown
Contributor

Context

This PR contains a small fix on the ACME flows missing some audit log properties.

Screenshots

Steps to verify the change

Type

  • Fix
  • Feature
  • Improvement
  • Breaking
  • Docs
  • Chore

Checklist

  • Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).
  • Tested locally
  • Updated docs (if needed)
  • Updated CLAUDE.md files (if needed)
  • Read the contributing guide

@maidul98
Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 19, 2026

Greptile Summary

This PR fixes a gap in audit logging for ACME certificate flows by threading req.auditLogInfo (containing ipAddress, userAgent, userAgentType, and actor) through five ACME service methods that were previously creating audit log entries without those fields.

  • createAcmeAccount, createAcmeOrder, finalizeAcmeOrder, downloadAcmeCertificate, and respondToAcmeChallenge all receive auditLogInfo from the router and spread it into auditLogService.createAuditLog.
  • The explicit ACME-specific actor (either ActorType.ACME_PROFILE or ActorType.ACME_ACCOUNT) is set after the spread and correctly overrides the request-level actor from auditLogInfo, which is the expected pattern for ACME flows.
  • All six createAuditLog call-sites within the service (including both the "existing account found" and "new account created" branches of createAcmeAccount) have been updated consistently.
  • deactivateAcmeAccount is intentionally untouched — it is currently a FIXME stub with no audit log call.
  • Type definitions in pki-acme-types.ts are kept in sync with the service implementation.

Confidence Score: 5/5

  • This PR is safe to merge — it is a purely additive, non-breaking change that fills in missing audit log fields without touching any business logic.
  • All changed code paths are straightforward parameter-threading changes. Every audit log call-site that needed auditLogInfo has been updated, the type definitions are kept in sync, and no security or correctness concerns were found.
  • No files require special attention.

Important Files Changed

Filename Overview
backend/src/ee/routes/v1/pki-acme-router.ts Passes req.auditLogInfo to 5 ACME service calls (createAcmeAccount, createAcmeOrder, finalizeAcmeOrder, downloadAcmeCertificate, respondToAcmeChallenge) that were previously missing it. Change is minimal and correct.
backend/src/ee/services/pki-acme/pki-acme-service.ts Adds auditLogInfo: AuditLogInfo parameter to 5 service functions and spreads it into each corresponding createAuditLog call, supplying the previously-missing ipAddress, userAgent, and userAgentType fields to all ACME audit log events.
backend/src/ee/services/pki-acme/pki-acme-types.ts Mirrors the service-function signature changes in the TPkiAcmeServiceFactory type, adding auditLogInfo: AuditLogInfo to the types for all 5 updated methods. Import of AuditLogInfo added correctly.

Last reviewed commit: "Fix ACME audit logs"

@carlosmonastyrski carlosmonastyrski merged commit 6232ab5 into main Mar 19, 2026
12 checks passed
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.

3 participants