-
Notifications
You must be signed in to change notification settings - Fork 4
Issue13 #3
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
Open
omok314159
wants to merge
23
commits into
rocky-linux:main
Choose a base branch
from
omok314159:issue13
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7,518
−0
Open
Issue13 #3
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
2516cba
Original work: JGordon
atomicturtle 31015da
Renaming
atomicturtle 4dcbba6
Adding readme
atomicturtle 146d412
Merge pull request #1 from atomicturtle/merge-01
atomicturtle 59e5229
fixing the directory to get current to fix issue of not going to corr…
joshuagordondba d9bee91
Added new usage information and help. In addition I added script vers…
joshuagordondba 1b33aef
Updated Readme to add usage of the RepoName Bash Script
joshuagordondba b7d8487
added sections for each arguement -r is broken and -a is not built
joshuagordondba 2c99ac8
Merge pull request #2 from joshuagordondba/main
atomicturtle b62ea7a
Fixing -a to download all of the repos with the name rhel8 in them. C…
joshuagordondba f85da27
fixing all arguement to work. The script now functions properly as de…
joshuagordondba dd468e1
fixed regression where it would not actually clean the files fixed th…
joshuagordondba 29bffed
Merge pull request #5 from joshuagordondba/main
atomicturtle 3f61962
Minor formatting updates
atomicturtle 28b130f
Merge pull request #6 from atomicturtle/version-01
atomicturtle ab0b4a0
Prepare for ComplianceAsCode mainstream structure #7
bed12e9
Prepare for ComplianceAsCode mainstream structure #7 #8
e4454e7
Merge pull request #8 from omok314159/issue07
atomicturtle bbcb7d4
Fix installed_OS_is_rocky8.xml to check Rocky8
27c8359
Merge pull request #10 from omok314159/issue09
atomicturtle 9368fd3
Fixed issue11 (update contents for ComplianceAsCode 0.1.54).
0cf6f43
Fixed issue 13, such as support 0.1.55 and put pkg_release, pkg_versi…
80c37f5
Fixed issue during make.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # ComplianceAsCode content | ||
|
|
||
| ## What is this? | ||
|
|
||
| This is a content directory for Rocky Linux 8, and several tools for adding rocky8 content as new product for CimplianceAsCode. | ||
|
|
||
| ## What is ComplianceAsCode? | ||
|
|
||
| ComplianceAsCode is upstream for OSS SCAP contents [https://github.com/ComplianceAsCode](https://github.com/ComplianceAsCode). | ||
| ComplianceAsCode content(old name "SCAP content") is including XML files, YAML, and so on for creating SCAP contents such as XCCDF or fixing scritp as BASH, Ansible. | ||
|
|
||
| ## How to develop ComplianceAsCode content? | ||
|
|
||
| See [ComplianceAsCode Developer Guide](https://github.com/ComplianceAsCode/content/blob/master/docs/manual/developer_guide.adoc) in upsteam. | ||
|
|
||
| ## Structure | ||
|
|
||
| Directories as follows | ||
| * content/rocky8 (it is including definition for rocky8 contents) | ||
| * content/shared/checks/oval/installed_OS_is_rocky8.xml (this is working for building OS check contents in XCCDF) | ||
| * tools/ (it is including tool for supporting Rocky8 in ComplianceAsCode content. | ||
|
|
||
| ## How to use | ||
|
|
||
| 1. Git clone ComplianceAsCode content from (Official GitHub)[https://github.com/ComplianceAsCode/content] to your working directory(ex. work). | ||
| 2. cd work/content | ||
| 3. copy content_for_supporting_rocky8 directory from this repo under work/content. (Such as work/content/content_for_supporting_rocky8) | ||
| 4. run ./content_for_supporting_rocky8/tools/add_product_rocky8.sh | ||
|
|
||
| Then you'll be ready to compile Rocky8 contents. | ||
|
|
||
| ## How to build rocky8 contents | ||
|
|
||
| 1. cd to content/build (such as work/content/build) | ||
| 2. run "cmake .." | ||
| 3. run "make -j4 rocky8" | ||
|
|
||
| Then you'll see several xml contents under build directory. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Rocky8 files and tools | ||
| These are files for supporting Rocky8 for ComplianceAsCode content. 'Files' directory contain files for modifying ComplianceAsCode [content](https://github.com/ComplianceAsCode/content). 'Tools' directory contain script for modifying ComplianceAsCode content to support Rocky8. | ||
|
|
||
| ## Rocky8 product information. | ||
| Just for now, we use following Name/Values as Rocky8 product informtation(content/rocky8/product.yml) | ||
|
|
||
| 1. fingerprints vaules. For Redhat, we can check it on [https://access.redhat.com/security/team/key](https://access.redhat.com/security/team/key) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fingerprints values |
||
| ```pkg_release: "PKG_RELASE" | ||
| pkg_version: "PKG_VERSION" | ||
| aux_pkg_release: "AUX_PKG_RELEASE" | ||
| aux_pkg_version: "AUX_PKG_VERSION" | ||
|
|
||
| release_key_fingerprint: "RELEASE_KEY_FINGERPRINT" | ||
| auxiliary_key_fingerprint: "AUXILIARY_KEY_FINGERPRINT" | ||
| ``` | ||
|
|
||
| 2. OVAL Feed URL. If we will use completely same as RHEL8 OVAL, we might not be need to change it. | ||
| ``` | ||
| oval_feed_url: "https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml" | ||
| ``` | ||
|
|
||
| 3. CPE. CPE name is in /etc/os-release and /etc/system-release-cpe. | ||
| ``` | ||
| name: "cpe:/o:rocky:rocky_linux:8" | ||
| ``` | ||
109 changes: 109 additions & 0 deletions
109
ComplianceAsCode/content_for_supporting_rocky8/files/diff_content_for_supporting_rocky8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| diff -Nru content.org/CMakeLists.txt content/CMakeLists.txt | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
| --- content.org/CMakeLists.txt 2021-05-03 07:27:49.961754374 +0900 | ||
| +++ content/CMakeLists.txt 2021-05-03 07:29:29.739430343 +0900 | ||
| @@ -88,6 +88,7 @@ | ||
| option(SSG_PRODUCT_VSEL "If enabled, the McAfee VSEL SCAP content will be built" ${SSG_PRODUCT_DEFAULT}) | ||
| option(SSG_PRODUCT_WRLINUX8 "If enabled, the WRLinux8 SCAP content will be built" ${SSG_PRODUCT_DEFAULT}) | ||
| option(SSG_PRODUCT_WRLINUX1019 "If enabled, the WRLinux1019 SCAP content will be built" ${SSG_PRODUCT_DEFAULT}) | ||
| +option(SSG_PRODUCT_ROCKY8 "If enabled, the ROCKY8 SCAP content will be built" ${SSG_PRODUCT_DEFAULT}) | ||
|
|
||
| option(SSG_CENTOS_DERIVATIVES_ENABLED "If enabled, CentOS derivative content will be built from the RHEL content" TRUE) | ||
| option(SSG_SCIENTIFIC_LINUX_DERIVATIVES_ENABLED "If enabled, Scientific Linux derivative content will be built from the RHEL content" TRUE) | ||
| @@ -277,6 +278,7 @@ | ||
| message(STATUS "McAfee VSEL: ${SSG_PRODUCT_VSEL}") | ||
| message(STATUS "WRLinux 8: ${SSG_PRODUCT_WRLINUX8}") | ||
| message(STATUS "WRLinux 1019: ${SSG_PRODUCT_WRLINUX1019}") | ||
| +message(STATUS "ROCKY 8: ${SSG_PRODUCT_ROCKY8}") | ||
|
|
||
|
|
||
|
|
||
| @@ -399,6 +401,10 @@ | ||
| if (SSG_PRODUCT_WRLINUX1019) | ||
| add_subdirectory("wrlinux1019") | ||
| endif() | ||
| +if (SSG_PRODUCT_ROCKY8) | ||
| + add_subdirectory("rocky8") | ||
| +endif() | ||
| + | ||
|
|
||
| # ZIP only contains source datastreams and kickstarts, people who | ||
| # want sources to build from should get the tarball instead. | ||
| diff -Nru content.org/build_product content/build_product | ||
| --- content.org/build_product 2021-05-03 07:27:50.029755540 +0900 | ||
| +++ content/build_product 2021-05-03 07:29:29.739430343 +0900 | ||
| @@ -295,6 +295,7 @@ | ||
| VSEL | ||
| WRLINUX8 | ||
| WRLINUX1019 | ||
| + ROCKY8 | ||
| ) | ||
|
|
||
| DEFAULT_OVAL_MAJOR_VERSION=5 | ||
| diff -Nru content.org/shared/checks/oval/install_mcafee_hbss.xml content/shared/checks/oval/install_mcafee_hbss.xml | ||
| --- content.org/shared/checks/oval/install_mcafee_hbss.xml 2021-05-03 07:27:50.321760545 +0900 | ||
| +++ content/shared/checks/oval/install_mcafee_hbss.xml 2021-05-03 07:29:57.423884084 +0900 | ||
| @@ -14,6 +14,7 @@ | ||
| <platform>multi_platform_sle</platform> | ||
| <platform>multi_platform_ubuntu</platform> | ||
| <platform>multi_platform_wrlinux</platform> | ||
| + <platform>multi_platform_rocky</platform> | ||
| </affected> | ||
| <description>McAfee Host-Based Intrusion Detection Software (HBSS) software | ||
| should be installed.</description> | ||
| diff -Nru content.org/shared/checks/oval/sysctl_kernel_ipv6_disable.xml content/shared/checks/oval/sysctl_kernel_ipv6_disable.xml | ||
| --- content.org/shared/checks/oval/sysctl_kernel_ipv6_disable.xml 2021-05-03 07:27:50.325760613 +0900 | ||
| +++ content/shared/checks/oval/sysctl_kernel_ipv6_disable.xml 2021-05-03 07:30:19.808247714 +0900 | ||
| @@ -14,6 +14,7 @@ | ||
| <platform>multi_platform_sle</platform> | ||
| <platform>multi_platform_ubuntu</platform> | ||
| <platform>multi_platform_wrlinux</platform> | ||
| + <platform>multi_platform_rocky</platform> | ||
| </affected> | ||
| <description>Disables IPv6 for all network interfaces.</description> | ||
| </metadata> | ||
| diff -Nru content.org/ssg/constants.py content/ssg/constants.py | ||
| --- content.org/ssg/constants.py 2021-05-03 07:27:50.369761368 +0900 | ||
| +++ content/ssg/constants.py 2021-05-03 07:29:29.739430343 +0900 | ||
| @@ -24,7 +24,8 @@ | ||
| 'sle12', 'sle15', | ||
| 'ubuntu1604', 'ubuntu1804', 'ubuntu2004', | ||
| 'vsel', | ||
| - 'wrlinux8', 'wrlinux1019' | ||
| + 'wrlinux8', 'wrlinux1019', | ||
| + 'rocky8' | ||
| ] | ||
|
|
||
| JINJA_MACROS_BASE_DEFINITIONS = os.path.join(os.path.dirname(os.path.dirname( | ||
| @@ -177,6 +178,7 @@ | ||
| "Ubuntu 20.04": "ubuntu2004", | ||
| "WRLinux 8": "wrlinux8", | ||
| "WRLinux 1019": "wrlinux1019", | ||
| + "Rocky Linux 8": "rocky8", | ||
| } | ||
|
|
||
|
|
||
| @@ -191,7 +193,7 @@ | ||
| } | ||
|
|
||
| MULTI_PLATFORM_LIST = ["rhel", "fedora", "rhosp", "rhv", "debian", "ubuntu", | ||
| - "wrlinux", "opensuse", "sle", "ol", "ocp", "rhcos", "example"] | ||
| + "wrlinux", "opensuse", "sle", "ol", "ocp", "rhcos", "rocky", "example"] | ||
|
|
||
| MULTI_PLATFORM_MAPPING = { | ||
| "multi_platform_debian": ["debian9", "debian10"], | ||
| @@ -207,6 +209,7 @@ | ||
| "multi_platform_sle": ["sle12", "sle15"], | ||
| "multi_platform_ubuntu": ["ubuntu1604", "ubuntu1804", "ubuntu2004"], | ||
| "multi_platform_wrlinux": ["wrlinux8", "wrlinux1019"], | ||
| + "multi_platform_wrlinux": ["rocky8"], | ||
| } | ||
|
|
||
| RHEL_CENTOS_CPE_MAPPING = { | ||
| @@ -372,6 +375,7 @@ | ||
| 'ol': 'Oracle Linux', | ||
| 'ocp': 'Red Hat OpenShift Container Platform', | ||
| 'rhcos': 'Red Hat Enterprise Linux CoreOS', | ||
| + 'rocky': 'Rocky Linux', | ||
| } | ||
|
|
||
|
|
||
47 changes: 47 additions & 0 deletions
47
ComplianceAsCode/content_for_supporting_rocky8/files/installed_OS_is_rocky8.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| <def-group> | ||
| <definition class="inventory" | ||
| id="installed_OS_is_rocky8" version="1"> | ||
| <metadata> | ||
| <title>Rocky Linux 8</title> | ||
| <affected family="unix"> | ||
| <platform>multi_platform_all</platform> | ||
| </affected> | ||
| <reference ref_id="cpe:/o:rocky:rocky_linux:8" | ||
| source="CPE" /> | ||
| <description>The operating system installed on the system is | ||
| Rocky Linux 8</description> | ||
| </metadata> | ||
| <criteria operator="AND"> | ||
| <extend_definition comment="Installed OS is part of the Unix family" | ||
| definition_ref="installed_OS_is_part_of_Unix_family" /> | ||
| <criterion comment="OS is Rocky Linux" test_ref="test_rocky8_name" /> | ||
| <criterion comment="OS version is 8" test_ref="test_rocky8_version" /> | ||
| </criteria> | ||
| </definition> | ||
|
|
||
| <ind:textfilecontent54_test check="all" check_existence="at_least_one_exists" comment="Check os-release ID" id="test_rocky8_name" version="1"> | ||
| <ind:object object_ref="obj_name_rocky8" /> | ||
| <ind:state state_ref="state_name_rocky8" /> | ||
| </ind:textfilecontent54_test> | ||
| <ind:textfilecontent54_object id="obj_name_rocky8" version="1" comment="Check os-release ID"> | ||
| <ind:filepath>/etc/os-release</ind:filepath> | ||
| <ind:pattern operation="pattern match">^ID="(\w+)"$</ind:pattern> | ||
| <ind:instance datatype="int">1</ind:instance> | ||
| </ind:textfilecontent54_object> | ||
| <ind:textfilecontent54_state id="state_name_rocky8" version="1"> | ||
| <ind:subexpression>rocky</ind:subexpression> | ||
| </ind:textfilecontent54_state> | ||
|
|
||
| <ind:textfilecontent54_test check="all" comment="Check os-release VERSION_ID" id="test_rocky8_version" version="1"> | ||
| <ind:object object_ref="obj_version_rocky8" /> | ||
| <ind:state state_ref="state_version_rocky8" /> | ||
| </ind:textfilecontent54_test> | ||
| <ind:textfilecontent54_object id="obj_version_rocky8" version="1" comment="Check os-release VERSION_ID"> | ||
| <ind:filepath>/etc/os-release</ind:filepath> | ||
| <ind:pattern operation="pattern match">^VERSION_ID="(\d)"$</ind:pattern> | ||
| <ind:instance datatype="int">1</ind:instance> | ||
| </ind:textfilecontent54_object> | ||
| <ind:textfilecontent54_state id="state_version_rocky8" version="1"> | ||
| <ind:subexpression>8</ind:subexpression> | ||
| </ind:textfilecontent54_state> | ||
| </def-group> |
36 changes: 36 additions & 0 deletions
36
ComplianceAsCode/content_for_supporting_rocky8/files/rocky8/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Sometimes our users will try to do: "cd rocky8; cmake ." That needs to error in a nice way. | ||
| if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") | ||
| message(FATAL_ERROR "cmake has to be used on the root CMakeLists.txt, see the Building ComplianceAsCode section in the Developer Guide!") | ||
| endif() | ||
|
|
||
| set(PRODUCT "rocky8") | ||
| set(DISA_SRG_TYPE "os") | ||
|
|
||
| ssg_build_product(${PRODUCT}) | ||
|
|
||
| ssg_build_html_table_by_ref(${PRODUCT} "nist") | ||
| ssg_build_html_table_by_ref(${PRODUCT} "cui") | ||
| ssg_build_html_table_by_ref(${PRODUCT} "cis") | ||
| ssg_build_html_table_by_ref(${PRODUCT} "pcidss") | ||
| ssg_build_html_table_by_ref(${PRODUCT} "anssi") | ||
|
|
||
| ssg_build_html_nistrefs_table(${PRODUCT} "standard") | ||
| ssg_build_html_nistrefs_table(${PRODUCT} "ospp") | ||
| ssg_build_html_nistrefs_table(${PRODUCT} "stig") | ||
|
|
||
| ssg_build_html_anssirefs_table(${PRODUCT} "bp28_minimal") | ||
| ssg_build_html_anssirefs_table(${PRODUCT} "bp28_intermediary") | ||
| ssg_build_html_anssirefs_table(${PRODUCT} "bp28_enhanced") | ||
| ssg_build_html_anssirefs_table(${PRODUCT} "bp28_high") | ||
|
|
||
| ssg_build_html_cce_table(${PRODUCT}) | ||
|
|
||
| ssg_build_html_srgmap_tables(${PRODUCT} "stig" ${DISA_SRG_TYPE}) | ||
|
|
||
| ssg_build_html_stig_tables(${PRODUCT} "stig") | ||
|
|
||
| #ssg_build_html_stig_tables(${PRODUCT} "ospp") | ||
|
|
||
| #if (SSG_CENTOS_DERIVATIVES_ENABLED) | ||
| # ssg_build_derivative_product(${PRODUCT} "centos" "centos8") | ||
| #endif() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...as new product for ComplianceAsCode.