-
Notifications
You must be signed in to change notification settings - Fork 709
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
Refactoring: Remove all references to prodtype (code/tests/docs) #11505
Changes from all commits
6d2b34c
eb3a99e
a623596
08d3fb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -518,9 +518,9 @@ the use of unversioned products here (e.g., `rhel` applies to `rhel7`, | |
correct extension for content of that type (e.g., `.sh` for `bash` | ||
content). Further, all of these directories are optional and will only | ||
be searched for content if present. Lastly, the product naming of | ||
content will not override the contents of `platform` or `prodtype` | ||
fields in the content itself (e.g., if `rhel7` is not present in the | ||
`rhel7.xml` OVAL check platform specifier, it will be included in the | ||
content will not override the contents of `platform` field in | ||
the content itself (e.g., if `rhel7` is not present in the `rhel7.xml` | ||
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. this is a great idea for work in future 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. Yep. I cleaned up connections between prodtype and platforms, but kept them out of the scope. It is a zoo there. |
||
OVAL check platform specifier, it will be included in the | ||
build artifacts but later removed because it doesn't match the platform). | ||
This means that any shared (or templated) checks won't be searched if | ||
a product-specific file is present but has the wrong applicability; | ||
|
@@ -542,31 +542,6 @@ For more information about these utilities, please see their help text. | |
To interact with `rule.yml` files and the OVALs inside a rule directory, | ||
the following utilities are provided: | ||
|
||
#### `utils/mod_prodtype.py` | ||
|
||
This utility modifies the prodtype field of rules. It supports several | ||
commands: | ||
|
||
- `mod_prodtype.py <rule_id> list` - list the computed and actual | ||
prodtype of the rule specified by `rule_id`. | ||
|
||
- `mod_prodtype.py <rule_id> add <product> [<product> ...]` - add | ||
additional products to the prodtype of the rule specified by | ||
`rule_id`. | ||
|
||
- `mod_prodtype.py <rule_id> remove <product> [<product> ...]` - | ||
remove products to the prodtype of the rule specified by `rule_id`. | ||
|
||
- `mod_prodtype.py <rule_id> replace <replacement> [<replacement> ...]` - | ||
do the specified replacement transformations. A replacement | ||
transformation is of the form `match~replace` where `match` and | ||
`replace` are a comma separated list of products. If all of the | ||
products in `match` exist in the original `prodtype` of the rule, | ||
they are removed and the products in `replace` are added. | ||
|
||
This utility requires an up to date JSON tree created by | ||
`rule_dir_json.py`. | ||
|
||
#### `utils/mod_checks.py` | ||
|
||
This utility modifies the `<affected>` element of an OVAL check. It | ||
|
@@ -597,8 +572,10 @@ OVAL with the following commands: | |
|
||
- `mod_checks.py <rule_id> replace <replacement> [<replacement ...]` - | ||
do the specified replacement against the platforms in the shared | ||
OVAL. See the description of `replace` under `mod_prodtype.py` for | ||
more information about the format of a replacement. | ||
OVAL. A replacement transformation is of the form `match~replace` | ||
where `match` and `replace` are a comma separated list of products. | ||
If all of the platforms in `match` exist in the original `platform` | ||
of the rule, they are removed and the platforms in `replace` are added. | ||
|
||
This utility requires an up to date JSON tree created by | ||
`rule_dir_json.py`. | ||
|
@@ -634,7 +611,7 @@ fixes with the following commands: | |
|
||
- `mod_fixes.py <rule_id> <lang> replace <replacement> [<replacement ...]` - | ||
do the specified replacement against the platforms in the shared | ||
fix. See the description of `replace` under `mod_prodtype.py` for | ||
fix. See the description of `replace` under `mod_checks.py` for | ||
more information about the format of a replacement. | ||
|
||
This utility requires an up-to-date JSON tree created by | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ description: |- | |
rationale: |- | ||
These settings configure the firewall to allow connections to an FTP server. | ||
|
||
{{% if prodtype != "rhel7" %}} | ||
{{% if product != "rhel7" %}} | ||
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. There never was a Jinja variable named Also, it might be that the author (@cipherboy) actually meant to do the opposite. I'm not sure. 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. \o hello @evgenyz -- Good question! It has been so long, I do not know. Likely I made a mistake and expected the build system to catch it... |
||
The first line allows initial connections to the FTP server port. | ||
FTP is an older protocol which is not very compatible with firewalls. During the initial FTP dialogue, the client | ||
and server negotiate an arbitrary port to be used for data transfer. The <tt>ip_conntrack_ftp</tt> module is used by | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,10 +48,10 @@ template: | |
vars: | ||
servicename: ntp | ||
|
||
{{% if prodtype in ["rhel7", "rhel8", "rhel9", "sle15"] %}} | ||
{{% if product in ["rhel7", "rhel8", "rhel9", "sle15"] %}} | ||
warnings: | ||
- general: | ||
{{% if prodtype == "rhel7" %}} | ||
{{% if product == "rhel7" %}} | ||
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. There never was a Jinja variable named |
||
The <pre>ntp.service</pre> Systemd unit is not available in {{{ | ||
full_name }}}. <pre>ntpd.service</pre> should be used instead together with the respective <pre>service_ntpd_enabled</pre> rule.. | ||
{{% else %}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ template: | |
|
||
platform: package[ntp] | ||
|
||
{{% if prodtype in ["rhel8", "rhel9", "sle15"] %}} | ||
{{% if product in ["rhel8", "rhel9", "sle15"] %}} | ||
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. There never was a Jinja variable named |
||
warnings: | ||
- general: | ||
The <pre>ntp</pre> package is not available in {{{ full_name }}}. Please | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,9 @@ template: | |
pkgname@ubuntu1804: audispd-plugins | ||
pkgname@ubuntu2004: audispd-plugins | ||
|
||
{{% if prodtype in ["rhel7", "rhel8", "rhel9"] %}} | ||
{{% if product in ["rhel7", "rhel8", "rhel9"] %}} | ||
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. There never was a Jinja variable named |
||
warnings: | ||
- general: | ||
This package is not available in {{{ full_name }}}. The correct package | ||
is called <pre>audispd-plugins</pre>. The rule <pre> is suggested as a replacement. | ||
This package is not available in {{{ full_name }}} [{{{ product }}}]. The correct package | ||
is called <pre>audispd-plugins</pre>. | ||
{{% endif %}} |
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.
Here I would remove only "despite its prodtype".You can still use Jinja macros inside controls file to choose products in which the rule should appear. For example, you can add this to a control file:
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.
Fixed.