Skip to content

script: add utility script for viewing/updating config key#13047

Draft
shwstppr wants to merge 2 commits intoapache:mainfrom
shapeblue:util-configkey-script
Draft

script: add utility script for viewing/updating config key#13047
shwstppr wants to merge 2 commits intoapache:mainfrom
shapeblue:util-configkey-script

Conversation

@shwstppr
Copy link
Copy Markdown
Contributor

@shwstppr shwstppr commented Apr 20, 2026

Description

Hidden and Secure config key in CloudStack are encrypted and it could be difficult at times to update Hidden config keys as it needs encrypting the value.
A helper script is being added to facilitate view and update operation for config keys.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

[root@qa3-veeam-int-75570feb-kvm-mgmt1 ~]# ./config-key-util.sh view ldap.bind.password
[INFO] Loaded DB properties from /etc/cloudstack/management/db.properties
[INFO] Connecting to database 'cloud' on localhost:3306 as user 'cloud'
[INFO] Using encryptor version: V2
[INFO] Decrypting db.cloud.encrypt.secret
[INFO] Decrypting database password
[INFO] Reading config key: ldap.bind.password
[INFO] Config value is NULL, using default_value
Config key: ldap.bind.password
Category: Secure
Stored value: NULL
Default value: NULL
Display value: NULL
[root@qa3-veeam-int-75570feb-kvm-mgmt1 ~]# ./config-key-util.sh update ldap.bind.password abcd123
[INFO] Loaded DB properties from /etc/cloudstack/management/db.properties
[INFO] Connecting to database 'cloud' on localhost:3306 as user 'cloud'
[INFO] Using encryptor version: V2
[INFO] Decrypting db.cloud.encrypt.secret
[INFO] Decrypting database password
[INFO] Starting update for config key: ldap.bind.password
[INFO] Config category is: Secure
[INFO] Encrypting new value before storing
[INFO] Updating configuration table
[INFO] Verifying update
Updated config key: ldap.bind.password
Category: Secure
Stored as: encrypted ciphertext
Update successful
[root@qa3-veeam-int-75570feb-kvm-mgmt1 ~]# ./config-key-util.sh view ldap.bind.password
[INFO] Loaded DB properties from /etc/cloudstack/management/db.properties
[INFO] Connecting to database 'cloud' on localhost:3306 as user 'cloud'
[INFO] Using encryptor version: V2
[INFO] Decrypting db.cloud.encrypt.secret
[INFO] Decrypting database password
[INFO] Reading config key: ldap.bind.password
[INFO] Decrypting stored config value for display
Config key: ldap.bind.password
Category: Secure
Stored value: V/Ef4SswvwswSEpgDJmusPzZVd+z9owU2dqI2h7dfQDpGYg=
Default value: NULL
Display value: abcd123

How did you try to break this feature and the system with this change?

Hidden and Secure config key in CloudStack are encrypted and it could be
difficult at times to update Hidden config keys as it needs encrypting
the value.
A helper script is being added to facilitate view adn update operation
for config keys.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.01%. Comparing base (82bfa9f) to head (e56f163).
⚠️ Report is 48 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13047      +/-   ##
============================================
+ Coverage     17.95%   18.01%   +0.06%     
- Complexity    16522    16606      +84     
============================================
  Files          6022     6029       +7     
  Lines        541387   542160     +773     
  Branches      66346    66451     +105     
============================================
+ Hits          97211    97678     +467     
- Misses       433210   433466     +256     
- Partials      10966    11016      +50     
Flag Coverage Δ
uitests 3.52% <ø> (-0.01%) ⬇️
unittests 19.17% <ø> (+0.06%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

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.

1 participant