ZTP: Add 4.20 hardening YAMLs#193
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sebrandon1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
403957a to
f7dd779
Compare
|
it would be much helpful if you could split the commits, for a starter, I would move the PR msg into the commit it would be nice to have links like |
...ion/extra-manifests-builder/APIServer/75-ocp4-cis-api-server-encryption-provider-cipher.yaml
Show resolved
Hide resolved
| storage: | ||
| files: | ||
| - contents: | ||
| source: data:,-a%20always%2Cexit%20-F%20arch%3Db32%20-S%20chmod%20-F%20auid%3E%3D1000%20-F%20auid%21%3Dunset%20-F%20key%3Dperm_mod%0A-a%20always%2Cexit%20-F%20arch%3Db64%20-S%20chmod%20-F%20auid%3E%3D1000%20-F%20auid%21%3Dunset%20-F%20key%3Dperm_mod%0A |
There was a problem hiding this comment.
can we please keep the human readable format for MCs?
see other MCs in this repo for examples on how to generate them..
There was a problem hiding this comment.
Other entries for this sort of source entry are using base64 encoding such as:
https://github.com/openshift-kni/telco-reference/blob/main/telco-ran/configuration/source-crs/extra-manifest/01-disk-encryption-pcr-rebind-worker.yaml#L19-L20
Should I be using that here as well? As a note, the source line is just straight up copied from the complianceremediation object in OCP so we can modify to whatever we need.
f7dd779 to
410a410
Compare
imiller0
left a comment
There was a problem hiding this comment.
A couple comments on specific files.
More generally, how will these be maintained release-over-release. Is there a way to validate in CI if there are new/changed hardening recommendations?
...-ran/configuration/machineconfigs/sshd/75-rhcos4-e8-master-sshd-disable-empty-passwords.yaml
Outdated
Show resolved
Hide resolved
...ion/extra-manifests-builder/APIServer/75-ocp4-cis-api-server-encryption-provider-cipher.yaml
Show resolved
Hide resolved
2172a8f to
38321ed
Compare
|
I added some README files in this commit that tries to summarize what's going on in the various machine configs. We can still delete/remove any that might be too much of a performance hit/risk. I was also able to do all of the newly created "combo" YAML files with a script based on path. |
fd4c480 to
988b83e
Compare
988b83e to
360f86b
Compare
...n/machineconfigs/misc/75-rhcos4-etc_audit_rules.d_75-audit-sysadmin-actions.rules-combo.yaml
Show resolved
Hide resolved
...n/machineconfigs/misc/75-rhcos4-etc_audit_rules.d_75-audit-sysadmin-actions.rules-combo.yaml
Show resolved
Hide resolved
360f86b to
5075cd3
Compare
|
are we still waiting for review before merge for this one? Just saying Dev Complete is EoW |
|
@mwlinca I'm in touch with our KPI pipeline team to add these MachineConfigs to a potential pipeline to gather quantifiable performance data. |
|
I put up a new PR: #339 with specifically the YAMLs that correspond to The real test will be the |
5075cd3 to
8f449b0
Compare
|
Closing in favor of: #466 |
Proof-of-concept for Telco-RAN hardening and 4.20. Open for all reviews and suggestions. I'm not sure about the "structure" of the folders/YAMLs so if there is something obvious that needs to be changed, we can do so. I am doing everything in this PR via scripting so it can be reproducible and traceable as to what I'm doing to create these YAMLs and where they come from:
https://github.com/sebrandon1/compliance-scripts
I'm using the following scans to test against my 4.20 cluster:
These are from the tutorial of the compliance operator page here.
Questions going forward
What kind of "scan profiles" are we looking to run? I wasn't able to find documentation (maybe I missed it) of what profiles/scans we are supposed to run for this effort.
For the APIServer and Ingress remediations, they seem to be needed to apply on the first boot (or require an entire restart to apply). Don't quote me on this but this is how they are acting when I apply their remediations via the operator or manually.
Naming conventions and layout based on:
openshift-kni/cnf-features-deploy#2147
Changes in the PR
API Server Configuration Updates:
aescbcencryption type for CIS compliance (75-ocp4-cis-api-server-encryption-provider-cipher.yaml) and E8 compliance (75-ocp4-e8-api-server-encryption-provider-cipher.yaml). [1] [2]WriteRequestBodiesfor enhanced logging in the API server (75-ocp4-cis-audit-profile-set.yaml).Ingress Controller Configuration:
TLS 1.2for improved security (75-ocp4-cis-kubelet-configure-tls-cipher-suites-ingresscontroller.yaml).Machine Configuration for Audit Rules:
chmod,chown) to monitor changes to file permissions (75-rhcos4-e8-master-audit-rules-dac-modification-chmod.yaml,75-rhcos4-e8-master-audit-rules-dac-modification-chown.yaml). [1] [2]chcon,restorecon,semanage,setfiles,setsebool,seunshare) to track sensitive operations (75-rhcos4-e8-master-audit-rules-execution-chcon.yaml,75-rhcos4-e8-master-audit-rules-execution-restorecon.yaml,75-rhcos4-e8-master-audit-rules-execution-semanage.yaml,75-rhcos4-e8-master-audit-rules-execution-setfiles.yaml,75-rhcos4-e8-master-audit-rules-execution-setsebool.yaml,75-rhcos4-e8-master-audit-rules-execution-seunshare.yaml). [1] [2] [3] [4] [5] [6]75-rhcos4-e8-master-audit-rules-kernel-module-loading-delete.yaml,75-rhcos4-e8-master-audit-rules-kernel-module-loading-finit.yaml,75-rhcos4-e8-master-audit-rules-kernel-module-loading-init.yaml). [1] [2] [3]faillock,lastlog,tallylog) to monitor authentication-related activities (75-rhcos4-e8-master-audit-rules-login-events-faillock.yaml,75-rhcos4-e8-master-audit-rules-login-events-lastlog.yaml,75-rhcos4-e8-master-audit-rules-login-events-tallylog.yaml). [1] [2] [3]75-rhcos4-e8-master-audit-rules-networkconfig-modification.yaml,75-rhcos4-e8-master-audit-rules-sysadmin-actions.yaml). [1] [2]