Skip to content

Normalize encryption on global configurations values - #6812

Merged
DaanHoogland merged 8 commits into
apache:mainfrom
scclouds:normalize-global-configs-non-encryption
Sep 28, 2023
Merged

Normalize encryption on global configurations values#6812
DaanHoogland merged 8 commits into
apache:mainfrom
scclouds:normalize-global-configs-non-encryption

Conversation

@BryanMLima

Copy link
Copy Markdown
Contributor

Description

ACS encrypts the configuration values from accounts and domains, e.g. AccountDetailVO and DomainDetailVO while plain values are stored in the DB on data center and cluster scopes, e.g. DataCenterDetailVO and ClusterDetailVO. However, there are many different configuration values that make no sense to encrypt. The only ones that should be encrypted are in the secure/hidden category. Furthermore, there are use cases when retrieving the value on a DB view is needed, which is impossible with the current process in the account and domain scopes. Moreover, the response while updating a configuration value now returns the encrypted value for the categories mentioned above.

This PR aims to normalize the encryption on these four scopes; for this, all values that are not in the secure/hidden category are not encrypted. Furthermore, an unused mock file was removed due to a requirement to add a mock method to this class that was not even used.

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

Domain details table before changes:
image

Domain details table after changes:
image

Update configuration value response after these changes:
image

These images are just an example, these changes are for all four tables mentioned above.

How Has This Been Tested?

This was tested in a local lab generating a new version for the .deb file of CloudStack. The lab upgraded successfully and the DB script ran smoothly. There were custom configuration values for all four scopes in the DB, the image in the screenshot section presents the result of the upgrade in the domain_details table.

@DaanHooglandDaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks generally good. one concern.

Comment threadserver/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java Outdated
@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6812 (SL-JID-2485)

@codecov

codecovBot commented Oct 11, 2022

Copy link
Copy Markdown

Codecov Report

Merging #6812 (88d32c7) into main (d25521e) will increase coverage by 6.47%.
Report is 6 commits behind head on main.
The diff coverage is 28.57%.

@@ Coverage Diff @@## main #6812 +/- ##
============================================
+ Coverage 22.71% 29.18% +6.47% - Complexity 22296 30425 +8129 
============================================
Files 4966 5100 +134 Lines 336376 358386 +22010 Branches 48340 52310 +3970 ============================================
+ Hits 76416 104608 +28192 + Misses 248869 239406 -9463 - Partials 11091 14372 +3281 
FlagCoverage Δ
simulator-marvin-tests25.20% <28.57%> (+1.01%)⬆️
uitests4.87% <ø> (ø)
unit-tests14.42% <0.00%> (?)

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

Files ChangedCoverage Δ
...src/main/java/com/cloud/domain/DomainDetailVO.java76.92% <ø> (ø)
...ava/com/cloud/upgrade/dao/Upgrade41810to41900.java3.00% <0.00%> (-0.09%)⬇️
.../src/main/java/com/cloud/user/AccountDetailVO.java69.23% <ø> (ø)
.../cloud/utils/crypt/EncryptionSecretKeyChanger.java0.00% <0.00%> (ø)
.../cloud/configuration/ConfigurationManagerImpl.java42.98% <57.14%> (+6.15%)⬆️
...udstack/api/command/admin/config/UpdateCfgCmd.java76.19% <88.23%> (-1.59%)⬇️
...udstack/framework/config/impl/ConfigurationVO.java79.16% <100.00%> (ø)

... and 1267 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

DaanHoogland
DaanHoogland previously approved these changes Oct 12, 2022

@DaanHooglandDaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✔️ el8 ✖️ debian ✔️ suse15. SL-JID 4436

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@sureshanaparti a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Comment threadengine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41710to41800.java Outdated
Comment threadengine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41710to41800.java Outdated
Comment threadengine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41710to41800.java Outdated
Comment threadengine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41710to41800.java Outdated
Comment threadengine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41710to41800.java Outdated
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 4442

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4448

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian Build Failed (tid-5118)

@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6812 (SL-JID-2498)

@BryanMLima

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@BryanMLima a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7088

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test matrix

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SF] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-7707)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43049 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6812-t7707-xenserver-71.zip
Smoke tests completed. 112 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACLFailure428.79test_vpc_redundant.py

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-7709)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 47138 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6812-t7709-kvm-centos7.zip
Smoke tests completed. 110 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_10_reboot_cpvm_forcedError6.25test_ssvm.py
test_08_upgrade_kubernetes_ha_clusterFailure732.28test_kubernetes_clusters.py
test_01_vpc_site2site_vpnError273.77test_vpc_vpn.py

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-7708)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
Total time taken: 73236 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6812-t7708-vmware-67u3.zip
Smoke tests completed. 111 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_list_vms_metrics_adminError3616.48test_metrics_api.py
test_list_vms_metrics_historyError7.72test_metrics_api.py
test_list_volumes_metrics_historyError3616.05test_metrics_api.py
test_01_deploy_vm_on_specific_hostError3602.67test_vm_deployment_planner.py
test_02_deploy_vm_on_specific_clusterError18.72test_vm_deployment_planner.py
test_03_deploy_vm_on_specific_podError3601.80test_vm_deployment_planner.py
test_04_deploy_vm_on_host_override_pod_and_clusterError1.35test_vm_deployment_planner.py
test_05_deploy_vm_on_cluster_override_podError4.40test_vm_deployment_planner.py

@DaanHoogland

Copy link
Copy Markdown
Contributor

insanity:
@blueorangutan test matrix

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SF] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-7714)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 52619 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6812-t7714-xenserver-71.zip
Smoke tests completed. 112 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_01_invalid_upgrade_kubernetes_clusterFailure3611.96test_kubernetes_clusters.py
test_02_upgrade_kubernetes_clusterFailure3604.53test_kubernetes_clusters.py
test_03_deploy_and_scale_kubernetes_clusterFailure0.04test_kubernetes_clusters.py
test_04_autoscale_kubernetes_clusterFailure0.03test_kubernetes_clusters.py
test_05_basic_lifecycle_kubernetes_clusterFailure0.03test_kubernetes_clusters.py
test_06_delete_kubernetes_clusterFailure0.04test_kubernetes_clusters.py
test_07_deploy_kubernetes_ha_clusterFailure0.03test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_clusterFailure0.04test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_clusterFailure0.03test_kubernetes_clusters.py
test_10_vpc_tier_kubernetes_clusterFailure49.75test_kubernetes_clusters.py
test_11_test_unmanaged_cluster_lifecycleError1.22test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardownError70.78test_kubernetes_clusters.py

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-7716)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 56022 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6812-t7716-kvm-centos7.zip
Smoke tests completed. 112 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_01_invalid_upgrade_kubernetes_clusterFailure3612.22test_kubernetes_clusters.py
test_02_upgrade_kubernetes_clusterFailure3621.63test_kubernetes_clusters.py
test_03_deploy_and_scale_kubernetes_clusterFailure0.05test_kubernetes_clusters.py
test_04_autoscale_kubernetes_clusterFailure0.06test_kubernetes_clusters.py
test_05_basic_lifecycle_kubernetes_clusterFailure0.04test_kubernetes_clusters.py
test_06_delete_kubernetes_clusterFailure0.04test_kubernetes_clusters.py
test_07_deploy_kubernetes_ha_clusterFailure0.03test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_clusterFailure0.04test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_clusterFailure0.05test_kubernetes_clusters.py
test_10_vpc_tier_kubernetes_clusterFailure46.71test_kubernetes_clusters.py
test_11_test_unmanaged_cluster_lifecycleError1.21test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardownError54.45test_kubernetes_clusters.py

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-7715)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
Total time taken: 74644 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6812-t7715-vmware-67u3.zip
Smoke tests completed. 110 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_01_snapshot_usageError3603.10test_usage.py
test_02_upgrade_kubernetes_clusterFailure588.89test_kubernetes_clusters.py
test_10_vpc_tier_kubernetes_clusterFailure3735.93test_kubernetes_clusters.py
test_10_vpc_tier_kubernetes_clusterError3736.06test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardownError180.63test_kubernetes_clusters.py
test_01_snapshot_root_diskError361.92test_snapshots.py
test_02_list_snapshots_with_removed_data_storeError64.32test_snapshots.py

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan LLtest rocky8 vmware-67u3

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [LL] Trillian-Jenkins test job (rocky8 mgmt + vmware-67u3) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[LL] Trillian Build Failed (tid-6748)

@blueorangutan

Copy link
Copy Markdown

[LL]Trillian test result (tid-6749)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server a8
Total time taken: 46495 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6812-t6749-vmware-67u3.zip
Smoke tests completed. 113 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File

@DaanHoogland

Copy link
Copy Markdown
Contributor

@weizhouapache@sureshanaparti is this alright in your view now?

@weizhouapache

Copy link
Copy Markdown
Member

@weizhouapache@sureshanaparti is this alright in your view now?

lgtm, not tested.

@DaanHoogland

Copy link
Copy Markdown
Contributor

lgtm, not tested.

ok, I think we need an upgrade test.

@DaanHoogland

Copy link
Copy Markdown
Contributor

Did an upgrade from 4.18.1. I think we must take our chances and deal with whatever... merging

@DaanHoogland
DaanHoogland merged commit ae5dda8 into apache:mainSep 28, 2023
@BryanMLima

Copy link
Copy Markdown
ContributorAuthor

Thanks, @DaanHoogland, though, I was already preparing a cake for the one-year anniversary.
Jokes aside, I will keep an eye in the mailing listing and issues, should a problem related to this PR arises.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@BryanMLima@acs-robot@blueorangutan@DaanHoogland@sureshanaparti@weizhouapache@soreana@RodrigoDLopez@GutoVeronezi@stephankruggg@kiranchavala