Skip to content

fix: replace hardcoded P12 password and crypto encryption key with secretKeyRef - #2330

Closed
bhumi46 wants to merge 3 commits into
mosip:develop-gofrom
bhumi46:fix/p12-crypto-secretref
Closed

bhumi46 wants to merge 3 commits into
mosip:develop-gofrom
bhumi46:fix/p12-crypto-secretref

Conversation

@bhumi46

@bhumi46 bhumi46 commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Summary

CodeRabbit flagged MOSIP_P12_PASSWORD and CRYPTO_ENCRYPTION_KEY as hardcoded credentials (CWE-798) in the chart's default extraEnvVars (helm/esignet/values.yaml).

extraEnvVars is a generic passthrough (common.tplvalues.render in templates/deployment.yaml) that already supports valueFrom.secretKeyRef — several neighboring entries in the same list (REDIS_PASSWORD, DB_DBUSER_PASSWORD, MOSIP_IDA_CLIENT_SECRET) already use it. No template change was needed, only the default values.

Deployments must now supply an esignet-crypto Kubernetes secret with p12-password and crypto-encryption-key keys (or override extraEnvVars entirely, as the mosip/infra deployment profiles already do).

Test plan

  • helm template helm/esignet renders without errors
  • Deploy with an esignet-crypto secret present and confirm the pod starts and can unlock its P12 keystore

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added optional support for configuring additional container volume mounts and pod volumes through deployment settings.
    • Added configuration examples for mounting file-based secrets, such as PKCS12 keystores.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: de0d8ffa-da6f-4ad3-88e4-edc92b0d464d

📥 Commits

Reviewing files that changed from the base of the PR and between e19e71c and 20c6170.

📒 Files selected for processing (1)
  • helm/esignet/values.yaml

Walkthrough

The Helm Deployment template conditionally renders .Values.extraVolumeMounts and .Values.extraVolumes. The values file documents paired settings for mounting file-based secrets, such as PKCS12 keystores.

Changes

Additional volume configuration

Layer / File(s) Summary
Render additional volumes
helm/esignet/templates/deployment.yaml, helm/esignet/values.yaml
The Deployment template renders optional extra volume mounts and pod volumes. The values documentation provides an example for mounting a file-based secret.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

  • mosip/esignet#2333 — The change renders extraVolumes and extraVolumeMounts in the Helm Deployment template.

Suggested reviewers: anushasunkada, prafulrakhade

Poem

Extra mounts align,
Volumes join the pod with care,
Helm values take flight,
Secret files appear,
Deployment stays light.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: replacing hardcoded P12 and crypto key values with Kubernetes secretKeyRef references.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Aug 6, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop-go@3a1a3f2). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop-go    #2330   +/-   ##
=============================================
  Coverage              ?   66.35%           
=============================================
  Files                 ?      123           
  Lines                 ?     7987           
  Branches              ?      110           
=============================================
  Hits                  ?     5300           
  Misses                ?     2272           
  Partials              ?      415           
Flag Coverage Δ
go 64.86% <ø> (?)
npm 92.39% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

… template

extraVolumes and extraVolumeMounts were defined in values.yaml but never
referenced by templates/deployment.yaml, making them dead defaults. Add the
standard passthrough (common.tplvalues.render), mirroring the already-working
extraEnvVars pattern. No-op for all current profiles (default []) — enables
mounting a PKCS12 keystore file as a volume for deployments that opt into
KEYMANAGER_KEYSTORE_TYPE: PKCS12 instead of the default PKCS11 setup.

mosip#2333
Signed-off-by: bhumi46 <thisisbn46@gmail.com>
@bhumi46
bhumi46 force-pushed the fix/p12-crypto-secretref branch from b7e4f51 to b840cb8 Compare August 7, 2026 05:19
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

….yaml

Document how to mount a file-based secret (e.g. a PKCS12 keystore) using the
extraVolumes/extraVolumeMounts pair now that they're actually rendered by
templates/deployment.yaml.

mosip#2333
Signed-off-by: bhumi46 <thisisbn46@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helm/esignet/values.yaml`:
- Around line 372-387: Update the commented extraVolumes example near
extraVolumeMounts to document that the esignet-keystore Secret must contain a
data key named esignet.pfx, or add an items mapping that maps this key to
esignet.pfx. Ensure the documented mount produces
/home/mosip/keys/secret/esignet.pfx for the PKCS12 configuration.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b86aa10f-66b9-440e-91c1-2df9adb903d3

📥 Commits

Reviewing files that changed from the base of the PR and between b840cb8 and e19e71c.

📒 Files selected for processing (1)
  • helm/esignet/values.yaml

Comment thread helm/esignet/values.yaml
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: bhumi46 <111699703+bhumi46@users.noreply.github.com>
@bhumi46

bhumi46 commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

As per discussion we don’t this changes hence closing

@bhumi46 bhumi46 closed this Oct 8, 2026
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