Skip to content

utils: use safer parsing utility across codebase#6562

Merged
yadvr merged 1 commit intoapache:4.17from
shapeblue:safer-xml-parser
Jul 27, 2022
Merged

utils: use safer parsing utility across codebase#6562
yadvr merged 1 commit intoapache:4.17from
shapeblue:safer-xml-parser

Conversation

@yadvr
Copy link
Copy Markdown
Member

@yadvr yadvr commented Jul 21, 2022

This addresses SonarQube/SonarCloud quality checks to use safer xml parser.

https://sonarcloud.io/organizations/apache/rules?open=java%3AS2755&rule_key=java%3AS2755

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)

This addresses SonarQube/SonarCloud quality checks to use safer xml
parser to resist potential XXE attacks.

https://sonarcloud.io/organizations/apache/rules?open=java%3AS2755&rule_key=java%3AS2755

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr yadvr force-pushed the safer-xml-parser branch from 188ede5 to 4a9fa0e Compare July 21, 2022 11:55
@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Jul 21, 2022

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rohityadavcloud 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 3808

@sonarqubecloud
Copy link
Copy Markdown

Please retry analysis of this Pull-Request directly on SonarCloud.

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Jul 21, 2022

@blueorangutan test matrix

@blueorangutan
Copy link
Copy Markdown

@rohityadavcloud a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-4528)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 36964 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6562-t4528-xenserver-71.zip
Smoke tests completed. 100 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-4529)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 38933 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6562-t4529-kvm-centos7.zip
Smoke tests completed. 99 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 859.77 test_kubernetes_clusters.py

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-4530)
Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
Total time taken: 42012 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6562-t4530-vmware-65u2.zip
Smoke tests completed. 99 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 702.28 test_kubernetes_clusters.py

final DocumentBuilderFactory factory = ParserUtils.getSaferDocumentBuilderFactory();
assertTrue(factory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING));
assertTrue(factory.getFeature("http://apache.org/xml/features/disallow-doctype-decl"));
assertFalse(factory.getFeature("http://xml.org/sax/features/external-general-entities"));
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.

can define / use constants for these urls?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll check for ParserUtils but not necessarily the test itself

Copy link
Copy Markdown
Contributor

@sureshanaparti sureshanaparti 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 Author

yadvr commented Jul 22, 2022

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-4532)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43437 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6562-t4532-kvm-centos7.zip
Smoke tests completed. 98 look OK, 2 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 576.91 test_kubernetes_clusters.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 462.22 test_vpc_redundant.py

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Jul 23, 2022

@blueorangutan test centos8 vmware-70u3

@blueorangutan
Copy link
Copy Markdown

@rohityadavcloud unsupported parameters provided. Supported mgmt server os are: centos7, centos6, suse15, alma8, ubuntu18, ubuntu22, ubuntu20, rocky8. Supported hypervisors are: kvm-centos6, kvm-centos7, kvm-rocky8, kvm-alma8, kvm-ubuntu18, kvm-ubuntu20, kvm-ubuntu22, kvm-suse15, vmware-55u3, vmware-60u2, vmware-65u2, vmware-67u3, vmware-70u1, vmware-70u2, vmware-70u3, xenserver-65sp1, xenserver-71, xenserver-74, xcpng74, xcpng76, xcpng80, xcpng81, xcpng82

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Jul 23, 2022

@blueorangutan test rocky8 vmware-70u3

@blueorangutan
Copy link
Copy Markdown

@rohityadavcloud a Trillian-Jenkins test job (rocky8 mgmt + vmware-70u3) has been kicked to run smoke tests

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Jul 23, 2022

@blueorangutan test ubuntu20 xcpng82

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

Trillian Build Failed (tid-4534)

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-4535)
Environment: xcpng82 (x2), Advanced Networking with Mgmt server u20
Total time taken: 50774 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6562-t4535-xcpng82.zip
Smoke tests completed. 97 look OK, 3 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_attach_and_distribute_multiple_volumes Error 16.97 test_attach_multiple_volumes.py
test_attach_multiple_volumes Failure 13.88 test_attach_multiple_volumes.py
test_08_upgrade_kubernetes_ha_cluster Failure 727.28 test_kubernetes_clusters.py
test_12_resize_volume_with_only_size_parameter Error 1.08 test_volumes.py

@shwstppr
Copy link
Copy Markdown
Contributor

Trillian test result (tid-4535) Environment: xcpng82 (x2), Advanced Networking with Mgmt server u20 Total time taken: 50774 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6562-t4535-xcpng82.zip Smoke tests completed. 97 look OK, 3 have errors Only failed tests results shown below:
Test Result Time (s) Test File
test_attach_and_distribute_multiple_volumes Error 16.97 test_attach_multiple_volumes.py
test_attach_multiple_volumes Failure 13.88 test_attach_multiple_volumes.py
test_08_upgrade_kubernetes_ha_cluster Failure 727.28 test_kubernetes_clusters.py
test_12_resize_volume_with_only_size_parameter Error 1.08 test_volumes.py

volumes error not related, #6549 should fix it

Copy link
Copy Markdown
Member

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

LGTM

@yadvr yadvr merged commit 441edf3 into apache:4.17 Jul 27, 2022
neogismm pushed a commit to neogismm/cloudstack that referenced this pull request Aug 6, 2022
This addresses SonarQube/SonarCloud quality checks to use safer xml
parser to resist potential XXE attacks.

https://sonarcloud.io/organizations/apache/rules?open=java%3AS2755&rule_key=java%3AS2755

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
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.

5 participants