Skip to content

Don't log VNC password in VirtualMachineTO#7291

Merged
DaanHoogland merged 1 commit intoapache:mainfrom
mlsorensen:vnc-passwd-no-log
Mar 3, 2023
Merged

Don't log VNC password in VirtualMachineTO#7291
DaanHoogland merged 1 commit intoapache:mainfrom
mlsorensen:vnc-passwd-no-log

Conversation

@mlsorensen
Copy link
Copy Markdown
Contributor

Description

This PR turns logging off for the VNC password on VirtualMachineTO

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Signed-off-by: Marcus Sorensen <mls@apple.com>
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 25, 2023

Codecov Report

Merging #7291 (b4bc13f) into main (eef63d9) will increase coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #7291      +/-   ##
============================================
+ Coverage     12.67%   12.69%   +0.01%     
- Complexity     8641     8655      +14     
============================================
  Files          2716     2716              
  Lines        256112   256117       +5     
  Branches      39926    39927       +1     
============================================
+ Hits          32461    32503      +42     
+ Misses       219522   219482      -40     
- Partials       4129     4132       +3     
Impacted Files Coverage Δ
...ervisor/kvm/resource/LibvirtComputingResource.java 18.30% <ø> (-0.04%) ⬇️
...src/main/java/com/cloud/upgrade/GuestOsMapper.java 5.10% <0.00%> (-0.28%) ⬇️
...ava/com/cloud/upgrade/dao/Upgrade41720to41800.java 0.85% <0.00%> (ø)
...udstack/api/response/QuotaResponseBuilderImpl.java 39.05% <0.00%> (+5.22%) ⬆️
.../cloudstack/api/response/QuotaSummaryResponse.java 67.56% <0.00%> (+67.56%) ⬆️

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

@harikrishna-patnala
Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@harikrishna-patnala 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 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5657

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

Copy link
Copy Markdown
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

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

Code lgtm

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Feb 27, 2023

@blueorangutan test

@yadvr yadvr added this to the 4.18.1.0 milestone Feb 27, 2023
@blueorangutan
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@blueorangutan
Copy link
Copy Markdown

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

Test Result Time (s) Test File
test_01_redundant_vpc_site2site_vpn Failure 378.58 test_vpc_vpn.py

Copy link
Copy Markdown
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

@weizhouapache
Copy link
Copy Markdown
Member

I checked the management-server.log in the trillian test results . there is no vncPassword in the log .
I think we are good to merge this. cc @DaanHoogland

  1. In my testing without this change, found vncPassword in the logs of StartCommand and StartAnswer
root@ref-trl-3836-k-Mu22-wei-zhou-mgmt1:~# zgrep vncPassword /var/log/cloudstack/management/management-server.log.2023-03-01.gz |wc -l
10
  1. in the trillian test results, no vncPassword is found
$ grep vncPassword management-server.log |wc -l
0

@borisstoyanov
Copy link
Copy Markdown
Contributor

@kiranchavala can you prioritize this please

@kiranchavala
Copy link
Copy Markdown
Member

kiranchavala commented Mar 2, 2023

@borisstoyanov @DaanHoogland

Tested this LGTM

on 4.17.2 build

There is vncPassword parameter getting passed to the vm when it starts up

grep "vncPassword" /var/log/cloudstack/management/management-server.log

vncPassword :3a54p4tPNbDxy**5JN9FtmMQ

2023-03-02 11:28:58,873 DEBUG [c.c.a.t.Request] (AgentManager-Handler-20:null) (logid:) Seq 2-7958142016540377725: Processing: { Ans: , MgmtId: 32986993000843, via: 2, Ver: v1, Flags: 10, [{"com.cloud.agent.api.StartAnswer":{"vm":{"id":"3","name":"i-2-3-VM","state":"Starting","type":"User","cpus":"1","minSpeed":"250","maxSpeed":"500","minRam":"(512.00 MB) 536870912","maxRam":"(512.00 MB) 536870912","arch":"x86_64","os":"CentOS 5.5 (64-bit)","platformEmulator":"CentOS 5.5","bootArgs":"","enableHA":"false","limitCpuUse":"false","enableDynamicallyScaleVm":"false","vncPassword":"3a54p4tPNbDxy5JN9FtmMQ","vncAddr":"10.0.32.176","params":{"deployvm":"true","cpuOvercommitRatio":"2.0","m


or Pr-7291 build ,

There is no " vncPassword " parameter getting passed to the vm when it starts up

2023-03-02 12:10:42,413 DEBUG [c.c.a.t.Request] (AgentManager-Handler-15:null) (logid:) Seq 1-1401463909042356305: Processing: { Ans: , MgmtId: 32989408919868, via: 1, Ver: v1, Flags: 10, [{"com.cloud.agent.api.StartAnswer":{"vm":{"id":"3","name":"i-2-3-VM","state":"Starting","type":"User","cpus":"1","minSpeed":"250","maxSpeed":"500","minRam":"(512.00 MB) 536870912","maxRam":"(512.00 MB) 536870912","arch":"x86_64","os":"CentOS 5.5 (64-bit)","platformEmulator":"CentOS 5.5","bootArgs":"","enableHA":"false","limitCpuUse":"false","enableDynamicallyScaleVm":"false","vncAddr":"10.0.32.168","params":{"cpuOvercommitRatio":"2.0","memoryOvercommitRatio":"1.0","Message.ReservedCapacityFreed.Flag":"false"},"uuid":"c977c7bc-21c0-4795-bfe2-4f9fd0d2b989","enterHardwareSetup":"false","disks":[{"data":{"org.apache.cloudstack.storage.to.VolumeObjectTO":{"uuid":"75e12f98-2e34-43dd-903d-2574fc008549","volumeType":"ROOT","dataStore":{"org.apache.cloudstack.storage.to.PrimaryDataStoreTO":{"uuid":"33be8404-a958-303b-b44c-c867bd508902","name":"pr7291-t6256-kvm-centos7-kvm-pri2","id":"2","poolType":"NetworkFilesystem","host":"10.0.32.4","path":"/acs/primary/pr7291-t6256-kvm-centos7/pr7291-t6256-kvm-centos7-kvm-pri2","port":"2049","url":"NetworkFilesystem://10.0.32.4/acs/primary/pr7291-t6256-kvm-centos7/pr7291-t6256-

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-6255)
Environment: kvm-centos7 (x1), Advanced Networking with Mgmt server 7
Total time taken: 36257 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7291-t6255-kvm-centos7.zip
Smoke tests completed. 103 look OK, 5 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_DeployVmAntiAffinityGroup Error 35.53 test_affinity_groups.py
test_DeployVmAntiAffinityGroup_in_project Error 77.49 test_affinity_groups_projects.py
test_03_deploy_and_scale_kubernetes_cluster Failure 23.71 test_kubernetes_clusters.py
test_07_deploy_kubernetes_ha_cluster Failure 0.06 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 0.05 test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_cluster Failure 0.04 test_kubernetes_clusters.py
test_01_non_strict_host_anti_affinity Failure 111.90 test_nonstrict_affinity_group.py
test_02_non_strict_host_affinity Error 80.20 test_nonstrict_affinity_group.py
test_hostha_enable_ha_when_host_in_maintenance Error 304.83 test_hostha_kvm.py

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Mar 3, 2023

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@DaanHoogland DaanHoogland merged commit cb26721 into apache:main Mar 3, 2023
@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-6260)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 40452 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7291-t6260-kvm-centos7.zip
Smoke tests completed. 108 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

Sign up for free to 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.

8 participants