Skip to content

Commit aef11e2

Browse files
authored
Merge pull request #23 from edcdavid/add-impact-statement
Add impact statements
2 parents ceacfec + a71d89b commit aef11e2

File tree

43 files changed

+258
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+258
-7
lines changed

Makefile

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Makefile for building Red Hat Best Practices Guide
2+
# Builds both HTML and PDF outputs using containerized build process
3+
4+
# Variables
5+
PODMAN := podman
6+
MAIN_DOC := main.adoc
7+
HTML_TEMPLATE := quay.io/redhat-docs/redhat-docs-template
8+
PDF_TEMPLATE := quay.io/redhat-docs/redhat-docs-pdf-template
9+
ASSETS_DIR := assets
10+
PDF_ASSETS_DIR := pdf-assets
11+
OUTPUT_HTML := index.html
12+
OUTPUT_PDF := main.pdf
13+
14+
# Default target
15+
.PHONY: all
16+
all: html pdf
17+
18+
# Help target
19+
.PHONY: help
20+
help:
21+
@echo "Red Hat Best Practices Guide Build System"
22+
@echo "=========================================="
23+
@echo ""
24+
@echo "Available targets:"
25+
@echo " all - Build both HTML and PDF (default)"
26+
@echo " html - Build HTML output (index.html)"
27+
@echo " pdf - Build PDF output (main.pdf)"
28+
@echo " clean - Remove generated files and assets"
29+
@echo " help - Show this help message"
30+
@echo ""
31+
@echo "Requirements:"
32+
@echo " - podman must be installed and available in PATH"
33+
@echo " - Internet connection for pulling container images"
34+
35+
# Build HTML output
36+
.PHONY: html
37+
html: $(OUTPUT_HTML)
38+
39+
$(OUTPUT_HTML): $(MAIN_DOC) $(ASSETS_DIR)
40+
@echo "Building HTML output..."
41+
$(PODMAN) run --rm -it -v "$(CURDIR)":/docs:Z $(HTML_TEMPLATE) $(MAIN_DOC)
42+
@echo "HTML build complete: $(OUTPUT_HTML)"
43+
44+
# Set up HTML assets
45+
$(ASSETS_DIR):
46+
@echo "Setting up HTML assets..."
47+
$(PODMAN) pull $(HTML_TEMPLATE)
48+
$(PODMAN) cp $$($(PODMAN) run --detach $(HTML_TEMPLATE)):/assets ./$(ASSETS_DIR)
49+
50+
# Build PDF output
51+
.PHONY: pdf
52+
pdf: $(OUTPUT_PDF)
53+
54+
$(OUTPUT_PDF): $(MAIN_DOC) $(PDF_ASSETS_DIR)
55+
@echo "Building PDF output..."
56+
$(PODMAN) run --rm -it -v "$(CURDIR)":/docs:Z $(PDF_TEMPLATE) $(MAIN_DOC)
57+
@echo "PDF build complete: $(OUTPUT_PDF)"
58+
59+
# Set up PDF assets
60+
$(PDF_ASSETS_DIR):
61+
@echo "Setting up PDF assets..."
62+
$(PODMAN) pull $(PDF_TEMPLATE)
63+
$(PODMAN) cp $$($(PODMAN) run --detach $(PDF_TEMPLATE)):/pdf-assets ./$(PDF_ASSETS_DIR)
64+
65+
# Clean generated files
66+
.PHONY: clean
67+
clean:
68+
@echo "Cleaning generated files..."
69+
rm -f $(OUTPUT_HTML) $(OUTPUT_PDF)
70+
rm -rf $(ASSETS_DIR) $(PDF_ASSETS_DIR)
71+
@echo "Clean complete"
72+
73+
# Force rebuild targets
74+
.PHONY: force-html force-pdf
75+
force-html: clean-html html
76+
force-pdf: clean-pdf pdf
77+
78+
# Clean specific outputs
79+
.PHONY: clean-html clean-pdf
80+
clean-html:
81+
rm -f $(OUTPUT_HTML)
82+
rm -rf $(ASSETS_DIR)
83+
84+
clean-pdf:
85+
rm -f $(OUTPUT_PDF)
86+
rm -rf $(PDF_ASSETS_DIR)
87+
88+
# Check if podman is available
89+
.PHONY: check-podman
90+
check-podman:
91+
@which $(PODMAN) > /dev/null || (echo "Error: $(PODMAN) not found. Please install podman." && exit 1)
92+
93+
# Make all build targets depend on podman check
94+
html: check-podman
95+
pdf: check-podman

modules/k8s-best-practices-affinity-anti-affinity.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Pods that need to be co-located on the same node need affinity rules. Pods that
3434
co-located for resiliency purposes require anti-affinity rules.
3535
3636
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#lifecycle-affinity-required-pods[lifecycle-affinity-required-pods]
37+
38+
**Impacts and Risks of Non-Compliance:** Missing affinity rules can cause incorrect pod placement, leading to performance issues and failure to meet co-location requirements.
3739
====
3840

3941
.Workload requirement
@@ -43,5 +45,7 @@ Pods that perform the same microservice and could be disrupted if multiple membe
4345
unavailable must implement affinity/anti-affinity group rules or spread the pods across nodes to prevent disruption in the event of node failures, patches, or upgrades.
4446
4547
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#lifecycle-pod-high-availability[lifecycle-pod-high-availability]
48+
49+
**Impacts and Risks of Non-Compliance:** Missing anti-affinity rules can cause all pod replicas to be scheduled on the same node, creating single points of failure.
4650
====
4751

modules/k8s-best-practices-automount-services-for-pods.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ Pods must include an explicit `serviceAccountName` in the pod spec. This is requ
1818

1919
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#access-control-pod-automount-service-account-token[access-control-pod-automount-service-account-token]
2020

21+
**Impacts and Risks of Non-Compliance:** Auto-mounted service account tokens expose Kubernetes API credentials to application code, creating potential attack vectors if applications are compromised.
22+

modules/k8s-best-practices-avoid-the-host-network-namespace.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ Application pods must avoid using `hostNetwork`. Applications may not use the ho
99
Applications may not use `NodePorts` or the `hostNetwork`.
1010
1111
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#access-control-service-type[access-control-service-type]
12+
13+
**Impacts and Risks of Non-Compliance:** NodePort services expose applications directly on host ports, creating security risks and potential port conflicts with host services.
1214
====

modules/k8s-best-practices-cloud-native-design-best-practices.adoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ A container must provide APIs for the platform to observe the container health a
1212
Lifecycle conformance::
1313
A container must receive important events from the platform and conform/react to these events properly. For example, a container should catch SIGTERM or SIGKILL from the platform and shut down as quickly as possible. Other typically important events from the platform are PostStart to initialize before servicing requests and PreStop to release resources cleanly before shutting down.
1414

15-
See test cases link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#lifecycle-container-shutdown[lifecycle-container-shutdown], link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#lifecycle-container-startup[lifecycle-container-startup]
15+
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#lifecycle-container-poststart[lifecycle-container-poststart]
16+
17+
**Impacts and Risks of Non-Compliance:** Missing PostStart hooks can cause containers to start serving traffic before proper initialization, leading to application errors.
18+
19+
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#lifecycle-container-prestop[lifecycle-container-prestop]
20+
21+
**Impacts and Risks of Non-Compliance:** Missing PreStop hooks can cause ungraceful shutdowns, data loss, and connection drops during container termination.
1622

1723
Image immutability::
1824
Container images are meant to be immutable; i.e. customized images for different environments should typically not be built. Instead, an external means for storing and retrieving configurations that vary across environments for the container should be used. Additionally, the container image should NOT dynamically install additional packages at runtime.

modules/k8s-best-practices-cnf-operator-requirements.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
Operators should be certified against the openshift version of the cluster they will be deployed on.
88
99
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#affiliated-certification-operator-is-certified[affiliated-certification-operator-is-certified]
10+
11+
**Impacts and Risks of Non-Compliance:** Uncertified operators may have security flaws, compatibility issues, and lack enterprise support, creating operational risks.
1012
====
1113

1214
.Workload requirement
@@ -19,6 +21,8 @@ Operators must be compatible with our version of openshift
1921
* See link:https://sdk.operatorframework.io/docs/best-practices/[Redhat Operator SDK & Best Practices], link:https://olm.operatorframework.io/docs/best-practices/[OLM Best Practices]
2022
2123
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#platform-alteration-ocp-lifecycle[platform-alteration-ocp-lifecycle]
24+
25+
**Impacts and Risks of Non-Compliance:** End-of-life OpenShift versions lack security updates and support, creating significant security and operational risks.
2226
====
2327

2428
.Workload requirement
@@ -27,6 +31,8 @@ See test case link:https://github.com/test-network-function/cnf-certification-te
2731
Operators must be in OLM bundle format (Operator Framework).
2832
2933
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#operator-install-source[operator-install-source]
34+
35+
**Impacts and Risks of Non-Compliance:** Non-OLM operators bypass lifecycle management and dependency resolution, creating operational complexity and update issues.
3036
====
3137

3238
.Workload requirement
@@ -47,6 +53,8 @@ All custom resources for operators require podspecs for both pod image override
4753
Operators must not use daemonsets
4854
4955
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#lifecycle-pod-owner-type[lifecycle-pod-owner-type]
56+
57+
**Impacts and Risks of Non-Compliance:** Naked pods and DaemonSets lack proper lifecycle management, making updates, scaling, and recovery operations difficult or impossible.
5058
====
5159

5260
.Workload requirement
@@ -87,6 +95,8 @@ For requesting Global operators (upstream 3rd party shared operators), the opera
8795
Operators that are proprietary to a workload application must ensure that their CRD's are unique, and will not conflict with other operators in the cluster.
8896
8997
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#observability-crd-status[observability-crd-status]
98+
99+
**Impacts and Risks of Non-Compliance:** Missing status subresources prevent proper monitoring and automation based on custom resource states.
90100
====
91101

92102
.Workload requirement
@@ -101,6 +111,8 @@ If a workload application requires a specific version of a third party non-propr
101111
Successful operator installation and runtime must be validated in pre-deployment lab environments before being allowed to be deployed to production.
102112
103113
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#operator-install-status-succeeded[operator-install-status-succeeded]
114+
115+
**Impacts and Risks of Non-Compliance:** Failed operator installations can leave applications in incomplete states, causing functionality gaps and operational issues.
104116
====
105117

106118
.Workload requirement

modules/k8s-best-practices-cnf-securing-cnf-networks.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ Workloads must have the least permissions possible and must implement Network Po
99
Applications must define network policies that permit only the minimum network access the application needs to function.
1010
1111
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#networking-network-policy-deny-all[networking-network-policy-deny-all]
12+
13+
**Impacts and Risks of Non-Compliance:** Without default deny-all network policies, workloads are exposed to lateral movement attacks and unauthorized network access, compromising security posture and potentially enabling data breaches.
1214
====

modules/k8s-best-practices-cnf-security.adoc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ The general guidelines are:
1818
====
1919
Only ask for the necessary privileges and access control settings for your application
2020
21-
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#access-control-security-context-non-root-user-check[access-control-security-context-non-root-user-check]
21+
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#access-control-security-context-non-root-user-id-check[access-control-security-context-non-root-user-id-check]
22+
23+
**Impacts and Risks of Non-Compliance:** Running containers as root increases the blast radius of security vulnerabilities and can lead to full host compromise if containers are breached.
2224
====
2325

2426
.Workload requirement
@@ -28,6 +30,8 @@ If the function required by your workload can be fulfilled by OCP components, yo
2830
requesting escalated privilege to perform this function.
2931
3032
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#access-control-security-context-privilege-escalation[access-control-security-context-privilege-escalation]
33+
34+
**Impacts and Risks of Non-Compliance:** Allowing privilege escalation can lead to containers gaining root access, compromising the security boundary between containers and hosts.
3135
====
3236

3337
.Workload requirement
@@ -37,6 +41,8 @@ Avoid using any host system resource.
3741
3842
See test cases link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#access-control-pod-host-ipc[access-control-pod-host-ipc],
3943
link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#access-control-pod-host-pid[access-control-pod-host-pid]
44+
45+
**Impacts and Risks of Non-Compliance:** Host IPC access allows containers to communicate with host processes, potentially exposing sensitive information and enabling privilege escalation.
4046
====
4147

4248
.Workload requirement
@@ -45,6 +51,8 @@ link:https://github.com/test-network-function/cnf-certification-test/blob/main/C
4551
Do not mount host directories for device access.
4652
4753
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#access-control-pod-host-path[access-control-pod-host-path]
54+
55+
**Impacts and Risks of Non-Compliance:** Host path mounts can expose sensitive host files to containers, enable container escape attacks, and compromise host system integrity.
4856
====
4957

5058
.Workload requirement
@@ -53,6 +61,8 @@ See test case link:https://github.com/test-network-function/cnf-certification-te
5361
Do not use host network namespace.
5462
5563
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#access-control-namespace[access-control-namespace]
64+
65+
**Impacts and Risks of Non-Compliance:** Using inappropriate namespaces can lead to resource conflicts, security boundary violations, and administrative complexity in multi-tenant environments.
5666
====
5767

5868
.Workload requirement
@@ -61,4 +71,6 @@ See test case link:https://github.com/test-network-function/cnf-certification-te
6171
Workloads may not modify the platform in any way.
6272
6373
See test cases link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#platform-alteration-base-image[platform-alteration-base-image], link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#platform-alteration-sysctl-config[platform-alteration-sysctl-config]
74+
75+
**Impacts and Risks of Non-Compliance:** Modified base images can introduce security vulnerabilities, create inconsistent behavior, and violate immutable infrastructure principles.
6476
====

modules/k8s-best-practices-container-runtime.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Images should be OCI compliant. Red Hat recommends that you build images using R
1111
See <<k8s-best-practices-ubi>> for additional information about UBI and support.
1212
1313
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#platform-alteration-isredhat-release[platform-alteration-isredhat-release]
14+
15+
**Impacts and Risks of Non-Compliance:** Non-Red Hat base images may lack security updates, enterprise support, and compliance certifications required for production use.
1416
====
1517

1618
For more information about CRI-O, see the following:

modules/k8s-best-practices-cpu-isolation.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ Device interrupts are load balanced between all isolated and reserved CPUs to av
1111
To use isolated CPUs, specific annotations must be defined in the pod specification.
1212
1313
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#lifecycle-cpu-isolation[lifecycle-cpu-isolation]
14+
15+
**Impacts and Risks of Non-Compliance:** Improper CPU isolation can cause performance interference between workloads and fail to provide guaranteed compute resources.
1416
====
1517

0 commit comments

Comments
 (0)