Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add products/uos20 to support UnionTech OS Server 20 #8779

Merged
merged 1 commit into from Jun 29, 2022

Conversation

2544246302
Copy link

@2544246302 2544246302 commented May 16, 2022

Description:

  • OpenSCAP now supports many products. UnionTech OS Server 20 is a server operating system based on centos8, So I want to add the product/uosv20 into OpenSCAP.

  • UnionTech OS Server 20 is one of our company's products,You can learn more about our organization from this link :"https://www.uniontech.com" .In addition this URL "https://www.uniontech.com/next/product/server-system?edition=Enterprise" is a detailed description of our product UnionTech OS Server 20.

  • In the future, the PR on openscap will be maintained and updated by members of our security technology department

Rationale:

  • Rationale here. Replace this text. Don't use the italics format!

  • Fixes # Issue number here (e.g. Updating sysctl XCCDF naming #26) or remove this line if no issue exists.

@pep8speaks
Copy link

pep8speaks commented May 16, 2022

Hello @2544246302! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-06-25 18:31:26 UTC

@openshift-ci
Copy link

openshift-ci bot commented May 16, 2022

Hi @2544246302. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label May 16, 2022
@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Open in Gitpod

@Mab879 Mab879 added the New Product Issues or pull requests related to new Products. label May 17, 2022
Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Hello. Thanks for the PR. I made comments throughout the PR that need to be addressed. Most of my comments are related to the alphabetical ordering of uosv20. Also, can you please update the pull request description with more details?

Secondly, I have a question about who should be the authority for this product? We don't want a product in the tree that doesn't have any public maintainers. Please see our governance rules for more details.

<xsl:include href="constants.xslt"/>
<xsl:variable name="overlays" select="document($overlay)/xccdf:overlays" />

</xsl:stylesheet>[
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
</xsl:stylesheet>[
</xsl:stylesheet>

@@ -42,7 +43,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: ./build_product chromium fedora firefox fuse6 rhcos4 rhel7 rhel8 rhel9 sle12 sle15 ubuntu2004
run: ./build_product uosv20 chromium fedora firefox fuse6 rhcos4 rhel7 rhel8 rhel9 sle12 sle15 ubuntu2004
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
run: ./build_product uosv20 chromium fedora firefox fuse6 rhcos4 rhel7 rhel8 rhel9 sle12 sle15 ubuntu2004
run: ./build_product chromium fedora firefox fuse6 rhcos4 rhel7 rhel8 rhel9 sle12 sle15 ubuntu2004 uosv20

@@ -83,6 +84,7 @@ jobs:
- name: Build
run: |-
./build_product \
uosv20 \
chromium \
Copy link
Member

Choose a reason for hiding this comment

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

Please place this in alphabetical order in this list.

@@ -113,6 +115,7 @@ jobs:
- name: Build
run: |-
./build_product \
uosv20 \
Copy link
Member

Choose a reason for hiding this comment

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

Please place this in alphabetical order in this list.

@@ -147,6 +150,7 @@ jobs:
- name: Build
run: |-
./build_product \
uosv20 \
Copy link
Member

Choose a reason for hiding this comment

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

Please place this in alphabetical order in this list.

ssg/constants.py Outdated

MULTI_PLATFORM_MAPPING = {
"multi_platform_uos": ["uosv20"],
Copy link
Member

Choose a reason for hiding this comment

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

Please place this in alphabetical order.

ssg/constants.py Outdated
@@ -426,6 +429,7 @@

# _version_name_map = {
MAKEFILE_ID_TO_PRODUCT_MAP = {
'uos': 'Uniontech OS',
Copy link
Member

Choose a reason for hiding this comment

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

Please place this in alphabetical order.

@@ -12,7 +12,7 @@ def test_is_applicable():

assert not ssg.utils.is_applicable('fedora,multi_platform_ubuntu', 'rhel7')
assert not ssg.utils.is_applicable('ol7', 'rhel7')
assert not ssg.utils.is_applicable('fedora,debian9,debian10,debian11', 'rhel7')
assert not ssg.utils.is_applicable('uosv20,fedora,debian9,debian10,debian11', 'rhel7')
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert not ssg.utils.is_applicable('uosv20,fedora,debian9,debian10,debian11', 'rhel7')
assert not ssg.utils.is_applicable('debian9,debian10,debian11,fedora,uosv20', 'rhel7')

@@ -11,7 +11,7 @@
def _create_profile_cache(ssg_root):
profile_cache = {}

product_list = ['debian9', 'debian10', 'debian11', 'fedora', 'ol7', 'opensuse',
product_list = ['uosv20','debian9', 'debian10', 'debian11', 'fedora', 'ol7', 'opensuse',
Copy link
Member

Choose a reason for hiding this comment

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

Please place uosv20 in alphabetical order.

@@ -11,7 +11,7 @@
def _create_profile_cache(ssg_root):
profile_cache = {}

product_list = ['debian9', 'debian10', 'debian11', 'fedora', 'ol7', 'opensuse',
product_list = ['uosv20','debian9', 'debian10', 'debian11', 'fedora', 'ol7', 'opensuse',
Copy link
Member

Choose a reason for hiding this comment

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

Please place uosv20 in alphabetical order.

@openshift-ci openshift-ci bot added the needs-rebase Used by openshift-ci bot. label Jun 1, 2022
@jan-cerny
Copy link
Collaborator

@2544246302 Please rebase the PR on the top of master branch, resolve the conflicts and address Matthew's comments.

@2544246302 2544246302 changed the title add products/uosv20 to support Uinontech OS V20 add products/uosv20 to support UinonTech OS Server 20 Jun 13, 2022
@2544246302 2544246302 force-pushed the uosv20 branch 2 times, most recently from 389fe41 to 65c84d6 Compare June 13, 2022 12:58
@2544246302 2544246302 changed the title add products/uosv20 to support UinonTech OS Server 20 add products/uosv20 to support UnionTech OS Server 20 Jun 13, 2022
@2544246302
Copy link
Author

Mab879
Mab879 previously requested changes Jun 16, 2022
Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Please rebase on master and check for any build errors, if you have any question we are happy to help. I have left some comments on the first new build errors I encountered.

CMakeLists.txt Outdated
@@ -414,6 +416,8 @@ endif()
if (SSG_PRODUCT_UBUNTU2004)
add_subdirectory("products/ubuntu2004" "ubuntu2004")
endif()
if (SSG_PRODUCT_UOSV20)
add_subdirectory("products/uosv20" "uosv20")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
add_subdirectory("products/uosv20" "uosv20")
add_subdirectory("products/uosv20" "uosv20")
endif()

Copy link
Author

Choose a reason for hiding this comment

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

ok,thanks for your advice.I'm fixing this error.

cpes_root: "../../shared/applicability"
cpes:
- uos:
name: "cpe:/o:uos:uniontech_os:v20"
Copy link
Member

Choose a reason for hiding this comment

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

Invalid YAML, this needs indenting as well.

@@ -0,0 +1,25 @@
product: uosv20
Copy link
Member

Choose a reason for hiding this comment

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

Please use 4 spaces for indention in new YAML files.

@openshift-ci openshift-ci bot removed the needs-rebase Used by openshift-ci bot. label Jun 18, 2022
@2544246302 2544246302 force-pushed the uosv20 branch 5 times, most recently from ff69a69 to 3ce8f2e Compare June 20, 2022 08:57
@@ -267,7 +269,7 @@

MULTI_PLATFORM_LIST = ["rhel", "fedora", "rhv", "debian", "ubuntu",
"wrlinux", "opensuse", "sle", "ol", "ocp", "rhcos",
"example", "eks", "alinux"]
"example", "eks", "alinux", "uos"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

First, your content doesn't build because of this:

[12/18] [uosv20-content] generating ssg-uosv20-cpe-dictionary.xml, ssg-uosv20-cpe-oval.xml
FAILED: ssg-uosv20-cpe-dictionary.xml ssg-uosv20-cpe-oval.xml /home/jcerny/work/git/scap-security-guide/build/ssg-uosv20-cpe-dictionary.xml /home/jcerny/work/git/scap-security-guide/build/ssg-uosv20-cpe-oval.xml 
cd /home/jcerny/work/git/scap-security-guide/build/uosv20 && env PYTHONPATH=/home/jcerny/work/git/scap-security-guide /usr/bin/python3 /home/jcerny/work/git/scap-security-guide/build-scripts/cpe_generate.py --product-yaml /home/jcerny/work/git/scap-security-guide/products/uosv20/product.yml ssg /home/jcerny/work/git/scap-security-guide/build /home/jcerny/work/git/scap-security-guide/build/uosv20/shorthand.xml /home/jcerny/work/git/scap-security-guide/build/uosv20/oval-unlinked.xml && /usr/bin/xmllint --nsclean --format --output /home/jcerny/work/git/scap-security-guide/build/ssg-uosv20-cpe-dictionary.xml /home/jcerny/work/git/scap-security-guide/build/ssg-uosv20-cpe-dictionary.xml && /usr/bin/xmllint --nsclean --format --output /home/jcerny/work/git/scap-security-guide/build/ssg-uosv20-cpe-oval.xml /home/jcerny/work/git/scap-security-guide/build/ssg-uosv20-cpe-oval.xml

	Error: Can't locate "proc_sys_kernel_osrelease_arch_aarch64" definition in "/home/jcerny/work/git/scap-security-guide/build/uosv20/oval-unlinked.xml".             
	Ensure <platform> element is configured properly for "proc_sys_kernel_osrelease_arch_aarch64".              
	Exiting..
[15/18] [uosv20-playbooks] generating Ansible Playbooks for all profiles in ssg-uosv20-xccdf.xml
ninja: build stopped: subcommand failed.

Second, if your product name is uosv20 then you need to put uosv here, not uos. Check the parse_name function in /ssg/utils.py to see how this works. It would probably make sense to rename your product to uos20 instead.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you very much for your help. I discussed with our team according to your suggestions and decided to change our name.

@2544246302 2544246302 force-pushed the uosv20 branch 3 times, most recently from bbe276c to 4e4a5e0 Compare June 21, 2022 10:20
@2544246302 2544246302 changed the title add products/uosv20 to support UnionTech OS Server 20 add products/uos20 to support UnionTech OS Server 20 Jun 21, 2022
@jan-cerny
Copy link
Collaborator

@2544246302 I still experience build problems. Does the uos20 product build correctly for you? It seems that the problem discovered on Monday wasn't the only one ....

[8/18] [uos20-content] linking IDs, generating xccdf-linked.xml, oval-linked.xml, ocil-linked.xml
FAILED: uos20/xccdf-linked.xml uos20/oval-linked.xml uos20/ocil-linked.xml /home/jcerny/work/git/scap-security-guide/build/uos20/xccdf-linked.xml /home/jcerny/work/git/scap-security-guide/build/uos20/oval-linked.xml /home/jcerny/work/git/scap-security-guide/build/uos20/ocil-linked.xml 
cd /home/jcerny/work/git/scap-security-guide/build/uos20 && env PYTHONPATH=/home/jcerny/work/git/scap-security-guide /usr/bin/python3 /home/jcerny/work/git/scap-security-guide/build-scripts/relabel_ids.py /home/jcerny/work/git/scap-security-guide/build/uos20/shorthand.xml /home/jcerny/work/git/scap-security-guide/build/uos20/xccdf-linked.xml ssg
Traceback (most recent call last):
  File "/home/jcerny/work/git/scap-security-guide/build-scripts/relabel_ids.py", line 65, in <module>
    main()
  File "/home/jcerny/work/git/scap-security-guide/build-scripts/relabel_ids.py", line 50, in main
    oval_linker.link()
  File "/home/jcerny/work/git/scap-security-guide/ssg/build_renumber.py", line 127, in link
    self._link_oval_tree()
  File "/home/jcerny/work/git/scap-security-guide/ssg/build_renumber.py", line 151, in _link_oval_tree
    raise RuntimeError("\n".join(msg))
RuntimeError: Following extending definitions are missing:
	'audit_rules_unsuccessful_file_modification_creat' needed by: ['audit_rules_unsuccessful_file_modification']
	'audit_rules_kernel_module_loading_init' needed by: ['audit_rules_kernel_module_loading']
	'package_bind_removed' needed by: ['configure_bind_crypto_policy']
	'package_libreswan_installed' needed by: ['configure_libreswan_crypto_policy']
	'sysctl_kernel_ipv6_disable' needed by: ['sysctl_net_ipv6_conf_all_disable_ipv6', 'sysctl_net_ipv6_conf_default_disable_ipv6']
[9/18] [uos20-content] generating ssg-uos20-cpe-dictionary.xml, ssg-uos20-cpe-oval.xml
ninja: build stopped: subcommand failed.
[jcerny@thinkpad scap-security-guide{pr/8779}]$ 

@2544246302 2544246302 force-pushed the uosv20 branch 8 times, most recently from e580224 to ea39e2d Compare June 25, 2022 18:28
@2544246302
Copy link
Author

@jan-cerny Firstly, thanks very much for your help and concern for the pr that I submitted, and I have now fixed the issue that you mentioned above.Currently in my local can test success,here is the test result.
6 27

Secondly, It still have a problem about the indentation problem in checks about the file https://codeclimate.com/github/ComplianceAsCode/content/ssg/constants.py?from_sha=46faa00b&to_sha=694d667e
I try to increase or reduce indentation but it is still unsolved, now I don't know how to fix it,so I want to ask you for help ,please give me some tips on fixing this problem.Thank you very much!

@codeclimate
Copy link

codeclimate bot commented Jun 27, 2022

Code Climate has analyzed commit 694d667 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Style 1

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 42.7% (0.0% change).

View more on Code Climate.

@jan-cerny jan-cerny self-assigned this Jun 29, 2022
@jan-cerny jan-cerny added this to the 0.1.63 milestone Jun 29, 2022
@jan-cerny jan-cerny dismissed Mab879’s stale review June 29, 2022 08:48

the feedback has been addressed

@jan-cerny jan-cerny merged commit 2a43edc into ComplianceAsCode:master Jun 29, 2022
27 of 28 checks passed
@Mab879 Mab879 added the Highlight This PR/Issue should make it to the featured changelog. label Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Highlight This PR/Issue should make it to the featured changelog. needs-ok-to-test Used by openshift-ci bot. New Product Issues or pull requests related to new Products.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants