当前位置:网站首页>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
边栏推荐
- 为什么要分库分表?
- 架构实战营模块8消息队列表结构设计
- UnityShader入门学习(三)——Unity的Shader
- MySQL [aggregate function]
- For enterprises in the digital age, data governance is difficult, but it should be done
- Tortoise speed by "template"
- 线程池的使用二
- Introduction to BigDecimal, common methods
- 我把问烂了的MySQL面试题总结了一下
- In the future, the interviewer asks you why it is not recommended to use Select *, please answer him out loud!
猜你喜欢
Resnet&API
海康摄像机取流RTSP地址规则说明
Redis与分布式:哨兵模式
Open Inventor 10.12 Major Improvements - Harmony Edition
The 232-layer 3D flash memory chip is here: the single-chip capacity is 2TB, and the transmission speed is increased by 50%
MySQL玩到这种程度,难怪大厂抢着要!
新款现代帕里斯帝预售开启,安全、舒适一个不落
DELL SC compellent 康贝存储系统怎么抓取配置信息
Message queue data storage MySQL table design
Open Inventor 10.12 重大改进--和谐版
随机推荐
Nuget package and upload tutorial
The 232-layer 3D flash memory chip is here: the single-chip capacity is 2TB, and the transmission speed is increased by 50%
Spark学习(2)-Spark环境搭建-Local
leetcode: 485. Maximum number of consecutive 1s
A detailed guide to simulating latency with SQL/JDBC
Recommendation System - Recall Phase - 2013: DSSM (Twin Towers Model) [Embedding (Semantic Vector) Recall] [Microsoft]
线程池的使用二
Five dimensions to start MySQL optimization
尚硅谷-JVM-内存和垃圾回收篇(P1~P203)
小试牛刀:Go 反射帮我把 Excel 转成 Struct
动作捕捉系统用于柔性机械臂的末端定位控制
Redis与分布式:哨兵模式
【Pytorch】torch.argmax()用法
The use of thread pool two
Shell project combat 1. System performance analysis
UnityShader入门学习(三)——Unity的Shader
Groupid(artifact id)
jvm 一之 类加载器
UnityShader入门学习(一)——GPU与Shader
Sentinel安装与部署