Skip to content

Add a MRAC preview post#58

Merged
jan-cerny merged 5 commits intoComplianceAsCode:masterfrom
matejak:mrac
Apr 25, 2023
Merged

Add a MRAC preview post#58
jan-cerny merged 5 commits intoComplianceAsCode:masterfrom
matejak:mrac

Conversation

@matejak
Copy link
Copy Markdown
Member

@matejak matejak commented Apr 18, 2023

Add a post that can serve as a teaser, and discussion starter for enhancements that part of the community would like to deliver in order to make the build system more capable/flexible.
The point of the post is to encourage discussion early, and to help to see upcoming PRs (at least we hope that they will come :-) in a greater context.

Comment thread _posts/2023-04-21-mrac.md Outdated

## Approach

If we think in a very simple way, we clearly need to design smart procedures or workflows that recact to changes, so no major brain power is needed to make right decisions.
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.

recact

Copy link
Copy Markdown
Contributor

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

In general, the blog post is difficult to read and understand.

It isn't clear whether it describes existing features or proposes some future features.

Please focus on clarity. You can help yourself by adding specific examples to the text.

Comment thread _posts/2023-04-21-mrac.md
author_url: https://github.com/matejak
---

Our Red Hat group is contemplating the idea of making the content project better equipped to handle changes in component behavior better.
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.

s/component/software/

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.

Software is a too generic term, and I find component fitting.
I have added a description of what a component is, did it help?

Comment thread _posts/2023-04-21-mrac.md Outdated
Comment on lines +36 to +38
In practice, if we don't know at build-time what component will be scanned, we may solve this by having multiple rules ready.
When it comes to the actual scanning, this collection of rules makes sure that the evaluation will be carried out correctly, regardless of what component version is in question.
This could be achieved by set of rules with disjoint applicability, and the recently-introduced CPE Applicability Language helps this.
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.

demonstrate this on an example

Comment thread _posts/2023-04-21-mrac.md Outdated

- Be able to cover a security requirement by multiple rules.

In practice, if we don't know at build-time what component will be scanned, we may solve this by having multiple rules ready.
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.

not ready but having multiple rules where each rule is for a different version of the examined software

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.

reworded (differently), hopefully good enough.

Comment thread _posts/2023-04-21-mrac.md Outdated
Comment on lines +42 to +46
One could split rules by copy-pasting, but it is desirable to minimize the amount of manual operations to the minimum.
At the time of writing this post, creating a new rule involves noticeable boilerplate, and creating an alternative version of a rule requires more effort that necessary.
This has to be reversed - what can be automated should be automated, and the duplication of data has to decrease by applying a more aggressive normal form.
Specifically, references are defined in rule files, while they can also be deduced from controls.
And perhaps there are other examples of redundant data?
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.

Confusing. What are you trying to describe? I would recommend using templates and Jinja macros.

Demonstrate this on an example so that the readers can imagine it.

Comment thread _posts/2023-04-21-mrac.md Outdated
Comment on lines +53 to +55
However, this declarative concept can be extended beyond profile compositions.
We often use constructs s.a. `{{% if product in ("rhel7", "rhel8") %}}` instead of a more generic `{{% if product.prefers_single_file_sshd_configuration %}}` or something analogous.
Designing product properties in a way that is smart, doesn't get in the way and that can be reused in prose, checks and remediations is not trivial.
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.

Please reword it that you recommend using product properties. Please add a working example.

Comment thread _posts/2023-04-21-mrac.md Outdated
Comment on lines +64 to +92
Wouldn't it be nice to have a capability that would allow us to query a component, and we would get change information from the project using an automation?
This can be very difficult to achieve exhaustively, but partial/good enough achievement may be actually doable.
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.

Is this a proposal for a future feature? If yes, introduce it as such and be more specific.

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.

A proposal will be introduced properly in the PR that implements it. This post just aims to shift attention to some gaps in the project, and to potential solutions that nobody knows right now.

Comment thread _posts/2023-04-21-mrac.md

Rules that try to do two things don't sound like a good idea, but if those two things are almost the same, then perhaps it could make sense.
Although CCE identifiers restrict the rule polymorphism significantly, change of component configuration preference could be handled without splitting a rule into two.

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.

example missing

Comment thread _posts/2023-04-21-mrac.md Outdated
Or perhaps you would like to object some of those points?
Then reach out to us on Gitter!

If things go ahead as planned, you may expect pull requests showing up in upcoming months, and we are very much interested in your point of view.
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.

What will these PRs introduce?

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.

Nobody knows now, so we have to wait for them with great anticipation.

@matejak matejak force-pushed the mrac branch 2 times, most recently from 048166f to 301a095 Compare April 20, 2023 15:12
Copy link
Copy Markdown
Contributor

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

I like the improvements from the previous version.

I only have minor style and grammar suggestions.

Comment thread _posts/2023-04-21-mrac.md Outdated
---

Systems that our content aims to harden are very often large collections of separate components whose life cycle is independent from the life cycle of the product that ships them.
For example, the Red Hat Enterprise Linux consists of more than six thousand of such distinct components, although only a fraction of them s.a. OpenSSH, Grub2 and so on is supported by the ComplianceAsCode project.
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.

either such as or and so on but never both

Comment thread _posts/2023-04-21-mrac.md Outdated
Can you think of other ways of bringing declarative principles to the project?


### Be able to track component changes and our reactions to them.
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.

remove the dot

Change "Be able" to "Ability"

Comment thread _posts/2023-04-21-mrac.md Outdated
Comment thread _posts/2023-04-21-mrac.md Outdated

### Multiple rules to address one requirement

In practice, we may not know at build-time what exact version of a component will be scanned, and we may address this uncertainty by having multiple rules prepared to handle this uncertainty.
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.

repeating uncertainity

Comment thread _posts/2023-04-21-mrac.md Outdated
Comment thread _posts/2023-04-21-mrac.md Outdated
Rules that try to do two things don't sound like a good idea, but if those two things are almost the same, then perhaps it could make sense.
Although `CCE` identifiers restrict the scope of rule polymorphism significantly, change of component configuration preference could be handled without splitting a rule into two, polymorphically.

We have some polymorphic rules in our content, but they became polymorphic on their own, the project hasn't helped them with their polymorphism.
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.

little cumbersome

Comment thread _posts/2023-04-21-mrac.md Outdated

Provided examples nicely illustrate the richness of the rule-level polymorphism in the project.
Rules don't advertise that they are polymorphic, and the project doesn't provide them with any specific help with their polymorphism.
Project support for polymorphism of rules could reduce maintenance costs, as polymorphism would become more declarative.
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.

Suggested change
Project support for polymorphism of rules could reduce maintenance costs, as polymorphism would become more declarative.
Adding support for polymorphism of rules could reduce maintenance costs, as polymorphism would become more declarative.

matejak and others added 2 commits April 24, 2023 18:17
@jan-cerny jan-cerny merged commit 4ea0b33 into ComplianceAsCode:master Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants