当前位置:网站首页>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
边栏推荐
- OAuth2:微服务权限校验Session共享
- C language basic practice (nine-nine multiplication table) and printing different asterisk patterns
- leetcode:2032. 至少在两个数组中出现的值
- Introduction to BigDecimal, common methods
- Shell项目实战1.系统性能分析
- DELL SC compellent 康贝存储系统怎么抓取配置信息
- Node version switching management using NVM
- UnityShader入门学习(二)——渲染流水线
- LeetCode·304竞赛·6132·使数组中所有元素都等于零·模拟·哈希
- leetcode: 485. Maximum number of consecutive 1s
猜你喜欢
随机推荐
leetcode:2032. Values that appear in at least two arrays
Nuget打包并上传教程
The use of thread pool two
Resnet&API
DeepLab系列学习
ERROR: Failed building wheel for osgeo
1-hour live broadcast recruitment order: industry leaders share dry goods, and enterprise registration is open丨qubit · point of view
NPM Taobao mirror (latest version) released a new version of npm mirror at 2021-11-21 16:53:52 [easy to understand]
ERROR: Failed building wheel for osgeo
NPM淘宝镜像(最新版本)于2021-11-21 16:53:52发布新版本npm镜像[通俗易懂]
A detailed guide to simulating latency with SQL/JDBC
The recently popular domestic interface artifact Apipost experience
常用工具命令速查表
为什么要分库分表?
Asynchronous processing business using CompletableFuture
redhat/openssl generates a self-signed ca certificate and uses it
Sentinel热点参数限流
什么是消息队列呢?
Recommendation System - Recall Phase - 2013: DSSM (Twin Towers Model) [Embedding (Semantic Vector) Recall] [Microsoft]
一篇文章讲清楚!数据库和数据仓库到底有什么区别和联系?


![MySQL [subquery]](/img/0b/9bbf54c500d85976e6d6776b6c6f13.png)






