Skip to content

Commit 771a4dc

Browse files
authored
Merge pull request #86603 from sr1kar99/2004-telco-sec-doc
TELCODOCS#2004: Day 2 Operations - Security Doc
2 parents 373d726 + 7d8b86f commit 771a4dc

21 files changed

+525
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3475,6 +3475,15 @@ Topics:
34753475
Topics:
34763476
- Name: Observability in OpenShift Container Platform
34773477
File: telco-observability
3478+
- Name: Security
3479+
Dir: security
3480+
Topics:
3481+
- Name: Security basics
3482+
File: telco-security-basics
3483+
- Name: Host security
3484+
File: telco-security-host-sec
3485+
- Name: Security context constraints
3486+
File: telco-security-sec-context-constraints
34783487
---
34793488
Name: Specialized hardware and driver enablement
34803489
Dir: hardware_enablement
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../_attributes/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../images/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../modules/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../snippets/
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="telco-security-basics"]
3+
= Security basics
4+
include::_attributes/common-attributes.adoc[]
5+
:context: telco-security-basics
6+
7+
toc::[]
8+
9+
Security is a critical component of telecommunications deployments on {product-title}, particularly when running cloud-native network functions (CNFs).
10+
11+
You can enhance security for high-bandwidth network deployments in telecommunications (telco) environments by following key security considerations. By implementing these standards and best practices, you can strengthen security in telco-specific use cases.
12+
13+
include::modules/telco-security-rbac-overview.adoc[leveloffset=+1]
14+
15+
[role="_additional-resources"]
16+
.Additional resources
17+
18+
* xref:../../../authentication/using-rbac.adoc#authorization-overview_using-rbac[Using RBAC to define and apply permissions]
19+
20+
include::modules/telco-security-sec-accounts-overview.adoc[leveloffset=+1]
21+
22+
[role="_additional-resources"]
23+
.Additional resources
24+
25+
* xref:../../../authentication/understanding-and-creating-service-accounts.adoc[Understanding and creating service accounts]
26+
27+
include::modules/telco-security-identity-prov-config.adoc[leveloffset=+1]
28+
29+
[role="_additional-resources"]
30+
.Additional resources
31+
32+
* xref:../../../authentication/understanding-identity-provider.adoc[Understanding identity provider configuration]
33+
34+
include::modules/telco-security-replacing-kubeadmin-user.adoc[leveloffset=+1]
35+
36+
[role="_additional-resources"]
37+
.Additional resources
38+
39+
* xref:../../../authentication/identity_providers/configuring-htpasswd-identity-provider.adoc#identity-provider-htpasswd-about_configuring-htpasswd-identity-provider[About htpasswd authentication]
40+
41+
include::modules/telco-security-sec-considerations-telco.adoc[leveloffset=+1]
42+
43+
include::modules/telco-security-pod-sec-in-kub-and-ocp.adoc[leveloffset=+1]
44+
45+
include::modules/telco-security-key-areas-for-cnf-deploy.adoc[leveloffset=+1]
46+
47+
include::modules/telco-security-infra.adoc[leveloffset=+1]
48+
49+
include::modules/telco-security-lifecycle-mgmnt.adoc[leveloffset=+1]
50+
51+
[role="_additional-resources"]
52+
.Additional resources
53+
54+
xref:../../../edge_computing/day_2_core_cnf_clusters/updating/telco-update-welcome.adoc[Upgrading a telco core CNF clusters]
55+
56+
include::modules/telco-security-evolu-nf-to-cnf.adoc[leveloffset=+1]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="telco-security-host-sec"]
3+
= Host security
4+
include::_attributes/common-attributes.adoc[]
5+
:context: telco-security-host-sec
6+
7+
toc::[]
8+
9+
include::modules/telco-security-rhcos-overview.adoc[leveloffset=+1]
10+
11+
[role="_additional-resources"]
12+
.Additional resources
13+
14+
* xref:../../../architecture/architecture-rhcos.adoc#rhcos-about_architecture-rhcos[About RHCOS]
15+
16+
* xref:../../../architecture/architecture-rhcos.adoc[Red Hat Enterprise Linux CoreOS (RHCOS)].
17+
18+
* xref:../../../edge_computing/day_2_core_cnf_clusters/security/telco-security-host-sec.adoc#telco-security-linux-capabilities-overview_telco-security-host-sec[Linux capabilities].
19+
20+
include::modules/telco-security-command-line-host-access.adoc[leveloffset=+1]
21+
22+
[role="_additional-resources"]
23+
.Additional resources
24+
25+
* xref:../../../support/troubleshooting/investigating-pod-issues.adoc#starting-debug-pods-with-root-access_investigating-pod-issues[Starting debug pods with root access].
26+
27+
include::modules/telco-security-linux-capabilities-overview.adoc[leveloffset=+1]
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="telco-security-sec-context-constraints"]
3+
= Security context constraints
4+
include::_attributes/common-attributes.adoc[]
5+
:context: telco-security-sec-context-constraints
6+
:imagesdir: images
7+
8+
toc::[]
9+
10+
Similar to the way that RBAC resources control user access, administrators can use security context constraints (SCCs) to control permissions for pods. These permissions determine the actions that a pod can perform and what resources it can access. You can use SCCs to define a set of conditions that a pod must run.
11+
12+
Security context constraints allow an administrator to control the following security constraints:
13+
14+
* Whether a pod can run privileged containers with the `allowPrivilegedContainer` flag
15+
* Whether a pod is constrained with the `allowPrivilegeEscalation` flag
16+
* The capabilities that a container can request
17+
* The use of host directories as volumes
18+
* The SELinux context of the container
19+
* The container user ID
20+
* The use of host namespaces and networking
21+
* The allocation of an `FSGroup` that owns the pod volumes
22+
* The configuration of allowable supplemental groups
23+
* Whether a container requires write access to its root file system
24+
* The usage of volume types
25+
* The configuration of allowable `seccomp` profiles
26+
27+
Default SCCs are created during installation and when you install some Operators or other components. As a cluster administrator, you can also create your own SCCs by using the OpenShift CLI (`oc`).
28+
29+
For information about default security context constraints, see xref:../../../authentication/managing-security-context-constraints.adoc#default-sccs_configuring-internal-oauth[Default security context constraints].
30+
31+
[IMPORTANT]
32+
====
33+
Do not modify the default SCCs. Customizing the default SCCs can lead to issues when some of the platform pods deploy or {product-title} is upgraded. Additionally, the default SCC values are reset to the defaults during some cluster upgrades, which discards all customizations to those SCCs.
34+
35+
Instead of modifying the default SCCs, create and modify your own SCCs as needed. For detailed steps, see xref:../../../authentication/managing-security-context-constraints.adoc#security-context-constraints-creating_configuring-internal-oauth[Creating security context constraints].
36+
====
37+
38+
You can use the following basic SCCs:
39+
40+
* `restricted`
41+
* `restricted-v2`
42+
43+
The `restricted-v2` SCC is the most restrictive SCC provided by a new installation and is used by default for authenticated users. It aligns with Pod Security Admission (PSA) restrictions and improves security, as the original `restricted` SCC is less restrictive. It also helps transition from the original SCCs to v2 across multiple releases. Eventually, the original SCCs get deprecated. Therefore, it is recommended to use the `restricted-v2` SCC.
44+
45+
You can examine the `restricted-v2` SCC by running the following command:
46+
[source,terminal]
47+
----
48+
$ oc describe scc restricted-v2
49+
----
50+
.Example output
51+
[source,terminal]
52+
----
53+
Name: restricted-v2
54+
Priority: <none>
55+
Access:
56+
Users: <none>
57+
Groups: <none>
58+
Settings:
59+
Allow Privileged: false
60+
Allow Privilege Escalation: false
61+
Default Add Capabilities: <none>
62+
Required Drop Capabilities: ALL
63+
Allowed Capabilities: NET_BIND_SERVICE
64+
Allowed Seccomp Profiles: runtime/default
65+
Allowed Volume Types: configMap,downwardAPI,emptyDir,ephemeral,persistentVolumeClaim,projected,secret
66+
Allowed Flexvolumes: <all>
67+
Allowed Unsafe Sysctls: <none>
68+
Forbidden Sysctls: <none>
69+
Allow Host Network: false
70+
Allow Host Ports: false
71+
Allow Host PID: false
72+
Allow Host IPC: false
73+
Read Only Root Filesystem: false
74+
Run As User Strategy: MustRunAsRange
75+
UID: <none>
76+
UID Range Min: <none>
77+
UID Range Max: <none>
78+
SELinux Context Strategy: MustRunAs
79+
User: <none>
80+
Role: <none>
81+
Type: <none>
82+
Level: <none>
83+
FSGroup Strategy: MustRunAs
84+
Ranges: <none>
85+
Supplemental Groups Strategy: RunAsAny
86+
Ranges: <none>
87+
----
88+
89+
The `restricted-v2` SCC explicitly denies everything except what it explicitly allows. The following settings define the allowed capabilities and security restrictions:
90+
91+
* Default add capabilities: Set to `<none>`. It means that no capabilities are added to a pod by default.
92+
* Required drop capabilities: Set to `ALL`. This drops all the default Linux capabilities of a pod.
93+
* Allowed capabilities: `NET_BIND_SERVICE`. A pod can request this capability, but it is not added by default.
94+
* Allowed `seccomp` profiles: `runtime/default`.
95+
96+
For more information, see xref:../../../authentication/managing-security-context-constraints.adoc[Managing security context constraints].
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * edge_computing/day_2_core_cnf_clusters/security/telco-security-host-sec.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="telco-security-command-line-host-access_{context}"]
7+
= Command-line host access
8+
9+
Direct access to a host must be restricted to avoid modifying the host or accessing pods that should not be accessed. For users who need direct access to a host, it is recommended to use an external authenticator, like SSSD with LDAP, to manage access. This helps maintain consistency across the cluster through the Machine Config Operator.
10+
11+
[IMPORTANT]
12+
====
13+
Do not configure direct access to the root ID on any {product-title} cluster server.
14+
====
15+
16+
You can connect to a node in the cluster using the following methods:
17+
18+
Using debug pod:: This is the recommended method to access a node. To debug or connect to a node, run the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ oc debug node/<worker_node_name>
23+
----
24+
+
25+
After connecting to the node, run the following command to get access to the root file system:
26+
+
27+
[source,terminal]
28+
----
29+
# chroot /host
30+
----
31+
+
32+
This gives you root access within a debug pod on the node. For more information, see "Starting debug pods with root access".
33+
34+
Direct SSH:: Avoid using the root user. Instead, use the core user ID (or your own ID). To connect to the node using SSH, run the following command:
35+
+
36+
[source,terminal]
37+
----
38+
$ ssh core@<worker_node_name>
39+
----
40+
+
41+
[IMPORTANT]
42+
====
43+
The core user ID is initially given `sudo` privileges within the cluster.
44+
====
45+
+
46+
If you cannot connect to a node using SSH, see link:https://access.redhat.com/solutions/4073041[How to connect to {product-title} 4.x Cluster nodes using SSH bastion pod] to add your SSH key to the core user.
47+
+
48+
After connecting to the node using SSH, run the following command to get access to the root shell:
49+
+
50+
[source,terminal]
51+
----
52+
$ sudo -i
53+
----
54+
55+
Console Access:: Ensure that consoles are secure. Do not allow direct login with the root ID, instead use individual IDs.
56+
+
57+
[NOTE]
58+
====
59+
Follow the best practices of your organization for securing console access.
60+
====
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * edge_computing/day_2_core_cnf_clusters/security/telco-security-basics.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="telco-security-evolution-of-nf-to-cnf_{context}"]
7+
= Evolution of Network Functions to CNFs
8+
9+
Network Functions (NFs) began as Physical Network Functions (PNFs), which were purpose-built hardware devices operating independently. Over time, PNFs evolved into Virtual Network Functions (VNFs), which virtualized their capabilities while controlling resources like CPU, memory, storage, and network.
10+
11+
As technology advanced further, VNFs transitioned to cloud-native network functions (CNFs). CNFs run in lightweight, secure, and scalable containers. They enforce stringent restrictions, including non-root execution and minimal host interference, to enhance security and performance.
12+
13+
PNFs had unrestricted root access to operate independently without interference. With the shift to VNFs, resource usage was controlled, but processes could still run as root within their virtual machines. In contrast, CNFs restrict root access and limit container capabilities to prevent interference with other containers or the host operating system.
14+
15+
The main challenges in migrating to CNFs are as follows:
16+
17+
* Breaking down monolithic network functions into smaller, containerized processes.
18+
* Adhering to cloud-native principles, such as non-root execution and isolation, while maintaining telco-grade performance and reliability.

0 commit comments

Comments
 (0)