当前位置:网站首页>OpenShift 4 - Customize RHACS security policies to prevent production clusters from using high-risk registry
OpenShift 4 - Customize RHACS security policies to prevent production clusters from using high-risk registry
2022-07-31 14:26:00 【dawnsky.liu】
《OpenShift 4.x HOL教程汇总》
说明:本文已经在OpenShift 4.10 / RHACS 3.71环境中验证
ACS Security policy scenarios
在 RHACS Security policy of the rich,Can help users to realize from the mirror to the container、From the network to the host operating system and so on various aspects of the security check.Users can also be customized personalized strategy to implement features security inspection requirements.
This example will create a custom security strategy,The strategy for “生产集群” ,It does not allow deployment in a production environment from security risk docker.io 的容器镜像.
创建 ACS 安全策略
- 进入 RHACS 的 Platform Configuration -> Policy Management 菜单,然后点击 Create Policy 按钮.
- 在 Create policy 页面中的 Policy details Offer the following configuration steps,然后点击 Next.
Name:Image Policy - Production
Severity:Medium
Categories:Production
Description:In a production environment from docker.io 的镜像
Rationale:In a production environment using from docker.io A mirror image of the safety risk is higher
Guidance:Cannot be used in a production environment from docker.io 的镜像 - 在 Create policy 页面中的 Policy behavior Offer the following configuration steps,然后点击 Next.
Lifecycle stages:Deploy
Response method:Inform and enforce
Deploy:Enforce on Deploy
- 在 Create policy 页面中的 Policy criteria Steps will be on the right side of the Image registry 拖拽到 Drop a policy field inside,And then fill in the below docker.io.进行点击 Next.

- 在 Create policy 页面中的 Policy scope Steps in the open Add inclusion scope,在 Cluster Choose the need to protect OpenShift 集群.然后点击 Next.

- 在最后一步中 Save 即可.
Deployment tests the mirror
- 在 OpenShift 控制台中使用 “导入 YAML” Function to create the following Deployment,其中使用了 docker.io/openshift/hello-openshift 镜像.
kind: Deployment
apiVersion: apps/v1
metadata:
name: hello-openshift
labels:
app: hello-openshift
app.kubernetes.io/name: hello-openshift
app.kubernetes.io/part-of: hello-openshift-app
spec:
replicas: 1
selector:
matchLabels:
app: hello-openshift
template:
metadata:
labels:
app: hello-openshift
spec:
containers:
- name: hello-openshift
image: docker.io/openshift/hello-openshift
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8888
protocol: TCP
- Confirm the following error message is.

- 将镜像换成 quay.io/dawnskyliu/hello-openshift 后重新创建 Deployment,Confirm can successfully create.
kind: Deployment
apiVersion: apps/v1
metadata:
name: hello-openshift
labels:
app: hello-openshift
app.kubernetes.io/name: hello-openshift
app.kubernetes.io/part-of: hello-openshift-app
spec:
replicas: 1
selector:
matchLabels:
app: hello-openshift
template:
metadata:
labels:
app: hello-openshift
spec:
containers:
- name: hello-openshift
image: quay.io/dawnskyliu/hello-openshift
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8888
protocol: TCP
参考
https://docs.openshift.com/acs/3.71/operating/manage-security-policies.html
边栏推荐
- 1-hour live broadcast recruitment order: industry leaders share dry goods, and enterprise registration is open丨qubit · point of view
- ML, DL, CV common problems sorting
- Spark学习(2)-Spark环境搭建-Local
- Analysis of the startup source code of hyperf (2) - how the request reaches the controller
- Prometheus之node_exporter性能监控信息采集含义
- The recently popular domestic interface artifact Apipost experience
- Sentinel热点参数限流
- Miller_Rabin Miller Rabin probability sieve [template]
- UnityShader入门学习(二)——渲染流水线
- Shell项目实战1.系统性能分析
猜你喜欢

Miller_Rabin 米勒拉宾概率筛【模板】

消息队列消息数据存储MySQL表设计

49.【拷贝构造函数与重载】

OpenShift 4 - 定制 RHACS 安全策略,阻断生产集群使用高风险 Registry

为什么要分库分表?

Uniapp WeChat small application reference standard components

MySQL 23道经典面试吊打面试官

The paper manual becomes 3D animation in seconds, the latest research of Wu Jiajun of Stanford University, selected for ECCV 2022

Sentinel流量控制

AWS实现定时任务-Lambda+EventBridge
随机推荐
OAuth2:资源服务器
c语言hello world代码(代码编程入门)
最近很火的国产接口神器Apipost体验
Sentinel热点参数限流
【Pytorch】F.softmax()方法说明
leetcode:2032. Values that appear in at least two arrays
Resolved (pymysqL connect to the database error) pymysqL. Err. ProgrammingError: (1146, "Table" test. Students' doesn 't exist ")
MySQL 23道经典面试吊打面试官
Shang Silicon Valley-JVM-Memory and Garbage Collection (P1~P203)
【蓝桥杯选拔赛真题46】Scratch磁铁游戏 少儿编程scratch蓝桥杯选拔赛真题讲解
UnityShader入门学习(一)——GPU与Shader
[QNX Hypervisor 2.2 User Manual] 9.13 rom
1小时直播招募令:行业大咖干货分享,企业报名开启丨量子位·视点
49. The copy constructor and overloaded 】
232层3D闪存芯片来了:单片容量2TB,传输速度提高50%
49.【拷贝构造函数与重载】
Selenium自动化测试之Selenium IDE
C语言基础练(九九乘法表)与打印不同星号图案
[QNX Hypervisor 2.2用户手册]9.13 rom
LeetCode·每日一题·1161.最大层内元素和·层次遍历