<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Antony 筆記：技術原理與實務經驗 – 安全性</title><link>https://blog.kubeantony.com/archive/security/</link><description>Recent content in 安全性 on Antony 筆記：技術原理與實務經驗</description><generator>Hugo -- gohugo.io</generator><language>zh-TW</language><lastBuildDate>Sun, 28 Sep 2025 13:51:06 +0800</lastBuildDate><atom:link href="https://blog.kubeantony.com/archive/security/index.xml" rel="self" type="application/rss+xml"/><item><title>KCSA 真題</title><link>https://blog.kubeantony.com/archive/security/kcsa-%E7%9C%9F%E9%A1%8C/</link><pubDate>Sun, 28 Sep 2025 13:51:06 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/kcsa-%E7%9C%9F%E9%A1%8C/</guid><description>
&lt;h2&gt;Question #1&lt;span class="hx:absolute hx:-mt-20" id="question-1"&gt;&lt;/span&gt;
&lt;a href="#question-1" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is Grafana?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. A cloud-native distributed tracing system for monitoring microservices architectures.
B. A container orchestration platform for managing and scaling applications.
C. A platform for monitoring and visualizing time-series data.
D. A cloud-native security tool for scanning and detecting vulnerabilities in Kubernetes clusters.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #2&lt;span class="hx:absolute hx:-mt-20" id="question-2"&gt;&lt;/span&gt;
&lt;a href="#question-2" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which step would give an attacker a foothold in a cluster but no long term persistence?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Modify file on host filesystem.
B. Create restarting container on host using Docker.
C. Modify Kubernetes objects stored within etcd.
D. Starting a process in a running container.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #3&lt;span class="hx:absolute hx:-mt-20" id="question-3"&gt;&lt;/span&gt;
&lt;a href="#question-3" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the reasoning behind considering the Cloud as the trusted computing base of a Kubernetes cluster?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. A vulnerability in the Cloud layer has a negligible impact on containers due to Linux isolation mechanisms.
B. A Kubernetes cluster can only be trusted if the underlying Cloud provider is certified against international standards.
C. A Kubernetes cluster can only be as secure as the security posture of its Cloud hosting.
D. The Cloud enforces security controls at the Kubernetes cluster level, so application developers can focus on applications only.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #4&lt;span class="hx:absolute hx:-mt-20" id="question-4"&gt;&lt;/span&gt;
&lt;a href="#question-4" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;By default, in a Kubeadm cluster, which authentication methods are enabled?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. OIDC, Bootstrap tokens, and Service Account Tokens&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;B. X509 Client Certs, Bootstrap Tokens, and Service Account Tokens&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;C. X509 Client Certs, OIDC, and Service Account Tokens&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;D. X509 Client Certs, Webhook Authentication, and Service Account Tokens&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #5&lt;span class="hx:absolute hx:-mt-20" id="question-5"&gt;&lt;/span&gt;
&lt;a href="#question-5" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which technology can be used to apply security policy for internal cluster traffic at the application layer of the network?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Container Runtime
B. Network Policy
C. Service Mesh
D. Ingress Controller&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #6&lt;span class="hx:absolute hx:-mt-20" id="question-6"&gt;&lt;/span&gt;
&lt;a href="#question-6" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following statement regarding a container run with &lt;code&gt;privileged: true&lt;/code&gt; is correct?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. A container run with &lt;code&gt;privileged: true&lt;/code&gt; within a Namespace can access all Secrets used within that Namespace.
B. A container run with &lt;code&gt;privileged: true&lt;/code&gt; within a cluster can access all Secrets used within that cluster.
C. A container run with &lt;code&gt;privileged: true&lt;/code&gt; has no additional access to Secrets than if it were run with &lt;code&gt;privileged: false&lt;/code&gt;.
D. A container run with &lt;code&gt;privileged: true&lt;/code&gt; on a node can access all Secrets used on that node.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #7&lt;span class="hx:absolute hx:-mt-20" id="question-7"&gt;&lt;/span&gt;
&lt;a href="#question-7" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following is a measure for data plane isolation in a Kubernetes multi-tenancy scenario?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Enforce Object Count Quotas via the ResourceQuota admission controller.
B. Assign a dedicated namespace to Pods from each tenant.
C. Assign a dedicated set of workers to run Pods from each tenant.
D. Enforce Roles and RoleBindings tied to specific namespaces only, forbid cluster-wide roles.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #8&lt;span class="hx:absolute hx:-mt-20" id="question-8"&gt;&lt;/span&gt;
&lt;a href="#question-8" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;How can a user enforce the Pod Security Standard without third party tools?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. It is only possible to enforce the Pod Security Standard with additional tools within the cloud native ecosystem.
B. Use the PodSecurity admission controller.
C. No additional measures have to be taken to enforce the Pod Security Standard.
D. Through implementing Kyverno or OPA Policies.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #9&lt;span class="hx:absolute hx:-mt-20" id="question-9"&gt;&lt;/span&gt;
&lt;a href="#question-9" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following statements best describe container image signing and verification in the cloud environment?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Container image signatures and their verification ensure their authenticity and integrity against tampering.
B. Container image signatures affect the performance of containerized applications, as they increase the size of images with additional metadata.
C. Container image signatures are concerned with defining developer ownership of applications within multi-tenant environments.
D. Container image signatures are mandatory in cloud environments, as cloud providers would deny the execution of unsigned container images.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #10&lt;span class="hx:absolute hx:-mt-20" id="question-10"&gt;&lt;/span&gt;
&lt;a href="#question-10" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which other controllers are part of the kube controller manager inside the Kubernetes cluster?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Replication controller, Endpoints controller, Namespace controller, and ServiceAccounts controller.
B. Namespace controller, ConfigMap controller, and Secret controller.
C. Pod, Service, and Ingress controller.
D. Job controller, CronJob controller, and DaemonSet controller.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A
&lt;strong&gt;參考連結:&lt;/strong&gt; &lt;a
href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/"target="_blank" rel="noopener"&gt;https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #11&lt;span class="hx:absolute hx:-mt-20" id="question-11"&gt;&lt;/span&gt;
&lt;a href="#question-11" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On a client machine, what directory (by default) contains sensitive credential information?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. &lt;code&gt;/opt/kubernetes/secrets/&lt;/code&gt;
B. &lt;code&gt;$HOME/.kube&lt;/code&gt;
C. &lt;code&gt;$HOME/.config/kubernetes/&lt;/code&gt;
D. &lt;code&gt;/etc/kubernetes/&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #12&lt;span class="hx:absolute hx:-mt-20" id="question-12"&gt;&lt;/span&gt;
&lt;a href="#question-12" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What mechanism can I use to block unsigned images from running in my cluster?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Enabling Admission Controllers to validate image signatures.
B. Using PodSecurityPolicy (PSP) to enforce image signing and validation.
C. Configuring Container Runtime Interface (CRI) to enforce image signing and validation.
D. Using Pod Security Standards (PSS) to enforce validation of signatures.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #13&lt;span class="hx:absolute hx:-mt-20" id="question-13"&gt;&lt;/span&gt;
&lt;a href="#question-13" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the main reason an organization would use a Cloud Workload Protection Platform (CWPP) solution?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. To manage networking between containerized workloads in the Kubernetes cluster.
B. To automate the deployment and management of containerized workloads.
C. To protect containerized workloads from known vulnerabilities and malware threats.
D. To optimize resource utilization and scalability of containerized workloads.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #14&lt;span class="hx:absolute hx:-mt-20" id="question-14"&gt;&lt;/span&gt;
&lt;a href="#question-14" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the purpose of an egress NetworkPolicy?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. To secure the Kubernetes cluster against unauthorized access.
B. To control the incoming network traffic to a Kubernetes cluster.
C. To control the outbound network traffic from a Kubernetes cluster.
D. To control the outgoing network traffic from one or more Kubernetes Pods.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #16&lt;span class="hx:absolute hx:-mt-20" id="question-16"&gt;&lt;/span&gt;
&lt;a href="#question-16" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What information is stored in etcd?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Pod data contained in Persistent Volume Claims (e.g., hostPath).
B. Application logs and monitoring data for auditing and troubleshooting purposes.
C. Etcd manages the configuration data, state data, and metadata for Kubernetes.
D. Sensitive user data such as usernames and passwords.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #17&lt;span class="hx:absolute hx:-mt-20" id="question-17"&gt;&lt;/span&gt;
&lt;a href="#question-17" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A container image is trojanized by an attacker by compromising the build server. Based on the STRIDE threat modeling framework, which threat category best defines this threat?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Denial Of Service
B. Repudiation
C. Tampering
D. Spoofing&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #18&lt;span class="hx:absolute hx:-mt-20" id="question-18"&gt;&lt;/span&gt;
&lt;a href="#question-18" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which label should be added to the Namespace to block any privileged Pods from being created in that Namespace?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. &lt;code&gt;privileged: true&lt;/code&gt;
B. &lt;code&gt;pod.security.kubernetes.io/enforce: baseline&lt;/code&gt;
C. &lt;code&gt;privileged: false&lt;/code&gt;
D. &lt;code&gt;pod.security.kubernetes.io/privileged: false&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #19&lt;span class="hx:absolute hx:-mt-20" id="question-19"&gt;&lt;/span&gt;
&lt;a href="#question-19" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You are responsible for securing the kubelet component in a Kubernetes cluster. Which of the following statements about kubelet security is correct?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Kubelet does not have any built-in security features.
B. Kubelet runs as a privileged container by default.
C. Kubelet requires root access to interact with the host system.
D. Kubelet supports TLS authentication and encryption for secure communication with the API server.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #20&lt;span class="hx:absolute hx:-mt-20" id="question-20"&gt;&lt;/span&gt;
&lt;a href="#question-20" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following statements best describes the role of the Scheduler in Kubernetes?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. The Scheduler is responsible for monitoring and managing the health of the Kubernetes cluster.
B. The Scheduler is responsible for ensuring the security of the Kubernetes cluster and its components.
C. The Scheduler is responsible for managing the deployment and scaling of applications in the Kubernetes cluster.
D. The Scheduler is responsible for assigning Pods to nodes based on resource availability and other constraints.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #21&lt;span class="hx:absolute hx:-mt-20" id="question-21"&gt;&lt;/span&gt;
&lt;a href="#question-21" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;How do Kubernetes namespaces impact the application of policies when using Pod Security Admission?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Different policies can be applied to specific namespaces.
B. Namespaces are ignored; Pod Security Admission policies apply cluster-wide only.
C. The default namespace enforces the strictest security policies by default.
D. Each namespace can have only one active policy.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #22&lt;span class="hx:absolute hx:-mt-20" id="question-22"&gt;&lt;/span&gt;
&lt;a href="#question-22" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following statements correctly describes a container breakout?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. A container breakout is the process of escaping the container and gaining access to the cloud provider&amp;rsquo;s infrastructure.
B. A container breakout is the process of escaping the container and gaining access to the host operating system.
C. A container breakout is the process of escaping a container when it reaches its resource limits.
D. A container breakout is the process of escaping the container and gaining access to the Pod&amp;rsquo;s network traffic.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #23&lt;span class="hx:absolute hx:-mt-20" id="question-23"&gt;&lt;/span&gt;
&lt;a href="#question-23" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What was the name of the precursor to Pod Security Standards?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Kubernetes Security Context
B. Container Security Standards
C. Pod Security Policy
D. Container Runtime Security&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #24&lt;span class="hx:absolute hx:-mt-20" id="question-24"&gt;&lt;/span&gt;
&lt;a href="#question-24" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Given a standard Kubernetes cluster architecture comprising a single control plane node (hosting both etcd and the control plane as Pods) and three worker nodes, which of the following data flows crosses a trust boundary?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. From API Server to Container Runtime
B. From kubelet to Controller Manager
C. From kubelet to API Server
D. From kubelet to Container Runtime&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #25&lt;span class="hx:absolute hx:-mt-20" id="question-25"&gt;&lt;/span&gt;
&lt;a href="#question-25" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In Kubernetes, what is Public Key Infrastructure used for?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. To monitor and analyze performance metrics of a Kubernetes cluster.
B. To manage certificates and ensure secure communication in a Kubernetes cluster.
C. To automate the scaling of containers in a Kubernetes cluster.
D. To manage networking in a Kubernetes cluster.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #26&lt;span class="hx:absolute hx:-mt-20" id="question-26"&gt;&lt;/span&gt;
&lt;a href="#question-26" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When should soft multitenancy be used over hard multitenancy?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. When the priority is enabling complete isolation between tenants.
B. When the priority is enabling fine-grained control over tenant resources.
C. When the priority is enabling resource sharing and efficiency between tenants.
D. When the priority is enabling strict security boundaries between tenants.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #27&lt;span class="hx:absolute hx:-mt-20" id="question-27"&gt;&lt;/span&gt;
&lt;a href="#question-27" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You want to minimize security issues in running Kubernetes Pods. Which of the following actions can help achieve this goal?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Sharing sensitive data among Pods in the same cluster to improve collaboration.
B. Implement Pod Security standards in the Pod&amp;rsquo;s YAML configuration.
C. Deploying Pods with randomly generated names to obfuscate their identities.
D. Running Pods with elevated privileges to maximize their capabilities.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #28&lt;span class="hx:absolute hx:-mt-20" id="question-28"&gt;&lt;/span&gt;
&lt;a href="#question-28" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following is a control for Supply Chain Risk Management according to NIST 800-53 Rev. 5?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Incident Response
B. Supply Chain Risk Management Plan
C. Access Control
D. System and Communications Protection&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #29&lt;span class="hx:absolute hx:-mt-20" id="question-29"&gt;&lt;/span&gt;
&lt;a href="#question-29" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which standard approach to security is augmented by the 4C’s of Cloud Native security?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Secure-by-Design
B. Least Privilege
C. Zero Trust
D. Defense-in-Depth&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #30&lt;span class="hx:absolute hx:-mt-20" id="question-30"&gt;&lt;/span&gt;
&lt;a href="#question-30" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In a Kubernetes environment, what kind of Admission Controller can modify resource manifests when applied to the Kubernetes API to fix misconfigurations automatically?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. ValidatingAdmissionController
B. PodSecurityPolicy
C. MutatingAdmissionController
D. ResourceQuota&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #31&lt;span class="hx:absolute hx:-mt-20" id="question-31"&gt;&lt;/span&gt;
&lt;a href="#question-31" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A container running in a Kubernetes cluster has permission to modify host processes on the underlying node. What combination of privileges and capabilities is most likely to have led to this privilege escalation?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. &lt;code&gt;hostNetwork&lt;/code&gt; and &lt;code&gt;NET_RAW&lt;/code&gt;
B. There is no combination of privileges and capabilities that permits this.
C. &lt;code&gt;hostPath&lt;/code&gt; and &lt;code&gt;AUDIT_WRITE&lt;/code&gt;
D. &lt;code&gt;hostPID&lt;/code&gt; and &lt;code&gt;SYS_PTRACE&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #32&lt;span class="hx:absolute hx:-mt-20" id="question-32"&gt;&lt;/span&gt;
&lt;a href="#question-32" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What kind of organization would need to be compliant with PCI DSS?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Merchants that process credit card payments.
B. Retail stores that only accept cash payments.
C. Government agencies that collect personally identifiable information.
D. Non-profit organizations that handle sensitive customer data.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #33&lt;span class="hx:absolute hx:-mt-20" id="question-33"&gt;&lt;/span&gt;
&lt;a href="#question-33" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;As a Kubernetes and Cloud Native Security Associate, a user can set up audit logging in a cluster. What is the risk of logging every event at the full RequestResponse level?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Reduced storage requirements and faster performance.
B. Increased storage requirements and potential impact on performance.
C. Improved security and easier incident investigation.
D. No risk, as it provides the most comprehensive audit trail.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #34&lt;span class="hx:absolute hx:-mt-20" id="question-34"&gt;&lt;/span&gt;
&lt;a href="#question-34" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In a Kubernetes cluster, what are the security risks associated with using ConfigMaps for storing secrets?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Storing secrets in ConfigMaps does not allow for fine-grained access control via RBAC.
B. ConfigMaps store sensitive information in etcd encoded in base64 format automatically, which does not ensure confidentiality of data.
C. Storing secrets in ConfigMaps can expose sensitive information as they are stored in plaintext and can be accessed by unauthorized users.
D. Using ConfigMaps for storing secrets might make applications incompatible with the Kubernetes cluster.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #35&lt;span class="hx:absolute hx:-mt-20" id="question-35"&gt;&lt;/span&gt;
&lt;a href="#question-35" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In the event that kube-proxy is in a CrashLoopBackOff state, what impact does it have on the Pods running on the same worker node?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. The Pod cannot mount persistent volumes through CSI drivers.
B. The Pod&amp;rsquo;s resource utilization increases significantly.
C. The Pods cannot communicate with other Pods in the cluster.
D. The Pod&amp;rsquo;s security context restrictions cannot be enforced.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #36&lt;span class="hx:absolute hx:-mt-20" id="question-36"&gt;&lt;/span&gt;
&lt;a href="#question-36" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following statements on static Pods is true?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. The kubelet schedules static Pods local to its node without going through the kube-scheduler, making tracking and managing them difficult.
B. The kubelet can run a maximum of 5 static Pods on each node.
C. The kubelet only deploys static Pods when the kube-scheduler is unresponsive.
D. The kubelet can run static Pods that span multiple nodes, provided that it has the necessary privileges from the API server.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #37&lt;span class="hx:absolute hx:-mt-20" id="question-37"&gt;&lt;/span&gt;
&lt;a href="#question-37" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A user runs a command with kubectl to apply a change to a deployment. What is the first Kubernetes component that the request reaches?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. kubelet
B. Kubernetes Scheduler
C. Kubernetes Controller Manager
D. Kubernetes API Server&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #38&lt;span class="hx:absolute hx:-mt-20" id="question-38"&gt;&lt;/span&gt;
&lt;a href="#question-38" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following represents a baseline security measure for containers?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Configuring a static IP for each container.
B. Run containers as the root user.
C. Configuring persistent storage for containers.
D. Implementing access control to restrict container access.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #39&lt;span class="hx:absolute hx:-mt-20" id="question-39"&gt;&lt;/span&gt;
&lt;a href="#question-39" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which way of defining security policy brings consistency, minimizes toil, and reduces the probability of misconfiguration?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Manually configuring security controls for each individual resource, regularly.
B. Using a declarative approach to define security policies as code.
C. Implementing security policies through manual scripting on an ad-hoc basis.
D. Relying on manual audits and inspections for security policy enforcement.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #40&lt;span class="hx:absolute hx:-mt-20" id="question-40"&gt;&lt;/span&gt;
&lt;a href="#question-40" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Why might NetworkPolicy resources have no effect in a Kubernetes cluster?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. NetworkPolicy resources are only enforced for unprivileged Pods.
B. NetworkPolicy resources are only enforced if the user has the right RBAC permissions.
C. NetworkPolicy resources are only enforced if the networking plugin supports them.
D. NetworkPolicy resources are only enforced if the Kubernetes scheduler supports them.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #41&lt;span class="hx:absolute hx:-mt-20" id="question-41"&gt;&lt;/span&gt;
&lt;a href="#question-41" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the difference between gVisor and Firecracker?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. gVisor is a user-space kernel that provides isolation and security for containers. At the same time, Firecracker is a lightweight virtualization technology for creating and managing secure, multi-tenant container and function-as-a-service (FaaS) workloads.
B. gVisor is a lightweight virtualization technology for creating and managing secure, multi-tenant container and function-as-a-service (FaaS) workloads. At the same time, Firecracker is a user-space kernel that provides isolation and security for containers.
C. gVisor and Firecracker are two names for the same technology, which provides isolation and security for containers.
D. gVisor and Firecracker are both container runtimes that can be used interchangeably.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #42&lt;span class="hx:absolute hx:-mt-20" id="question-42"&gt;&lt;/span&gt;
&lt;a href="#question-42" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;An attacker has access to the network segment that the cluster is on. What happens when a compromised Pod attempts to connect to the API server?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. The compromised Pod is automatically isolated from the network to prevent any connections to the API server.
B. The compromised Pod is allowed to connect to the API server without any restrictions.
C. The compromised Pod connects to the API server and is granted elevated privileges by default.
D. The compromised Pod attempts to connect to the API server, but its requests may be blocked due to network policies.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #43&lt;span class="hx:absolute hx:-mt-20" id="question-43"&gt;&lt;/span&gt;
&lt;a href="#question-43" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Why does the default base64 encoding that Kubernetes applies to the contents of Secret resources provide inadequate protection?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Base64 encoding does not encrypt the contents of the Secret, only obfuscates it.
B. Base64 encoding is not supported by all Secret Stores.
C. Base64 encoding relies on a shared key which can be easily compromised.
D. Base64 encoding is vulnerable to brute-force attacks.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #44&lt;span class="hx:absolute hx:-mt-20" id="question-44"&gt;&lt;/span&gt;
&lt;a href="#question-44" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A cluster is failing to pull more recent versions of images from k8s.gcr.io. Why may this be?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. The authentication credentials for accessing k8s.gcr.io are incorrectly scoped.
B. There is a network connectivity issue between the cluster and k8s.gcr.io.
C. The container image registry k8s.gcr.io has been deprecated.
D. There is a bug in the container runtime or the image pull process.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #45&lt;span class="hx:absolute hx:-mt-20" id="question-45"&gt;&lt;/span&gt;
&lt;a href="#question-45" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A Kubernetes cluster tenant can launch privileged pods in contravention of the restricted Pod Security Standard mandated for cluster tenants and enforced by the built-in PodSecurity admission controller. The tenant has full CRUD permissions on the namespace object and the namespaced resources. How did the tenant achieve this?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. By deleting the PodSecurity admission controller deployment running in their namespace.
B. The scope of the tenant role means privilege escalation is impossible.
C. By using higher-level access credentials obtained from another namespace.
D. By tampering with the namespace labels.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #46&lt;span class="hx:absolute hx:-mt-20" id="question-46"&gt;&lt;/span&gt;
&lt;a href="#question-46" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Is it possible to restrict permissions so that a controller can only change the image of a deployment (without changing anything else about it, e.g., environment variables, commands, replicas, secrets)?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. No, because granting access to the &lt;code&gt;spec.containers.image&lt;/code&gt; field always grants access to the rest of the spec object.
B. Yes, with a &amp;lsquo;managed fields&amp;rsquo; annotation.
C. Not with RBAC, but it is possible with an admission webhook.
D. Yes, by granting permission to the &lt;code&gt;/image&lt;/code&gt; subresource.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #47&lt;span class="hx:absolute hx:-mt-20" id="question-47"&gt;&lt;/span&gt;
&lt;a href="#question-47" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following statements is true concerning the use of microVMs over user-space kernel implementations for advanced container sandboxing?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. MicroVMs offer higher isolation than user-space kernel implementations at the cost of a higher per-instance memory footprint.
B. MicroVMs provide reduced application compatibility and higher per-system call overhead than user-space kernel implementations.
C. MicroVMs allow for easier container management and orchestration than user-space kernel implementation.
D. MicroVMs offer lower isolation and security compared to user-space kernel implementations.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #48&lt;span class="hx:absolute hx:-mt-20" id="question-48"&gt;&lt;/span&gt;
&lt;a href="#question-48" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In a cluster that contains Nodes with multiple container runtimes installed, how can a Pod be configured to be created on a specific runtime?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. By setting the container runtime as an environment variable in the Pod.
B. By specifying the container runtime in the Pod&amp;rsquo;s YAML file.
C. By using a command-line flag when creating the Pod.
D. By modifying the Docker daemon configuration.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #49&lt;span class="hx:absolute hx:-mt-20" id="question-49"&gt;&lt;/span&gt;
&lt;a href="#question-49" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following is a valid security risk caused by having no egress controls in a Kubernetes cluster?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Data exfiltration.
B. Increased attack surface.
C. Unauthorized access to external resources.
D. Denial of Service.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #50&lt;span class="hx:absolute hx:-mt-20" id="question-50"&gt;&lt;/span&gt;
&lt;a href="#question-50" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the purpose of the Supplier Assessments and Reviews control in the NIST 800-53 Rev. 5 set of controls for Supply Chain Risk Management?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. To establish contractual agreements with suppliers.
B. To identify potential suppliers for the organization.
C. To evaluate and monitor existing suppliers for adherence to security requirements.
D. To conduct regular audits of suppliers&amp;rsquo; financial performance.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #51&lt;span class="hx:absolute hx:-mt-20" id="question-51"&gt;&lt;/span&gt;
&lt;a href="#question-51" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When using a cloud provider&amp;rsquo;s managed Kubernetes service, who is responsible for maintaining the etcd cluster?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Kubernetes administrator
B. Application developer
C. Namespace administrator
D. Cloud provider&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #52&lt;span class="hx:absolute hx:-mt-20" id="question-52"&gt;&lt;/span&gt;
&lt;a href="#question-52" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In order to reduce the attack surface of the Scheduler, which default parameter should be set to false?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. &amp;ndash;secure-kubeconfig
B. &amp;ndash;scheduler-name
C. &amp;ndash;bind-address
D. &amp;ndash;profiling&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #53&lt;span class="hx:absolute hx:-mt-20" id="question-53"&gt;&lt;/span&gt;
&lt;a href="#question-53" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A cluster administrator wants to enforce the use of a different container runtime depending on the application a workload belongs to. How could a mutating admission controller be configured to achieve this?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. By manually modifying the container runtime for each workload after it has been created.
B. By modifying the kube-apiserver configuration file to specify the desired container runtime for each application.
C. By configuring a mutating admission controller webhook that intercepts new workload creation requests and modifies the container runtime based on the application label.
D. By configuring a validating admission controller webhook that verifies the container runtime based on the application label and rejects requests that do not comply.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #54&lt;span class="hx:absolute hx:-mt-20" id="question-54"&gt;&lt;/span&gt;
&lt;a href="#question-54" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;An attacker has successfully overwhelmed the Kubernetes API server in a cluster with a single control plane node by flooding it with requests. How would implementing a high-availability mode with multiple control plane nodes mitigate this attack?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. By implementing rate limiting and throttling mechanisms on the API server to restrict the number of requests allowed.
B. By implementing network segmentation to isolate the API server from the rest of the cluster, preventing the attack from spreading.
C. By increasing the resources allocated to the API server, allowing it to handle a higher volume of requests.
D. By distributing the workload across multiple API servers, reducing the load on each server.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #55&lt;span class="hx:absolute hx:-mt-20" id="question-55"&gt;&lt;/span&gt;
&lt;a href="#question-55" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In which order are the validating and mutating admission controllers run while the Kubernetes API server processes a request?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. Validating admission controllers run before mutating admission controllers.
B. Mutating admission controllers run before validating admission controllers.
C. The order of execution varies and is determined by the cluster configuration.
D. Validating and mutating admission controllers run simultaneously.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #56&lt;span class="hx:absolute hx:-mt-20" id="question-56"&gt;&lt;/span&gt;
&lt;a href="#question-56" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Which security knowledge-base focuses specifically on offensive tools, techniques, and procedures?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. NIST Cybersecurity Framework
B. MITRE ATT&amp;amp;CK
C. CIS Controls
D. OWASP Top 10&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #57&lt;span class="hx:absolute hx:-mt-20" id="question-57"&gt;&lt;/span&gt;
&lt;a href="#question-57" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; What does the &amp;lsquo;cluster-admin&amp;rsquo; ClusterRole enable when used in a RoleBinding?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. It gives full control over every resource in the cluster and in all namespaces.
B. It gives full control over every resource in the role binding&amp;rsquo;s namespace, including the namespace itself.
C. It gives full control over every resource in the role binding&amp;rsquo;s namespace, not including the namespace object for isolation purposes.
D. It allows read/write access to most resources in the role binding&amp;rsquo;s namespace. This role does not allow write access to resource quota, to the namespace itself, and to EndpointSlices (or Endpoints).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #58&lt;span class="hx:absolute hx:-mt-20" id="question-58"&gt;&lt;/span&gt;
&lt;a href="#question-58" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; To restrict the kubelet&amp;rsquo;s rights to the Kubernetes API, what authorization mode should be set on the Kubernetes API server?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. AlwaysAllow
B. Node
C. Webhook
D. kubelet&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #59&lt;span class="hx:absolute hx:-mt-20" id="question-59"&gt;&lt;/span&gt;
&lt;a href="#question-59" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; What is a multi-stage build?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. A build process that involves multiple repositories for storing container images.
B. A build process that involves multiple developers collaborating on building an image.
C. A build process that involves multiple containers running simultaneously to speed up the image creation.
D. A build process that involves multiple stages of image creation, allowing for smaller, optimized images.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #60&lt;span class="hx:absolute hx:-mt-20" id="question-60"&gt;&lt;/span&gt;
&lt;a href="#question-60" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Which information does a user need to verify a signed container image?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A. The image&amp;rsquo;s SHA-256 hash and the public key of the signing authority.
B. The image&amp;rsquo;s digital signature and the private key of the signing authority.
C. The image&amp;rsquo;s digital signature and the public key of the signing authority.
D. The image&amp;rsquo;s SHA-256 hash and the private key of the signing authority.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #61&lt;span class="hx:absolute hx:-mt-20" id="question-61"&gt;&lt;/span&gt;
&lt;a href="#question-61" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following snippets from a RoleBinding correctly associates user bob with Role pod-reader?&lt;/p&gt;
&lt;p&gt;A.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;subjects:
-kind: User
name: pod-reader
apiGroup:rbac.authorization.k8s.io
roleRef:
kind: Role
name: bob
apiGroup:rbac.authorization.k8s.io&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;B.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;subjects:
kind: User
name: bob
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
name: pod-reader
apiGroup:rbac.authorization.k8s.io&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;C.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;subjects:
kind: Group
name: bob
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: pod-reader
apiGroup: rbac.authorization.k8s.io&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;D.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;subjects:
kind: User
name: bob
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: pod-reader
apiGroup:rbac.authorization.k8s.io&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #62&lt;span class="hx:absolute hx:-mt-20" id="question-62"&gt;&lt;/span&gt;
&lt;a href="#question-62" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following is a benefit of signing container images?&lt;/p&gt;
&lt;p&gt;A. Prevents container images with vulnerabilities from running
B. Preserves the confidentiality of code within the container image
C. Ensures the authenticity and integrity of the cotnainer image
D. Ensure that container images are free of malicious code&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #63&lt;span class="hx:absolute hx:-mt-20" id="question-63"&gt;&lt;/span&gt;
&lt;a href="#question-63" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which organisation provides Kubernetes Security Benchmarks for both self-hosted and managed platform&lt;/p&gt;
&lt;p&gt;A. The Open Web Application Security Project (OWASP)
B. The Cloud Native Computing FOundation (CNCF)
C. The Center for Internet Security (CIS)
D. The National Institute of Standards and Technology (NIST)&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #64&lt;span class="hx:absolute hx:-mt-20" id="question-64"&gt;&lt;/span&gt;
&lt;a href="#question-64" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;An attacker has disabled the log forward for a Kubernetes cluster with the aim of hiding evidence of their malicious activity from incident. Which attack type in STRIDE would this fall under&lt;/p&gt;
&lt;p&gt;A. Repudiation
B. Spoofing
C. Tampering
D. Denial of Service&lt;/p&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #65&lt;span class="hx:absolute hx:-mt-20" id="question-65"&gt;&lt;/span&gt;
&lt;a href="#question-65" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A Kubernetes cluster runs on a cloud platform. The platform&amp;rsquo;s metadata API provides information about the cluster (e.g.). What should be done to mitigate the risk associated with cloud metadata API access?&lt;/p&gt;
&lt;p&gt;A. Regularly audit the access logs of the cloud metadata API
B. Restrict Pod access to the cloud metadata API via network policies
C. Turn off the cloud metadata API
D. Ensure that all sensitive data in the cloud metadata API is encrypted&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #66&lt;span class="hx:absolute hx:-mt-20" id="question-66"&gt;&lt;/span&gt;
&lt;a href="#question-66" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following is a recommendation in the NSA and CISA Kubernetes Hardening Guidance on namespaces?&lt;/p&gt;
&lt;p&gt;A. Use the default namespace for all workloads
B. Use Pods should not be placed in Kube-system or kube-public
C. Share the same namespace for all workloads to improve resource utilization
D. Assign a single and unique namespace to each tenant&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #67&lt;span class="hx:absolute hx:-mt-20" id="question-67"&gt;&lt;/span&gt;
&lt;a href="#question-67" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the name for the process of assessing the validity of vulnerabilities detected in the code or dependencies of a piece of software&lt;/p&gt;
&lt;p&gt;A. Penetration Testing
B. Static Code Analysis
C. Vulnerability Triage
D. Vulnerability Scanning&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #68&lt;span class="hx:absolute hx:-mt-20" id="question-68"&gt;&lt;/span&gt;
&lt;a href="#question-68" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The user is configuring user authentication to a Kubernetes cluster. WHich of the following standards can be used to configure user authentication to a Kubernetes cluster without the use of an authentication webhook?&lt;/p&gt;
&lt;p&gt;A. SAML
B. OAuth 2.0
C. Kerberos
D. OpenID Connect&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #69&lt;span class="hx:absolute hx:-mt-20" id="question-69"&gt;&lt;/span&gt;
&lt;a href="#question-69" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A user is responsible for managing a multi-tenant Kubernetes platform&amp;rsquo;s security. They are worried about data condifentiality across to different tenants, and the impact of a compromise in case of an attacker eavesdropping traffic at the node level. Why would they implement a service mesh for this specific use case?&lt;/p&gt;
&lt;p&gt;A. To improve network security by encrypting traffic between services through mutual TLS
B. To enhance observability and monitoring of services within the Kubernetes platform
C. To improve the performance and scalability of services within the Kubernetes platform
D. To simplify the management and configuration of services in a Kubernetes cluster&lt;/p&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #70&lt;span class="hx:absolute hx:-mt-20" id="question-70"&gt;&lt;/span&gt;
&lt;a href="#question-70" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the effect of allowing privilege escalation at the container security context level?&lt;/p&gt;
&lt;p&gt;A. Privilege escalation facilitates smoother cluster scaling by allowing Pods to adapt to increased workloads
B. Privilege escalation can allow a container to gain more privileges than its parent process, which may be used for exploitation
C. Privilege escalation optimizes resource utilization within the cluster by enabling Pods to share resources via namespaces
D. Privilege escalation ensures better isolation between containers in a Pod, limiting the impact of security breaches&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #71&lt;span class="hx:absolute hx:-mt-20" id="question-71"&gt;&lt;/span&gt;
&lt;a href="#question-71" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is a trust boundary in the context of Kubernetes&lt;/p&gt;
&lt;p&gt;A. The boundary between two components where trust levels change
B. The boundary between two Services defined by different teams
C. The boundary between two Nodes in different subnets
D. The boundary between two Pods from different applications&lt;/p&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #72&lt;span class="hx:absolute hx:-mt-20" id="question-72"&gt;&lt;/span&gt;
&lt;a href="#question-72" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which explicitly describes the respective security and operations obligations of both the cloud provider and the cloud user?&lt;/p&gt;
&lt;p&gt;A. Segregation of Duties Model
B. Least Privilege Model
C. Shared Responsibility Model
D. Zero Trust Model&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #73&lt;span class="hx:absolute hx:-mt-20" id="question-73"&gt;&lt;/span&gt;
&lt;a href="#question-73" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A malicious actor with root access on a node wants to run a container without it being visible in the Kubernetes API. How can attacker achieve this?&lt;/p&gt;
&lt;p&gt;A. By Exploiting a vulnberability in the Kubernetes control plane components
B. By running the container using the underlying container runtime
C. By creating a static Pod using a filesystem-hosted static Pod manifest
D. By leveraging a Kubernetes admission controller to hide the controller&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #74&lt;span class="hx:absolute hx:-mt-20" id="question-74"&gt;&lt;/span&gt;
&lt;a href="#question-74" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A user has a client X.509 certificate with Subject including O=system:masters that lets them authenticate to the Kubernetes API server. What consequence of this?&lt;/p&gt;
&lt;p&gt;A. The user will have no access to the Kubernetes cluster
B. The user will have read-only access to the Kubernetes cluster
C. The user will have limited access to specific namespaces in the Kubernetes cluster
D. The user will have full administrator access to the Kubernetes cluster&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #75&lt;span class="hx:absolute hx:-mt-20" id="question-75"&gt;&lt;/span&gt;
&lt;a href="#question-75" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;AppArmor profiles preventing access to sensitive resources have been loaded onto a Node, but the Pods running on the Node can still acr resources. How can the Pods be configured correctly constrained by the AppArmor profiles?&lt;/p&gt;
&lt;p&gt;A. Edit the Pod YAML files to include the correct AppArmor profile annotations.
B. Restart the Pods to apply the profiles to the Pods running on the Node.
C. Reload the AppArmor profiles on the Node.
D. Enable AppArmor for the Pods running on the Node.&lt;/p&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #76&lt;span class="hx:absolute hx:-mt-20" id="question-76"&gt;&lt;/span&gt;
&lt;a href="#question-76" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In a multi-tenant Kubernetes environment where each team has distinct access requirements and workloads, which combination of s enhance client security and maintain workload isolation?&lt;/p&gt;
&lt;p&gt;A. Enable anonymous authentication, enforce mutual TLS (mTLS), and segregate workloads using pod
affinities.
B. Rely solely on basic authentication with a shared password across all teams, utilize node taints and tolerations, and tur optimize performance.
C. Use service account tokens for all external and internal clients, store client credentials in ConfigMaps, and rely on na workload isolation.
D. Utilize bearer tokens with a third-party identity service, employ network policies for Pod-level isolation, and leverag interactions.&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #77&lt;span class="hx:absolute hx:-mt-20" id="question-77"&gt;&lt;/span&gt;
&lt;a href="#question-77" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the operational impact of a failing kube-controller-manager Pod in the Kubernetes control plane?&lt;/p&gt;
&lt;p&gt;A. Pods can no longer be scheduled on the worker node running the failing kube-controller-manager Pod. Other worker nodes are not impacted.
B. Due to the lack of egress network policies, Pods can no longer communicate with external networks.
C. The container runtime on the worker node running the failing kube-controller-manager Pod evicts all existing containers from the same node. Other worker nodes are not impacted.
D. The cluster does not correctly manage the life-cycle of cluster resources, which makes it subject to a Denial of Service.&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #78&lt;span class="hx:absolute hx:-mt-20" id="question-78"&gt;&lt;/span&gt;
&lt;a href="#question-78" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In a Kubernetes environment, how do Linux namespaces ensure the isolation of containers?&lt;/p&gt;
&lt;p&gt;A. Linux namespaces ensure that processes within containers are only granted specific privileges without granting all the
B. Linux namespaces provide a mechanism for isolating groups of Kubernetes resources within a single cluster, includir Services.
C. Linux namespaces provide process isolation of filesystems, network resources, process IDs, and other Operating System separate namespaces for processes within containers.
D. Linux namespaces constrain resources that are allocated to processes within containers, such as CPU/memory&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #79&lt;span class="hx:absolute hx:-mt-20" id="question-79"&gt;&lt;/span&gt;
&lt;a href="#question-79" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In Kubernetes, which of the following conditions must be met for a user to be able to create or update a Role?&lt;/p&gt;
&lt;p&gt;A. The user is granted a role to create/update RoleBinding or ClusterRoleBinding objects.
B. The user is granted explicit permission to perform the &amp;lsquo;bind&amp;rsquo; verb on the roles or ClusterRoles resource in the rbac.authenticate.kubernetes.io
API group.
C. The user is granted explicit permission to perform the &amp;rsquo;escalate&amp;rsquo; verb on its own User resource in the authenticate.kubernetes.io
D. The user already has all the permissions contained in the role at the same scope as the object being modified.&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #80&lt;span class="hx:absolute hx:-mt-20" id="question-80"&gt;&lt;/span&gt;
&lt;a href="#question-80" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In the STRIDE threat modelling framework, what does the letter D stand for?&lt;/p&gt;
&lt;p&gt;A. Denial of Service
B. Data Tampering
C. Disclosure
D. Deception&lt;/p&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #81&lt;span class="hx:absolute hx:-mt-20" id="question-81"&gt;&lt;/span&gt;
&lt;a href="#question-81" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A user is responsible for securing their Kubernetes pipeline and ensuring that the components are signed, and their signatures are validated. What is the purpose of pipeline attestation?&lt;/p&gt;
&lt;p&gt;A. Pipeline attestation verifies the integrity of the software supply chain and ensures that the
components have not been breaked
B. Pipeline attestation is a process of automatically deploying and testing new versions of components in the pipeline
C. Pipeline attestation is a security feature that encrypts the communication between the pipeline components.
D. Pipeline attestation ensures that all components in the pipeline are up to date and have the latest security patches&lt;/p&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #82&lt;span class="hx:absolute hx:-mt-20" id="question-82"&gt;&lt;/span&gt;
&lt;a href="#question-82" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which components should be able to access etcd at the network level directly?&lt;/p&gt;
&lt;p&gt;A. Only worker nodes in the cluster.
B. All Pods running in the cluster.
C. Only the Kubernetes API server.
D. All Kubernetes control plane components.&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #83&lt;span class="hx:absolute hx:-mt-20" id="question-83"&gt;&lt;/span&gt;
&lt;a href="#question-83" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A user needs to maintain the audit policy of a Kubernetes cluster and wants to make sure that they log the most information in regard to. Which level do they select for the Pod resource?&lt;/p&gt;
&lt;p&gt;A. RequestResponse
B. RequestResponseMetadata
C. Request
D. Metadata&lt;/p&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #84&lt;span class="hx:absolute hx:-mt-20" id="question-84"&gt;&lt;/span&gt;
&lt;a href="#question-84" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Why is setting resource limits and requests for Kubernetes pods important to prevent internal Denial of Service scenarios?&lt;/p&gt;
&lt;p&gt;A. To optimize the network performance of the cluster
B. To ensure even distribution of storage resources among pods
C. To prevent a single pod from consuming excessive resources, impacting overall cluster stability
D. To facilitate rapid scaling of applications in response to demand&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #85&lt;span class="hx:absolute hx:-mt-20" id="question-85"&gt;&lt;/span&gt;
&lt;a href="#question-85" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the primary security advantage of using client certificate authentication for Kubernetes API server access?&lt;/p&gt;
&lt;p&gt;A. To enable rapid deployment of Kubernetes resources
B. To provide a secure method of authentication that minimizes the risk of credential theft
C. To optimize the network traffic flow within the Kubernetes cluster
D. To facilitate the integration of Kubernetes with cloud-based storage services&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #86&lt;span class="hx:absolute hx:-mt-20" id="question-86"&gt;&lt;/span&gt;
&lt;a href="#question-86" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which of the following is a key benefit of implementing a Service Mesh in a cloud-native application architecture from a security perspective?&lt;/p&gt;
&lt;p&gt;A. Automatic scaling of application resources
B. Simplified service discovery and load balancing
C. Enhanced traffic encryption and fine-grained access control
D. Reduced need for application-level logging&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #87&lt;span class="hx:absolute hx:-mt-20" id="question-87"&gt;&lt;/span&gt;
&lt;a href="#question-87" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is a key security measure for the Kubernetes Controller Manager to prevent unauthorized control of cluster components?&lt;/p&gt;
&lt;p&gt;A. Configuring Horizontal Pod Autoscaling for the Controller Manager
B. Enabling Role-Based Access Control (RBAC) for the Controller Manager&amp;rsquo;s operations
C. Implementing network policies specific to the Controller Manager
D. Regularly updating container runtime environments in the cluster&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #88&lt;span class="hx:absolute hx:-mt-20" id="question-88"&gt;&lt;/span&gt;
&lt;a href="#question-88" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Why is it important to enable and configure Kubelet client certificate rotation in a Kubernetes cluster?&lt;/p&gt;
&lt;p&gt;A. To improve the performance efficiency of the Kubelet
B. To ensure efficient resource allocation by the Kubelet
C. To facilitate smoother upgrades of Kubelet software
D. To enhance security through regular updating of authentication credentials&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #89&lt;span class="hx:absolute hx:-mt-20" id="question-89"&gt;&lt;/span&gt;
&lt;a href="#question-89" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the role of a Certificate Authority (CA) in the PKI setup of a Kubernetes cluster?&lt;/p&gt;
&lt;p&gt;A. To provide load balancing between different Kubernetes services
B. To manage the distribution of secrets within the Kubernetes cluster
C. To issue and manage digital certificates for secure communication within the cluster
D. To optimize network traffic routing within the Kubernetes environment&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #90&lt;span class="hx:absolute hx:-mt-20" id="question-90"&gt;&lt;/span&gt;
&lt;a href="#question-90" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In Kubernetes, why is it important to configure Pod Security Admissions to audit mode?&lt;/p&gt;
&lt;p&gt;A. To automatically scale pods based on the detected security risk
B. To evaluate the impact of proposed security policies without enforcing them
C. To enhance the data throughput performance of pods
D. To manage the allocation of persistent storage resources to pods&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #91&lt;span class="hx:absolute hx:-mt-20" id="question-91"&gt;&lt;/span&gt;
&lt;a href="#question-91" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Why is pod isolation crucial in a multi-tenant Kubernetes environment?&lt;/p&gt;
&lt;p&gt;A. To optimize the load balancing of network traffic among different tenants
B. To manage the allocation of storage resources to different tenant namespaces
C. To prevent a compromised or malicious pod in one tenant environment from affecting others
D. To ensure uniform resource utilization across different tenant environments&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #92&lt;span class="hx:absolute hx:-mt-20" id="question-92"&gt;&lt;/span&gt;
&lt;a href="#question-92" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Why is the secure management of secrets in persistent storage important in Kubernetes threat modeling?&lt;/p&gt;
&lt;p&gt;A. To facilitate seamless scaling of applications based on storage demands
B. To prevent unauthorized access to sensitive information like credentials and keys stored as secrets
C. To optimize the load balancing across different storage resources
D. To improve the network communication efficiency between storage volumes and pods&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #93&lt;span class="hx:absolute hx:-mt-20" id="question-93"&gt;&lt;/span&gt;
&lt;a href="#question-93" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which practice is most effective in securing workload and application code in a cloud-native environment against unauthorized access and data breaches?&lt;/p&gt;
&lt;p&gt;A. Implementing auto-scaling for workloads
B. Performing regular network penetration testing
C. Enforcing role-based access control (RBAC) at the application level
D. Using container orchestration tools for deployment automation&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #94&lt;span class="hx:absolute hx:-mt-20" id="question-94"&gt;&lt;/span&gt;
&lt;a href="#question-94" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is a crucial measure in Kubernetes to secure communication and data transfer, thereby mitigating the risk posed by an attacker on the network?&lt;/p&gt;
&lt;p&gt;A. Increasing the number of pod replicas to distribute network traffic
B. Implementing network policies to control and restrict pod-to-pod communication
C. Automating pod deployments to reduce configuration errors
D. Using load balancers to evenly distribute incoming network traffic&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #95&lt;span class="hx:absolute hx:-mt-20" id="question-95"&gt;&lt;/span&gt;
&lt;a href="#question-95" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Why is restricting access to Kubernetes’ cluster-level resources critical in mitigating the risk of privilege escalation?&lt;/p&gt;
&lt;p&gt;A. To enhance the performance of cluster components
B. To optimize resource distribution among different cluster services
C. To prevent unauthorized users or compromised applications from gaining extensive control over the cluster
D. To facilitate seamless communication between cluster services&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #96&lt;span class="hx:absolute hx:-mt-20" id="question-96"&gt;&lt;/span&gt;
&lt;a href="#question-96" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which security practice is most effective in preventing unauthorized or compromised container images from being deployed in a Kubernetes environment?&lt;/p&gt;
&lt;p&gt;A. Regularly updating Kubernetes and its dependencies
B. Implementing continuous integration/continuous deployment (CI/CD) pipelines
C. Enforcing image scanning and vulnerability assessment
D. Using network policies to control pod-to-pod communication&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #97&lt;span class="hx:absolute hx:-mt-20" id="question-97"&gt;&lt;/span&gt;
&lt;a href="#question-97" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the primary security benefit of isolating Kubernetes service traffic using a Service Mesh like Istio or Linkerd?&lt;/p&gt;
&lt;p&gt;A. To enhance the auto-scaling capabilities of services based on traffic
B. To enable automatic routing and load balancing of service requests
C. To provide encrypted communication and fine-grained access control between services
D. To improve the efficiency of resource utilization among services&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #98&lt;span class="hx:absolute hx:-mt-20" id="question-98"&gt;&lt;/span&gt;
&lt;a href="#question-98" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Why is setting Pod Security Admissions (PSA) to ‘audit’ mode beneficial during the initial implementation phase?&lt;/p&gt;
&lt;p&gt;A. To improve the data processing efficiency within the cluster
B. To manage the allocation of resources based on security policy evaluation
C. To record policy violations for assessment, allowing administrators to fine-tune security policies before enforcement
D. To optimize the distribution of network traffic among microservices&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #99&lt;span class="hx:absolute hx:-mt-20" id="question-99"&gt;&lt;/span&gt;
&lt;a href="#question-99" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Why is configuring access controls on a Kubernetes image repository crucial for platform security?&lt;/p&gt;
&lt;p&gt;A. To optimize the distribution of images across multiple clusters
B. To ensure only authorized personnel and systems can push or pull images
C. To enhance the speed of image deployment to production environments
D. To facilitate the integration of the repository with external monitoring tools&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #100&lt;span class="hx:absolute hx:-mt-20" id="question-100"&gt;&lt;/span&gt;
&lt;a href="#question-100" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When assessing the security of a cloud-native infrastructure, which of the following would not typically be the direct responsibility of the cloud service provider?&lt;/p&gt;
&lt;p&gt;A. Physical security of data center facilities
B. Patching the host operating system of virtual machines
C. Encrypting data at rest within the customer&amp;rsquo;s application
D. Ensuring the availability of network infrastructure&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #101&lt;span class="hx:absolute hx:-mt-20" id="question-101"&gt;&lt;/span&gt;
&lt;a href="#question-101" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In Kubernetes, why is it important to restrict the use of host network and host PID namespaces in pods?&lt;/p&gt;
&lt;p&gt;A. To improve the load balancing of network traffic among pods
B. To enhance the isolation of pods from the underlying host system
C. To facilitate better resource allocation to pods
D. To streamline the deployment process of pods&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #102&lt;span class="hx:absolute hx:-mt-20" id="question-102"&gt;&lt;/span&gt;
&lt;a href="#question-102" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is an effective security measure in Kubernetes to mitigate risks from an attacker present on the network?&lt;/p&gt;
&lt;p&gt;A. Implementing resource quotas to limit the use of cluster resources by pods
B. Encrypting data in transit between pods and services within the cluster
C. Automating the deployment process of pods and services
D. Utilizing load balancers to distribute network traffic evenly across pods&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #103&lt;span class="hx:absolute hx:-mt-20" id="question-103"&gt;&lt;/span&gt;
&lt;a href="#question-103" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What is the primary purpose of enabling mutual TLS (mTLS) authentication on the Kubernetes API Server?&lt;/p&gt;
&lt;p&gt;A. To increase the processing speed of API requests
B. To ensure load balancing of API requests across multiple servers
C. To provide encrypted and authenticated communication between clients and the API server
D. To facilitate automatic scaling of the API server based on traffic&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #104&lt;span class="hx:absolute hx:-mt-20" id="question-104"&gt;&lt;/span&gt;
&lt;a href="#question-104" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Which component of the 4Cs of Cloud Native Security is directly responsible for implementing security policies and controls within the application code to prevent vulnerabilities?&lt;/p&gt;
&lt;p&gt;A. Code Security
B. Container Security
C. Cloud Infrastructure Security
D. Cluster Security&lt;/p&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #105&lt;span class="hx:absolute hx:-mt-20" id="question-105"&gt;&lt;/span&gt;
&lt;a href="#question-105" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Why is the ‘Restricted’ policy in Kubernetes Pod Security Standards important for handling sensitive workloads?&lt;/p&gt;
&lt;p&gt;A. To optimize resource allocation for sensitive applications
B. To implement strict security constraints that minimize the risk of security breaches in sensitive applications
C. To increase the computational speed of applications handling sensitive data
D. To ensure high availability of sensitive applications in the cluster&lt;/p&gt;
&lt;p&gt;B&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #106&lt;span class="hx:absolute hx:-mt-20" id="question-106"&gt;&lt;/span&gt;
&lt;a href="#question-106" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In the context of Kubernetes cluster security, how can the Scheduler component be secured to prevent unauthorized scheduling of pods?&lt;/p&gt;
&lt;p&gt;A. By implementing Horizontal Pod Autoscaling for the Scheduler
B. By applying Network Policies specific to the Scheduler
C. By enforcing Role-Based Access Control (RBAC) for scheduling decisions
D. By using a Service Mesh to manage traffic to the Scheduler&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #107&lt;span class="hx:absolute hx:-mt-20" id="question-107"&gt;&lt;/span&gt;
&lt;a href="#question-107" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Pod Root access is uing what PID&lt;/p&gt;
&lt;p&gt;A. 0
B. 1000
C. 1001
D. 5000&lt;/p&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #108&lt;span class="hx:absolute hx:-mt-20" id="question-108"&gt;&lt;/span&gt;
&lt;a href="#question-108" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Use images scanning is setting in?&lt;/p&gt;
&lt;p&gt;A. CRI
B. PodSecurityPolicy (PSP)
C. PodSecurityContext (PSC)
D. Pod Security Admission (PSA)&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #109&lt;span class="hx:absolute hx:-mt-20" id="question-109"&gt;&lt;/span&gt;
&lt;a href="#question-109" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Signed container images pull from private registry is what permission for security.&lt;/p&gt;
&lt;p&gt;A. Read only
B. Read Write
C. No Need set any permission
D. Write only&lt;/p&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #110&lt;span class="hx:absolute hx:-mt-20" id="question-110"&gt;&lt;/span&gt;
&lt;a href="#question-110" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;POD Admission controller take action in what stage?&lt;/p&gt;
&lt;p&gt;A. Before authentication Before Authorization
B. Before authentication After Authorization
C. After authentication Before Authorization
D. After authentication After Authorization&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Question #111&lt;span class="hx:absolute hx:-mt-20" id="question-111"&gt;&lt;/span&gt;
&lt;a href="#question-111" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;API server send request to kubelet use what certificate&lt;/p&gt;
&lt;p&gt;A. Use root certificates
B. Use CA certificates
C. Use server certificates
D. Use client certificates&lt;/p&gt;
&lt;p&gt;D&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;2025 考試實戰心得&lt;span class="hx:absolute hx:-mt-20" id="2025-考試實戰心得"&gt;&lt;/span&gt;
&lt;a href="#2025-%e8%80%83%e8%a9%a6%e5%af%a6%e6%88%b0%e5%bf%83%e5%be%97" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;多的考題&lt;span class="hx:absolute hx:-mt-20" id="多的考題"&gt;&lt;/span&gt;
&lt;a href="#%e5%a4%9a%e7%9a%84%e8%80%83%e9%a1%8c" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;
&lt;li&gt;STRIDE 的 D 是什麼&lt;/li&gt;
&lt;li&gt;trust boundary 的描述定義(題目給好幾個定義描述去挑)，原本題庫也有，但換了個問法，關鍵在於跨兩個安全信任等級不同的區域&lt;/li&gt;
&lt;li&gt;考 Networkpolicy egress 的 yaml 寫法， 要讓兩個 pod 能夠通&lt;/li&gt;
&lt;li&gt;NIST 800-53 的定義要多了解一下，它會換個方式問&lt;/li&gt;
&lt;li&gt;cloud vender 跟客戶對於 K8S 的安全性，怎麼分責的定義(題目給好幾個定義描述去挑)&lt;/li&gt;
&lt;li&gt;有一個人叫 Bob，他的 role 的 yaml 內容會長什麼樣?考 role yaml 的格式，四個選項，選格式是正確的。&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>認識與實作 Kyverno</title><link>https://blog.kubeantony.com/archive/security/%E8%AA%8D%E8%AD%98%E8%88%87%E5%AF%A6%E4%BD%9C-kyverno/</link><pubDate>Mon, 28 Jul 2025 09:10:06 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/%E8%AA%8D%E8%AD%98%E8%88%87%E5%AF%A6%E4%BD%9C-kyverno/</guid><description>
&lt;p&gt;Kyverno（希臘語中「治理」的意思）是一個為雲端原生環境設計的策略引擎。它最初是為 Kubernetes 所打造，現在也能在 Kubernetes 叢集之外，作為一個統一的策略語言來使用。&lt;/p&gt;
&lt;p&gt;Kyverno 讓平台工程師（platform engineers）能夠自動化處理安全性、合規性及最佳實踐的驗證，並為應用程式團隊（application teams）提供安全的自助服務。&lt;/p&gt;
&lt;p&gt;其眾多功能特色包含：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;將策略定義為基於 YAML 的宣告式 Kubernetes 資源，無需學習新的語言！&lt;/li&gt;
&lt;li&gt;可作為 Kubernetes 的 admission controller、基於 CLI 的掃描器，以及在執行期間（at runtime）強制執行策略。&lt;/li&gt;
&lt;li&gt;驗證（validate）、變更（mutate）、產生（generate）或清理（cleanup/remove）任何 Kubernetes 資源。&lt;/li&gt;
&lt;li&gt;驗證 container image 及其元數據（metadata），以確保軟體供應鏈（software supply chain）的安全性。&lt;/li&gt;
&lt;li&gt;策略可應用於任何 JSON 格式的負載（payload），包含 Terraform 資源、雲端資源及服務授權。&lt;/li&gt;
&lt;li&gt;使用來自 CNCF Policy WG（策略工作小組）的開放報告格式來產出策略報告。&lt;/li&gt;
&lt;li&gt;彈性的策略例外管理機制。&lt;/li&gt;
&lt;li&gt;提供工具對策略進行全面的單元測試（unit testing）與端對端測試（e2e testing）。&lt;/li&gt;
&lt;li&gt;使用如 git 和 kustomize 等熟悉的工具，將策略作為程式碼資源（policies as code）來管理。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;How Kyverno Works&lt;span class="hx:absolute hx:-mt-20" id="how-kyverno-works"&gt;&lt;/span&gt;
&lt;a href="#how-kyverno-works" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Kyverno 在 Kubernetes 叢集中作為一個 &lt;strong&gt;dynamic admission controller&lt;/strong&gt; 運行。Kyverno 從 Kubernetes &lt;strong&gt;API server&lt;/strong&gt; 接收 validating 和 mutating &lt;strong&gt;admission webhook&lt;/strong&gt; 的 &lt;strong&gt;HTTP&lt;/strong&gt; 回呼（callbacks），並應用相符的策略來回傳結果，以強制執行准入策略或拒絕請求。&lt;/p&gt;
&lt;p&gt;Kyverno 策略可以使用資源的 &lt;strong&gt;kind&lt;/strong&gt;、&lt;strong&gt;name&lt;/strong&gt;、&lt;strong&gt;label selectors&lt;/strong&gt; 等多種方式來匹配資源。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Mutating policies&lt;/strong&gt;（變更型策略）可以寫成 &lt;strong&gt;overlays&lt;/strong&gt;（類似於 &lt;strong&gt;Kustomize&lt;/strong&gt;）的形式，或是 &lt;strong&gt;RFC 6902 JSON Patch&lt;/strong&gt; 的格式。&lt;strong&gt;Validating policies&lt;/strong&gt;（驗證型策略）也使用 &lt;strong&gt;overlay&lt;/strong&gt; 風格的語法，並支援模式匹配（&lt;strong&gt;pattern matching&lt;/strong&gt;）和條件式（&lt;strong&gt;if-then-else&lt;/strong&gt;）處理。&lt;/p&gt;
&lt;p&gt;策略的強制執行情況會透過 &lt;strong&gt;Kubernetes events&lt;/strong&gt; 來記錄。對於那些被允許的請求，或是在 Kyverno 策略被引入前就已存在的資源，Kyverno 會在叢集中建立 &lt;strong&gt;Policy Reports&lt;/strong&gt;。這些報告會包含一份持續更新的清單，列出由某個策略匹配到的資源、它們的狀態等等。&lt;/p&gt;
&lt;p&gt;下圖顯示了 Kyverno 的高階邏輯架構 :&lt;/p&gt;
&lt;p&gt;&lt;img src="https://hackmd.io/_uploads/Sy6I63NDxg.png" alt="image" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Webhook&lt;/strong&gt; 是一個伺服器，負責處理來自 Kubernetes &lt;strong&gt;API server&lt;/strong&gt; 的傳入 &lt;code&gt;AdmissionReview&lt;/code&gt; 請求，並將它們傳送給 &lt;strong&gt;Engine&lt;/strong&gt; 進行處理。它由 &lt;strong&gt;Webhook Controller&lt;/strong&gt; 進行動態設定，該控制器會監看已安裝的策略，並修改 webhooks，使其只請求那些被策略所匹配的資源。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cert Renewer&lt;/strong&gt; 負責監看並更新 webhook 所需的憑證，這些憑證以 Kubernetes &lt;strong&gt;Secrets&lt;/strong&gt; 的形式儲存。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Background Controller&lt;/strong&gt; 透過協調（reconciling）一個名為 &lt;strong&gt;UpdateRequests&lt;/strong&gt; 的中介資源，來處理所有 &lt;code&gt;generate&lt;/code&gt;（產生）和 &lt;code&gt;mutate-existing&lt;/code&gt;（變更現有）的策略。&lt;/p&gt;
&lt;p&gt;而 &lt;strong&gt;Report Controllers&lt;/strong&gt; 則負責從它們的中介資源——&lt;strong&gt;Admission Reports&lt;/strong&gt; 和 &lt;strong&gt;Background Scan Reports&lt;/strong&gt;——來建立及協調 &lt;strong&gt;Policy Reports&lt;/strong&gt;。&lt;/p&gt;
&lt;p&gt;Kyverno 也支援高可用性（&lt;strong&gt;high availability&lt;/strong&gt;）。一個高可用性的 Kyverno 安裝，是指其選擇安裝的 controllers 會被設定為以多個副本（&lt;strong&gt;replicas&lt;/strong&gt;）運行。根據 controller 的不同，額外的 replicas 也可能用來提升 Kyverno 的可擴展性（&lt;strong&gt;scalability&lt;/strong&gt;）。請參閱高可用性頁面，以獲取更多關於各種 Kyverno controllers、它們的元件以及各自如何處理可用性的詳細資訊。&lt;/p&gt;</description></item><item><title>實作 Validating Admission Policy</title><link>https://blog.kubeantony.com/archive/security/%E5%AF%A6%E4%BD%9C-validating-admission-policy/</link><pubDate>Sat, 26 Jul 2025 07:03:20 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/%E5%AF%A6%E4%BD%9C-validating-admission-policy/</guid><description>
&lt;h2&gt;What is Admission Control in K8s&lt;span class="hx:absolute hx:-mt-20" id="what-is-admission-control-in-k8s"&gt;&lt;/span&gt;
&lt;a href="#what-is-admission-control-in-k8s" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;admission controller&lt;/code&gt; 是一段程式碼，它會在請求經過認證 (authenticated) 與授權 (authorized) 之後，但在資源物件被永存到 etcd 之前，攔截傳送到 &lt;code&gt;Kubernetes API server&lt;/code&gt; 的請求。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Kubernetes&lt;/code&gt; 的許多重要功能都必須啟用 &lt;code&gt;admission controller&lt;/code&gt; 才能獲得妥善的支援。因此，如果一個 &lt;code&gt;Kubernetes API server&lt;/code&gt; 沒有配置一組正確的 &lt;code&gt;admission controllers&lt;/code&gt;，那它就是一個不完整的伺服器，而且無法支援您所期望的所有功能。&lt;/p&gt;
&lt;h3&gt;它們是什麼？&lt;span class="hx:absolute hx:-mt-20" id="它們是什麼"&gt;&lt;/span&gt;
&lt;a href="#%e5%ae%83%e5%80%91%e6%98%af%e4%bb%80%e9%ba%bc" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;Admission controllers&lt;/code&gt; 是 &lt;code&gt;Kubernetes API server&lt;/code&gt; 內的一段程式碼，它會檢查為了修改資源而傳入的請求中的資料。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Admission controllers&lt;/code&gt; 適用於建立 (&lt;code&gt;create&lt;/code&gt;)、刪除 (&lt;code&gt;delete&lt;/code&gt;) 或修改 (&lt;code&gt;modify&lt;/code&gt;) 物件的請求。&lt;code&gt;Admission controllers&lt;/code&gt; 也可以阻擋自訂的動詞 (&lt;code&gt;verb&lt;/code&gt;)，例如透過 &lt;code&gt;API server proxy&lt;/code&gt; 連接到一個 &lt;code&gt;pod&lt;/code&gt; 的請求。&lt;code&gt;Admission controllers&lt;/code&gt; 不會（也無法）阻擋讀取（&lt;code&gt;get&lt;/code&gt;、&lt;code&gt;watch&lt;/code&gt; 或 &lt;code&gt;list&lt;/code&gt;）物件的請求，因為讀取操作會繞過准入控制層 (&lt;code&gt;admission control layer&lt;/code&gt;)。&lt;/p&gt;
&lt;p&gt;准入控制機制 (&lt;code&gt;Admission control mechanisms&lt;/code&gt;) 可能是驗證型 (&lt;code&gt;validating&lt;/code&gt;)、變更型 (&lt;code&gt;mutating&lt;/code&gt;)，或兩者皆是。變更型 (&lt;code&gt;Mutating&lt;/code&gt;) 的 &lt;code&gt;controller&lt;/code&gt; 可以修改正在被變更的資源資料；驗證型 (&lt;code&gt;validating&lt;/code&gt;) 的 &lt;code&gt;controller&lt;/code&gt; 則不行。&lt;/p&gt;
&lt;p&gt;在 &lt;code&gt;Kubernetes 1.33&lt;/code&gt; 中，&lt;code&gt;admission controllers&lt;/code&gt; 包含&lt;a
href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#what-does-each-admission-controller-do"target="_blank" rel="noopener"&gt;列表中的項目&lt;/a&gt;，它們被編譯進 &lt;code&gt;kube-apiserver&lt;/code&gt; 的二進位檔中，並且只能由叢集管理員進行設定。&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;准入控制擴充點 (Admission control extension points)&lt;/strong&gt;&lt;span class="hx:absolute hx:-mt-20" id="准入控制擴充點-admission-control-extension-points"&gt;&lt;/span&gt;
&lt;a href="#%e5%87%86%e5%85%a5%e6%8e%a7%e5%88%b6%e6%93%b4%e5%85%85%e9%bb%9e-admission-control-extension-points" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;在完整的清單中，有三個特殊的 &lt;code&gt;controller&lt;/code&gt;：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;MutatingAdmissionWebhook&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ValidatingAdmissionWebhook&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ValidatingAdmissionPolicy&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;這兩個 &lt;code&gt;webhook controller&lt;/code&gt; 會（分別）執行在 API 中設定好的變更型 (&lt;code&gt;mutating&lt;/code&gt;) 和驗證型 (&lt;code&gt;validating&lt;/code&gt;) 的 &lt;code&gt;admission control webhooks&lt;/code&gt;。而 &lt;code&gt;ValidatingAdmissionPolicy&lt;/code&gt; 提供了一種方法，可以將宣告式的驗證碼嵌入到 API 之中，而無需依賴任何外部的 HTTP 呼叫。&lt;/p&gt;
&lt;p&gt;您可以使用這三個 &lt;code&gt;admission controller&lt;/code&gt;，在准入階段客製化叢集的行為。&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;准入控制階段 (Admission control phases)&lt;/strong&gt;&lt;span class="hx:absolute hx:-mt-20" id="准入控制階段-admission-control-phases"&gt;&lt;/span&gt;
&lt;a href="#%e5%87%86%e5%85%a5%e6%8e%a7%e5%88%b6%e9%9a%8e%e6%ae%b5-admission-control-phases" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;准入控制的過程分為兩個階段 :&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;第一個階段會執行變更型 (&lt;code&gt;mutating&lt;/code&gt;) 的 &lt;code&gt;admission controllers&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;第二個階段則執行驗證型 (&lt;code&gt;validating&lt;/code&gt;) 的 &lt;code&gt;admission controllers&lt;/code&gt;。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;請再次注意，有些 &lt;code&gt;controller&lt;/code&gt; 同時具備這兩種功能。如果在任一階段中有任何一個 &lt;code&gt;controller&lt;/code&gt; 拒絕了請求，則整個請求會被立即駁回，並將錯誤回傳給終端使用者。&lt;/p&gt;
&lt;p&gt;最後，&lt;code&gt;admission controllers&lt;/code&gt; 除了有時會變更目標物件之外，也可能產生副作用 (&lt;code&gt;side effects&lt;/code&gt;)；也就是說，在處理請求的過程中變更相關的資源。增加配額 (&lt;code&gt;quota&lt;/code&gt;) 的用量，就是說明為何需要此機制的典型範例。任何這類的副作用都需要一個對應的回收 (&lt;code&gt;reclamation&lt;/code&gt;) 或調節 (&lt;code&gt;reconciliation&lt;/code&gt;) 過程，因為任何一個特定的 &lt;code&gt;admission controller&lt;/code&gt; 都無法確信該請求最終會通過所有其他的 &lt;code&gt;admission controllers&lt;/code&gt;。&lt;/p&gt;
&lt;p&gt;這些呼叫的順序可參考下方說明 :&lt;/p&gt;
&lt;p&gt;&lt;img src="https://hackmd.io/_uploads/BJx3igGwxg.png" alt="image" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;What is Validating Admission Policy?&lt;span class="hx:absolute hx:-mt-20" id="what-is-validating-admission-policy"&gt;&lt;/span&gt;
&lt;a href="#what-is-validating-admission-policy" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Validating admission policies 使用 Common Expression Language（CEL）來宣告 policy 的驗證規則。Validating admission policies 具有高度的可配置性，使 policy 撰寫者能夠定義可參數化並依照叢集管理員需求套用到特定資源的 policies。&lt;/p&gt;
&lt;p&gt;Validating admission policies 用以取代 validating admission webhooks。&lt;/p&gt;
&lt;h3&gt;構成一個 VAP 策略需要哪些資源&lt;span class="hx:absolute hx:-mt-20" id="構成一個-vap-策略需要哪些資源"&gt;&lt;/span&gt;
&lt;a href="#%e6%a7%8b%e6%88%90%e4%b8%80%e5%80%8b-vap-%e7%ad%96%e7%95%a5%e9%9c%80%e8%a6%81%e5%93%aa%e4%ba%9b%e8%b3%87%e6%ba%90" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;一個策略 (&lt;code&gt;policy&lt;/code&gt;) 通常由三種資源組成：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ValidatingAdmissionPolicy&lt;/code&gt; 描述了一個策略的抽象邏輯（可以想成：「這個策略確保某個特定的 &lt;code&gt;label&lt;/code&gt; 被設定為一個特定的值」）。&lt;/li&gt;
&lt;li&gt;一個參數資源 (&lt;code&gt;parameter resource&lt;/code&gt;) 提供資訊給 &lt;code&gt;ValidatingAdmissionPolicy&lt;/code&gt;，使其成為一個具體的陳述（可以想成：「&lt;code&gt;owner&lt;/code&gt; 這個 &lt;code&gt;label&lt;/code&gt; 的值必須以 &lt;code&gt;.company.com&lt;/code&gt; 結尾」）。一個原生型別（例如 &lt;code&gt;ConfigMap&lt;/code&gt; 或 &lt;code&gt;CRD&lt;/code&gt;）定義了參數資源的結構 (&lt;code&gt;schema&lt;/code&gt;)。&lt;code&gt;ValidatingAdmissionPolicy&lt;/code&gt; 物件會指明它們期望使用哪種 &lt;code&gt;Kind&lt;/code&gt; 作為其參數資源。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ValidatingAdmissionPolicyBinding&lt;/code&gt; 將上述的資源連結在一起，並定義其作用範圍。如果您只想要求 &lt;code&gt;Pods&lt;/code&gt; 必須設定 &lt;code&gt;owner&lt;/code&gt; 這個 &lt;code&gt;label&lt;/code&gt;，那麼 &lt;code&gt;binding&lt;/code&gt; 就是用來指定此限制的地方。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;一個策略至少必須定義一個 &lt;code&gt;ValidatingAdmissionPolicy&lt;/code&gt; 和一個對應的 &lt;code&gt;ValidatingAdmissionPolicyBinding&lt;/code&gt; 才會生效。&lt;/p&gt;
&lt;p&gt;如果一個 &lt;code&gt;ValidatingAdmissionPolicy&lt;/code&gt; 不需要透過參數來設定，只要將其 &lt;code&gt;spec.paramKind&lt;/code&gt; 欄位留空不指定即可。&lt;/p&gt;
&lt;h2&gt;Validating Admission Policy 快速開始&lt;span class="hx:absolute hx:-mt-20" id="validating-admission-policy-快速開始"&gt;&lt;/span&gt;
&lt;a href="#validating-admission-policy-%e5%bf%ab%e9%80%9f%e9%96%8b%e5%a7%8b" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;建立 ValidatingAdmissionPolicy&lt;span class="hx:absolute hx:-mt-20" id="建立-validatingadmissionpolicy"&gt;&lt;/span&gt;
&lt;a href="#%e5%bb%ba%e7%ab%8b-validatingadmissionpolicy" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;mkdir ~/validatingadmissionpolicy/; cd ~/validatingadmissionpolicy/
nano basic-example-policy.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;內容如下 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: &amp;#34;demo-policy.example.com&amp;#34;
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups: [&amp;#34;apps&amp;#34;]
apiVersions: [&amp;#34;v1&amp;#34;]
operations: [&amp;#34;CREATE&amp;#34;, &amp;#34;UPDATE&amp;#34;]
resources: [&amp;#34;deployments&amp;#34;]
validations:
- expression: &amp;#34;object.spec.replicas &amp;lt;= 5&amp;#34;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;apiVersion: admissionregistration.k8s.io/v1&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;這指定了該物件所使用的 Kubernetes API 版本。&lt;code&gt;admissionregistration.k8s.io/v1&lt;/code&gt; 是 &lt;code&gt;ValidatingAdmissionPolicy&lt;/code&gt; 目前穩定的 API 群組與版本。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;kind: ValidatingAdmissionPolicy&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;這表明我們要建立的資源種類是 &lt;code&gt;ValidatingAdmissionPolicy&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;metadata:&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;name: &amp;quot;demo-policy.example.com&amp;quot;&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;這是此策略物件的唯一名稱。使用類似網域名稱的格式是一種很好的實踐，可以避免命名衝突。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;spec:&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;這是定義策略核心行為的地方。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;failurePolicy: Fail&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;這個欄位決定了當驗證表達式 (&lt;code&gt;expression&lt;/code&gt;) 執行失敗或回傳結果為 &lt;code&gt;false&lt;/code&gt; 時該如何處理。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;Fail&lt;/code&gt;&lt;/strong&gt; (目前設定)：表示請求將被&lt;strong&gt;拒絕&lt;/strong&gt;。這是最常見的設定，用來強制執行策略。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Ignore&lt;/code&gt;：表示如果驗證失敗，將忽略此策略並放行該請求。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;matchConstraints:&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;這個區塊用來定義此策略&lt;strong&gt;適用於哪些 API 請求&lt;/strong&gt;。只有符合這裡所有條件的請求才會觸發後續的驗證。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;resourceRules:&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;apiGroups: [&amp;quot;apps&amp;quot;]&lt;/code&gt;：指定目標資源所屬的 API 群組。&lt;code&gt;Deployments&lt;/code&gt; 隸屬於 &lt;code&gt;apps&lt;/code&gt; 群組。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;apiVersions: [&amp;quot;v1&amp;quot;]&lt;/code&gt;：指定目標資源的 API 版本。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;operations: [&amp;quot;CREATE&amp;quot;, &amp;quot;UPDATE&amp;quot;]&lt;/code&gt;: 指定此策略僅在&lt;strong&gt;建立&lt;/strong&gt;和&lt;strong&gt;更新&lt;/strong&gt;資源時觸發。它不會在 &lt;code&gt;DELETE&lt;/code&gt; 操作時觸發。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;resources: [&amp;quot;deployments&amp;quot;]&lt;/code&gt;：明確指定此規則只針對 &lt;code&gt;deployments&lt;/code&gt; 這種資源。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;validations:&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;這個區塊包含了實際的驗證邏輯。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;expression: &amp;quot;object.spec.replicas &amp;lt;= 5&amp;quot;&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;這是一段使用 &lt;strong&gt;Common Expression Language (CEL)&lt;/strong&gt; 撰寫的表達式。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;object&lt;/code&gt;：代表正在被驗證的物件本身（在此情境下就是那個 &lt;code&gt;Deployment&lt;/code&gt;）。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;object.spec.replicas&lt;/code&gt;：存取該 &lt;code&gt;Deployment&lt;/code&gt; 物件的 &lt;code&gt;spec&lt;/code&gt; 欄位下的 &lt;code&gt;replicas&lt;/code&gt; 數量。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;= 5&lt;/code&gt;：檢查 &lt;code&gt;replicas&lt;/code&gt; 的值是否小於或等於 5。&lt;/li&gt;
&lt;li&gt;如果此表達式回傳 &lt;code&gt;true&lt;/code&gt;，請求通過驗證。如果回傳 &lt;code&gt;false&lt;/code&gt;，則根據 &lt;code&gt;failurePolicy&lt;/code&gt; 的設定（&lt;code&gt;Fail&lt;/code&gt;）來拒絕請求。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;總結與效果&lt;span class="hx:absolute hx:-mt-20" id="總結與效果"&gt;&lt;/span&gt;
&lt;a href="#%e7%b8%bd%e7%b5%90%e8%88%87%e6%95%88%e6%9e%9c" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;當你將這個 YAML 檔案應用到你的 Kubernetes 叢集後：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;✅ &lt;strong&gt;允許的操作&lt;/strong&gt;：任何使用者試圖建立或更新一個 &lt;code&gt;Deployment&lt;/code&gt;，只要其 &lt;code&gt;.spec.replicas&lt;/code&gt; 的值小於或等於 5，操作都會成功。&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# 這個會成功&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;apps/v1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Deployment&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;nginx-deployment-ok&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;replicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c"&gt;# &amp;lt;= 5&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;❌ &lt;strong&gt;被阻擋的操作&lt;/strong&gt;：如果有人試圖將 &lt;code&gt;replicas&lt;/code&gt; 設定為 6 或更高，&lt;code&gt;kubectl apply&lt;/code&gt; 或 &lt;code&gt;kubectl create&lt;/code&gt; 指令將會立即失敗，並收到來自 API 伺服器的錯誤訊息，說明該操作違反了 &lt;code&gt;demo-policy.example.com&lt;/code&gt; 這條策略。&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# 這個會失敗&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;apps/v1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Deployment&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;nginx-deployment-bad&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;replicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c"&gt;# &amp;gt; 5&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;可以在 &lt;a
href="https://playcel.undistro.io/"target="_blank" rel="noopener"&gt;CEL Playground&lt;/a&gt; 中快速測試 CEL 表達式。&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>Pods status UnexpectedAdmissionError</title><link>https://blog.kubeantony.com/archive/security/pods-status-unexpectedadmissionerror/</link><pubDate>Sat, 17 May 2025 05:18:30 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/pods-status-unexpectedadmissionerror/</guid><description>
&lt;h2&gt;Environment&lt;span class="hx:absolute hx:-mt-20" id="environment"&gt;&lt;/span&gt;
&lt;a href="#environment" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;K3s: &lt;code&gt;v1.31.3+k3s1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;單節點，此節點同時扮演 control-plane, etcd, worker 三種角色&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Issue&lt;span class="hx:absolute hx:-mt-20" id="issue"&gt;&lt;/span&gt;
&lt;a href="#issue" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;當 deployment pod resources 中有宣告使用 gpu，在節點重新開機後，原來的 Pod 狀態會變成 &lt;code&gt;UnexpectedAdmissionError&lt;/code&gt; 或 &lt;code&gt;Unknown&lt;/code&gt; 或 &lt;code&gt;ContainerStatusUnknown&lt;/code&gt;，並且會看在 Pod Event 中看到 kubelet 噴出以下訊息&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;Allocate failed due to no healthy devices present; cannot allocate unhealthy devices nvidia.com/gpu, which is unexpected&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;但是過幾分鐘後，又有正常 Running 的 Pod&lt;/p&gt;
&lt;h2&gt;複現問題&lt;span class="hx:absolute hx:-mt-20" id="複現問題"&gt;&lt;/span&gt;
&lt;a href="#%e8%a4%87%e7%8f%be%e5%95%8f%e9%a1%8c" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;建立測試應用&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;echo &amp;#39;apiVersion: apps/v1
kind: Deployment
metadata:
name: gpu-deployment-sample
spec:
replicas: 1
selector:
matchLabels:
app: gpu-sample
template:
metadata:
labels:
app: gpu-sample
spec:
containers:
- name: cuda-container
image: quay.io/cloudwalker/alpine
command: [&amp;#34;sh&amp;#34;, &amp;#34;-c&amp;#34;, &amp;#34;sleep infinity&amp;#34;]
resources:
limits:
nvidia.com/gpu: 1&amp;#39; | kubectl apply -f -&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="2"&gt;
&lt;li&gt;檢視 pod 運作狀態&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;kubectl get pods -l app=gpu-sample&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;執行結果&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME READY STATUS RESTARTS AGE
gpu-deployment-sample-7dd75997f5-qv9l8 1/1 Running 0 22s&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="3"&gt;
&lt;li&gt;重開機&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;reboot&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="4"&gt;
&lt;li&gt;再次檢視運作狀態&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;kubectl get pods -l app=gpu-sample&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;執行結果 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME READY STATUS RESTARTS AGE
gpu-deployment-sample-7dd75997f5-qv9l8 0/1 Unknown 0 46m
gpu-deployment-sample-7dd75997f5-stbjz 1/1 Running 0 42m&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="5"&gt;
&lt;li&gt;檢視 Event&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;kubectl get events \
--field-selector involvedObject.name=gpu-deployment-sample-7dd75997f5-qv9l8 \
--sort-by=&amp;#39;.lastTimestamp&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;執行結果 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;LAST SEEN TYPE REASON OBJECT MESSAGE
49m Normal Scheduled pod/gpu-deployment-sample-7dd75997f5-qv9l8 Successfully assigned default/gpu-deployment-sample-7dd75997f5-qv9l8 to testing
49m Normal Pulling pod/gpu-deployment-sample-7dd75997f5-qv9l8 Pulling image &amp;#34;quay.io/cloudwalker/alpine&amp;#34;
49m Normal Pulled pod/gpu-deployment-sample-7dd75997f5-qv9l8 Successfully pulled image &amp;#34;quay.io/cloudwalker/alpine&amp;#34; in 705ms (705ms including waiting). Image size: 3751656 bytes.
49m Normal Created pod/gpu-deployment-sample-7dd75997f5-qv9l8 Created container cuda-container
49m Normal Started pod/gpu-deployment-sample-7dd75997f5-qv9l8 Started container cuda-container
44m Warning UnexpectedAdmissionError pod/gpu-deployment-sample-7dd75997f5-qv9l8 Allocate failed due to no healthy devices present; cannot allocate unhealthy devices nvidia.com/gpu, which is unexpected
44m Warning FailedMount pod/gpu-deployment-sample-7dd75997f5-qv9l8 MountVolume.SetUp failed for volume &amp;#34;kube-api-access-ns48f&amp;#34; : object &amp;#34;default&amp;#34;/&amp;#34;kube-root-ca.crt&amp;#34; not registered&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="5"&gt;
&lt;li&gt;查看 rs 狀態&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;kubectl get rs -l app=gpu-sample -o wide&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;執行結果 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
gpu-deployment-sample-7dd75997f5 1 1 1 73m cuda-container quay.io/cloudwalker/alpine app=gpu-sample,pod-template-hash=7dd75997f5&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Offline Install Neuvector 5.2.0 on Openshift Container Platform 4.12</title><link>https://blog.kubeantony.com/archive/security/offline-install-neuvector-5.2.0-on-openshift-container-platform-4.12/</link><pubDate>Mon, 09 Sep 2024 02:29:36 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/offline-install-neuvector-5.2.0-on-openshift-container-platform-4.12/</guid><description>
&lt;style&gt;
.indent-title-1{
margin-left: 1em;
}
.indent-title-2{
margin-left: 2em;
}
.indent-title-3{
margin-left: 3em;
}
&lt;/style&gt;
&lt;h1&gt;Preface&lt;/h1&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;本篇文章會介紹，&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;如何在 OpenShift Container Platform 4.12 上安裝 Neuvector 5.2.0&lt;/li&gt;
&lt;li&gt;設定 Neuvector web console 使用自簽憑證 ( Self-Signed Certificate )&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;可以透過點擊展開以下目錄，選擇想看的內容，跳轉至特定章節&lt;/p&gt;
&lt;/div&gt;
&lt;h1&gt;安裝前環境準備&lt;/h1&gt;&lt;h2&gt;1. 確認 Image Registry 的位址，並再修改 Image 的 Tag 後，將 Image 上傳至 Image Registry&lt;span class="hx:absolute hx:-mt-20" id="1-確認-image-registry-的位址並再修改-image-的-tag-後將-image-上傳至-image-registry"&gt;&lt;/span&gt;
&lt;a href="#1-%e7%a2%ba%e8%aa%8d-image-registry-%e7%9a%84%e4%bd%8d%e5%9d%80%e4%b8%a6%e5%86%8d%e4%bf%ae%e6%94%b9-image-%e7%9a%84-tag-%e5%be%8c%e5%b0%87-image-%e4%b8%8a%e5%82%b3%e8%87%b3-image-registry" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;要確定在叢集中的每一台 Node 都可以至該 Image Registry Pull Image 下來&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-2"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;docker login -u &amp;lt;user_name&amp;gt; -p `oc whoami -t` docker-registry.default.svc:5000
docker tag docker.io/neuvector/enforcer:&amp;lt;version&amp;gt; docker-registry.default.svc:5000/neuvector/enforcer:&amp;lt;version&amp;gt;
docker tag docker.io/neuvector/controller:&amp;lt;version&amp;gt; docker-registry.default.svc:5000/neuvector/controller:&amp;lt;version&amp;gt;
docker tag docker.io/neuvector/manager:&amp;lt;version&amp;gt; docker-registry.default.svc:5000/neuvector/manager:&amp;lt;version&amp;gt;
docker tag docker.io/neuvector/scanner docker-registry.default.svc:5000/neuvector/scanner
docker tag docker.io/neuvector/updater docker-registry.default.svc:5000/neuvector/updater
docker push docker-registry.default.svc:5000/neuvector/enforcer:&amp;lt;version&amp;gt;
docker push docker-registry.default.svc:5000/neuvector/controller:&amp;lt;version&amp;gt;
docker push docker-registry.default.svc:5000/neuvector/manager:&amp;lt;version&amp;gt;
docker push docker-registry.default.svc:5000/neuvector/scanner
docker push docker-registry.default.svc:5000/neuvector/updater
docker logout docker-registry.default.svc:5000&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;2. 檢查環境有無 defaultNodeSelector&lt;span class="hx:absolute hx:-mt-20" id="2-檢查環境有無-defaultnodeselector"&gt;&lt;/span&gt;
&lt;a href="#2-%e6%aa%a2%e6%9f%a5%e7%92%b0%e5%a2%83%e6%9c%89%e7%84%a1-defaultnodeselector" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc get scheduler cluster -o yaml | grep -A10 defaultNodeSelector&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;如果沒有螢幕輸出，則跳過本步驟&lt;/p&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;spec:
defaultNodeSelector: node-role.kubernetes.io/worker=&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;如果有類似以上螢幕輸出，則使用以下解決辦法&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;解決辦法&lt;span class="hx:absolute hx:-mt-20" id="解決辦法"&gt;&lt;/span&gt;
&lt;a href="#%e8%a7%a3%e6%b1%ba%e8%be%a6%e6%b3%95" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc annotate namespace neuvector openshift.io/node-selector=&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;如果 Neuvector 的 Enforcer DaemonSets 已建立，則須刪除 Pod，讓 Pod 重建&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc delete pod -l app=neuvector-enforcer-pod&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;如果不做本步驟，你可能會再建立完 Neuvector 後，看到 Enforcer 的 Pod 出現 Pending 的狀況，並且看到類似以下的錯誤訊息&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;0/11 nodes are available: 1 node(s) didn&amp;#39;t match Pod&amp;#39;s node affinity/selector. preemption: 0/11 nodes are available: 1 Preemption is not helpful for scheduling, 10 No preemption victims found for incoming pod. &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;3. 檢查 CRI-O Socket 的位置&lt;span class="hx:absolute hx:-mt-20" id="3-檢查-cri-o-socket-的位置"&gt;&lt;/span&gt;
&lt;a href="#3-%e6%aa%a2%e6%9f%a5-cri-o-socket-%e7%9a%84%e4%bd%8d%e7%bd%ae" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;檢查的目的是 Neuvector 的 Controller 和 Enforcer 的 Pod 會需要 mount CRI-O Socket 的位置，所以路徑要對&lt;/li&gt;
&lt;li&gt;如果 CRI-O Socket 的位置，不是 &lt;code&gt;/var/run/crio/crio.sock&lt;/code&gt;，則需要修改 Neuvector 的 Yaml 檔&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-2"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ for i in $(oc get node -o=jsonpath=&amp;#39;{.items[*].metadata.name}&amp;#39;)
do
echo
echo &amp;#34;$i&amp;#34;
echo
cat &amp;lt;&amp;lt;EOF | oc debug node/&amp;#34;$i&amp;#34; 2&amp;gt; /dev/null
chroot /host
ps -eaf | grep kubelet | tr &amp;#39; &amp;#39; &amp;#39;\n&amp;#39; | grep -w -- &amp;#39;--container-runtime-endpoint&amp;#39;
EOF
done&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;master.ocp4.example.com
--container-runtime-endpoint=/var/run/crio/crio.sock
worker1.ocp4.example.com
--container-runtime-endpoint=/var/run/crio/crio.sock
worker2.ocp4.example.com
--container-runtime-endpoint=/var/run/crio/crio.sock&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;4. 檢查在叢集中的每一台 Node 上有無額外的 Taints&lt;span class="hx:absolute hx:-mt-20" id="4-檢查在叢集中的每一台-node-上有無額外的-taints"&gt;&lt;/span&gt;
&lt;a href="#4-%e6%aa%a2%e6%9f%a5%e5%9c%a8%e5%8f%a2%e9%9b%86%e4%b8%ad%e7%9a%84%e6%af%8f%e4%b8%80%e5%8f%b0-node-%e4%b8%8a%e6%9c%89%e7%84%a1%e9%a1%8d%e5%a4%96%e7%9a%84-taints" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ for i in $(oc get node -o=jsonpath=&amp;#39;{.items[*].metadata.name}&amp;#39;)
do
echo
echo &amp;#34;$i&amp;#34;
echo
if [[ -z $(oc get node &amp;#34;$i&amp;#34; -o=jsonpath=&amp;#39;{.spec.taints}&amp;#39;) ]]; then
echo &amp;#34; No Taints on the $i&amp;#34;
else
echo &amp;#34; $(oc get node &amp;#34;$i&amp;#34; -o=jsonpath=&amp;#39;{.spec.taints}&amp;#39;)&amp;#34;
fi
done&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;master.ocp4.example.com
[{&amp;#34;effect&amp;#34;:&amp;#34;NoSchedule&amp;#34;,&amp;#34;key&amp;#34;:&amp;#34;node-role.kubernetes.io/master&amp;#34;}]
worker1.ocp4.example.com
No Taints on the worker1.ocp4.example.com
worker2.ocp4.example.com
No Taints on the worker2.ocp4.example.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;如果有出現除了以上 Taint 以外的 Taints 的話，需要更改 Neuvector 的 Yaml 檔裡面 Enforcer Pod 的部分&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-2"&gt;
&lt;pre&gt;
spec:
template:
spec:
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
&lt;font color=red&gt;- effect: NoSchedule
key: mykey
value: myvalue&lt;/font&gt;
&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;如果有額外的 Taints 請在紅字的地方添加。這需要與污點節點上定義的所有污點信息相匹配。否則，Enforcer 的 Pod 將無法在污點節點上部署&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;一次檢查全部的腳本&lt;span class="hx:absolute hx:-mt-20" id="一次檢查全部的腳本"&gt;&lt;/span&gt;
&lt;a href="#%e4%b8%80%e6%ac%a1%e6%aa%a2%e6%9f%a5%e5%85%a8%e9%83%a8%e7%9a%84%e8%85%b3%e6%9c%ac" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ curl -s https://raw.githubusercontent.com/braveantony/bash-script/main/precheck.sh | bash&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;#!/bin/bash
# check Env before installing Neuvector on OCP
## check Taint
echo &amp;#34;Starting Check The Taint Info On a Node&amp;#34;
for i in $(oc get node -o=jsonpath=&amp;#39;{.items[*].metadata.name}&amp;#39;)
do
echo
echo &amp;#34;$i&amp;#34;
echo
if [[ -z $(oc get node &amp;#34;$i&amp;#34; -o=jsonpath=&amp;#39;{.spec.taints}&amp;#39;) ]]; then
echo &amp;#34; No Taints on the $i&amp;#34;
else
echo &amp;#34; $(oc get node &amp;#34;$i&amp;#34; -o=jsonpath=&amp;#39;{.spec.taints}&amp;#39;)&amp;#34;
fi
done
echo
echo &amp;#34;Note: All taint info must match to schedule Enforcers on nodes&amp;#34;
echo &amp;#34;==================&amp;#34;
## check CRI-O run-time
echo &amp;#34;Starting Check CRI-O run-time&amp;#34;
for i in $(oc get node -o=jsonpath=&amp;#39;{.items[*].metadata.name}&amp;#39;)
do
echo
echo &amp;#34;$i&amp;#34;
echo
cat &amp;lt;&amp;lt;EOF | oc debug node/&amp;#34;$i&amp;#34; 2&amp;gt; /dev/null
chroot /host
ps -eaf | grep kubelet | tr &amp;#39; &amp;#39; &amp;#39;\n&amp;#39; | grep -w -- &amp;#39;--container-runtime-endpoint&amp;#39;
EOF
done
echo &amp;#34;==================&amp;#34;
## check defaultNodeSelector
echo &amp;#34;Starting Check defaultNodeSelector&amp;#34;
if [[ -z $(oc get scheduler cluster -o yaml | grep defaultNodeSelector) ]]; then
echo &amp;#34; No defaultNodeSelector&amp;#34;
else
oc get scheduler cluster -o yaml | grep -A10 defaultNodeSelector
fi
echo &amp;#34;==================&amp;#34;
echo &amp;#34;End Check&amp;#34; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;hr&gt;
&lt;h1&gt;開始安裝 Neuvector&lt;/h1&gt;&lt;h2&gt;1. Login as a normal user&lt;span class="hx:absolute hx:-mt-20" id="1-login-as-a-normal-user"&gt;&lt;/span&gt;
&lt;a href="#1-login-as-a-normal-user" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc login -u &amp;lt;user_name&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;2. Create a new project&lt;span class="hx:absolute hx:-mt-20" id="2-create-a-new-project"&gt;&lt;/span&gt;
&lt;a href="#2-create-a-new-project" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc new-project neuvector&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;3. Login as system:admin account&lt;span class="hx:absolute hx:-mt-20" id="3-login-as-systemadmin-account"&gt;&lt;/span&gt;
&lt;a href="#3-login-as-systemadmin-account" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc login -u system:admin&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;4. Create Service Accounts and Grant Access to the Privileged SCC&lt;span class="hx:absolute hx:-mt-20" id="4-create-service-accounts-and-grant-access-to-the-privileged-scc"&gt;&lt;/span&gt;
&lt;a href="#4-create-service-accounts-and-grant-access-to-the-privileged-scc" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc create sa controller -n neuvector
$ oc create sa enforcer -n neuvector
$ oc create sa basic -n neuvector
$ oc create sa updater -n neuvector
$ oc -n neuvector adm policy add-scc-to-user privileged -z controller -z enforcer&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;5. Create the custom resources (CRD) for NeuVector security rules. For OpenShift 4.6+ (Kubernetes 1.19+):&lt;span class="hx:absolute hx:-mt-20" id="5-create-the-custom-resources-crd-for-neuvector-security-rules-for-openshift-46-kubernetes-119"&gt;&lt;/span&gt;
&lt;a href="#5-create-the-custom-resources-crd-for-neuvector-security-rules-for-openshift-46-kubernetes-119" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc apply -f https://raw.githubusercontent.com/neuvector/manifests/main/kubernetes/5.2.0/crd-k8s-1.19.yaml
$ oc apply -f https://raw.githubusercontent.com/neuvector/manifests/main/kubernetes/5.2.0/waf-crd-k8s-1.19.yaml
$ oc apply -f https://raw.githubusercontent.com/neuvector/manifests/main/kubernetes/5.2.0/dlp-crd-k8s-1.19.yaml
$ oc apply -f https://raw.githubusercontent.com/neuvector/manifests/main/kubernetes/5.2.0/admission-crd-k8s-1.19.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;6. Add read permission to access the kubernetes API and OpenShift RBACs.&lt;span class="hx:absolute hx:-mt-20" id="6-add-read-permission-to-access-the-kubernetes-api-and-openshift-rbacs"&gt;&lt;/span&gt;
&lt;a href="#6-add-read-permission-to-access-the-kubernetes-api-and-openshift-rbacs" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;oc create clusterrole neuvector-binding-app --verb=get,list,watch,update --resource=nodes,pods,services,namespaces
oc create clusterrole neuvector-binding-rbac --verb=get,list,watch --resource=rolebindings.rbac.authorization.k8s.io,roles.rbac.authorization.k8s.io,clusterrolebindings.rbac.authorization.k8s.io,clusterroles.rbac.authorization.k8s.io,imagestreams.image.openshift.io
oc adm policy add-cluster-role-to-user neuvector-binding-app system:serviceaccount:neuvector:controller
oc adm policy add-cluster-role-to-user neuvector-binding-rbac system:serviceaccount:neuvector:controller
oc create clusterrole neuvector-binding-admission --verb=get,list,watch,create,update,delete --resource=validatingwebhookconfigurations,mutatingwebhookconfigurations
oc adm policy add-cluster-role-to-user neuvector-binding-admission system:serviceaccount:neuvector:controller
oc create clusterrole neuvector-binding-customresourcedefinition --verb=watch,create,get,update --resource=customresourcedefinitions
oc adm policy add-cluster-role-to-user neuvector-binding-customresourcedefinition system:serviceaccount:neuvector:controller
oc create clusterrole neuvector-binding-nvsecurityrules --verb=list,delete --resource=nvsecurityrules,nvclustersecurityrules
oc adm policy add-cluster-role-to-user neuvector-binding-nvsecurityrules system:serviceaccount:neuvector:controller
oc adm policy add-cluster-role-to-user view system:serviceaccount:neuvector:controller --rolebinding-name=neuvector-binding-view
oc create clusterrole neuvector-binding-nvwafsecurityrules --verb=list,delete --resource=nvwafsecurityrules
oc adm policy add-cluster-role-to-user neuvector-binding-nvwafsecurityrules system:serviceaccount:neuvector:controller
oc create clusterrole neuvector-binding-nvadmissioncontrolsecurityrules --verb=list,delete --resource=nvadmissioncontrolsecurityrules
oc adm policy add-cluster-role-to-user neuvector-binding-nvadmissioncontrolsecurityrules system:serviceaccount:neuvector:controller
oc create clusterrole neuvector-binding-nvdlpsecurityrules --verb=list,delete --resource=nvdlpsecurityrules
oc adm policy add-cluster-role-to-user neuvector-binding-nvdlpsecurityrules system:serviceaccount:neuvector:controller
oc create role neuvector-binding-scanner --verb=get,patch,update,watch --resource=deployments -n neuvector
oc adm policy add-role-to-user neuvector-binding-scanner system:serviceaccount:neuvector:updater system:serviceaccount:neuvector:controller -n neuvector --role-namespace neuvector
oc create clusterrole neuvector-binding-csp-usages --verb=get,create,update,delete --resource=cspadapterusagerecords
oc adm policy add-cluster-role-to-user neuvector-binding-csp-usages system:serviceaccount:neuvector:controller
oc create clusterrole neuvector-binding-co --verb=get,list --resource=clusteroperators
oc adm policy add-cluster-role-to-user neuvector-binding-co system:serviceaccount:neuvector:enforcer system:serviceaccount:neuvector:controller&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;7. Run the following command to check if the neuvector/controller, neuvector/enforcer and neuvector/updater service accounts are added successfully.&lt;span class="hx:absolute hx:-mt-20" id="7-run-the-following-command-to-check-if-the-neuvectorcontroller-neuvectorenforcer-and-neuvectorupdater-service-accounts-are-added-successfully"&gt;&lt;/span&gt;
&lt;a href="#7-run-the-following-command-to-check-if-the-neuvectorcontroller-neuvectorenforcer-and-neuvectorupdater-service-accounts-are-added-successfully" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc get ClusterRoleBinding neuvector-binding-app neuvector-binding-rbac neuvector-binding-admission neuvector-binding-customresourcedefinition neuvector-binding-nvsecurityrules neuvector-binding-view neuvector-binding-nvwafsecurityrules neuvector-binding-nvadmissioncontrolsecurityrules neuvector-binding-nvdlpsecurityrules neuvector-binding-csp-usages neuvector-binding-co -o wide&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;OpenShift Deployment Examples for NeuVector&lt;span class="hx:absolute hx:-mt-20" id="openshift-deployment-examples-for-neuvector"&gt;&lt;/span&gt;
&lt;a href="#openshift-deployment-examples-for-neuvector" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;# neuvector yaml version for NeuVector 5.2.x on CRI-O
apiVersion: v1
kind: Service
metadata:
name: neuvector-svc-crd-webhook
namespace: neuvector
spec:
ports:
- port: 443
targetPort: 30443
protocol: TCP
name: crd-webhook
type: ClusterIP
selector:
app: neuvector-controller-pod
---
apiVersion: v1
kind: Service
metadata:
name: neuvector-svc-admission-webhook
namespace: neuvector
spec:
ports:
- port: 443
targetPort: 20443
protocol: TCP
name: admission-webhook
type: ClusterIP
selector:
app: neuvector-controller-pod
---
apiVersion: v1
kind: Service
metadata:
name: neuvector-service-webui
namespace: neuvector
spec:
ports:
- port: 8443
name: manager
protocol: TCP
type: ClusterIP
selector:
app: neuvector-manager-pod
---
apiVersion: v1
kind: Service
metadata:
name: neuvector-svc-controller
namespace: neuvector
spec:
ports:
- port: 18300
protocol: &amp;#34;TCP&amp;#34;
name: &amp;#34;cluster-tcp-18300&amp;#34;
- port: 18301
protocol: &amp;#34;TCP&amp;#34;
name: &amp;#34;cluster-tcp-18301&amp;#34;
- port: 18301
protocol: &amp;#34;UDP&amp;#34;
name: &amp;#34;cluster-udp-18301&amp;#34;
clusterIP: None
selector:
app: neuvector-controller-pod
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: neuvector-route-webui
namespace: neuvector
spec:
to:
kind: Service
name: neuvector-service-webui
port:
targetPort: manager
tls:
termination: passthrough
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: neuvector-manager-pod
namespace: neuvector
spec:
selector:
matchLabels:
app: neuvector-manager-pod
replicas: 1
template:
metadata:
labels:
app: neuvector-manager-pod
spec:
serviceAccountName: basic
serviceAccount: basic
containers:
- name: neuvector-manager-pod
image: image-registry.openshift-image-registry.svc:5000/neuvector/manager:&amp;lt;version&amp;gt;
env:
- name: CTRL_SERVER_IP
value: neuvector-svc-controller.neuvector
restartPolicy: Always
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: neuvector-controller-pod
namespace: neuvector
spec:
selector:
matchLabels:
app: neuvector-controller-pod
minReadySeconds: 60
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
replicas: 3
template:
metadata:
labels:
app: neuvector-controller-pod
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- neuvector-controller-pod
topologyKey: &amp;#34;kubernetes.io/hostname&amp;#34;
serviceAccountName: controller
serviceAccount: controller
containers:
- name: neuvector-controller-pod
image: image-registry.openshift-image-registry.svc:5000/neuvector/controller:&amp;lt;version&amp;gt;
securityContext:
privileged: true
readinessProbe:
exec:
command:
- cat
- /tmp/ready
initialDelaySeconds: 5
periodSeconds: 5
env:
- name: CLUSTER_JOIN_ADDR
value: neuvector-svc-controller.neuvector
- name: CLUSTER_ADVERTISED_ADDR
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: CLUSTER_BIND_ADDR
valueFrom:
fieldRef:
fieldPath: status.podIP
volumeMounts:
- mountPath: /var/neuvector
name: nv-share
readOnly: false
- mountPath: /var/run/crio/crio.sock
name: runtime-sock
readOnly: true
- mountPath: /host/proc
name: proc-vol
readOnly: true
- mountPath: /host/cgroup
name: cgroup-vol
readOnly: true
- mountPath: /etc/config
name: config-volume
readOnly: true
terminationGracePeriodSeconds: 300
restartPolicy: Always
volumes:
- name: nv-share
hostPath:
path: /var/neuvector
- name: runtime-sock
hostPath:
path: /var/run/crio/crio.sock
- name: proc-vol
hostPath:
path: /proc
- name: cgroup-vol
hostPath:
path: /sys/fs/cgroup
- name: config-volume
projected:
sources:
- configMap:
name: neuvector-init
optional: true
- secret:
name: neuvector-init
optional: true
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: neuvector-enforcer-pod
namespace: neuvector
spec:
selector:
matchLabels:
app: neuvector-enforcer-pod
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: neuvector-enforcer-pod
spec:
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
hostPID: true
serviceAccountName: enforcer
serviceAccount: enforcer
containers:
- name: neuvector-enforcer-pod
image: image-registry.openshift-image-registry.svc:5000/neuvector/enforcer:&amp;lt;version&amp;gt;
securityContext:
privileged: true
env:
- name: CLUSTER_JOIN_ADDR
value: neuvector-svc-controller.neuvector
- name: CLUSTER_ADVERTISED_ADDR
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: CLUSTER_BIND_ADDR
valueFrom:
fieldRef:
fieldPath: status.podIP
volumeMounts:
- mountPath: /lib/modules
name: modules-vol
readOnly: true
- mountPath: /var/run/crio/crio.sock
name: runtime-sock
readOnly: true
- mountPath: /host/proc
name: proc-vol
readOnly: true
- mountPath: /host/cgroup
name: cgroup-vol
readOnly: true
terminationGracePeriodSeconds: 1200
restartPolicy: Always
volumes:
- name: modules-vol
hostPath:
path: /lib/modules
- name: runtime-sock
hostPath:
path: /var/run/crio/crio.sock
- name: proc-vol
hostPath:
path: /proc
- name: cgroup-vol
hostPath:
path: /sys/fs/cgroup
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: neuvector-scanner-pod
namespace: neuvector
spec:
selector:
matchLabels:
app: neuvector-scanner-pod
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
replicas: 2
template:
metadata:
labels:
app: neuvector-scanner-pod
spec:
serviceAccountName: basic
serviceAccount: basic
containers:
- name: neuvector-scanner-pod
image: image-registry.openshift-image-registry.svc:5000/neuvector/scanner:latest
imagePullPolicy: Always
env:
- name: CLUSTER_JOIN_ADDR
value: neuvector-svc-controller.neuvector
restartPolicy: Always
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: neuvector-updater-pod
namespace: neuvector
spec:
schedule: &amp;#34;0 0 * * *&amp;#34;
jobTemplate:
spec:
template:
metadata:
labels:
app: neuvector-updater-pod
spec:
serviceAccountName: updater
serviceAccount: updater
containers:
- name: neuvector-updater-pod
image: image-registry.openshift-image-registry.svc:5000/neuvector/updater:latest
imagePullPolicy: Always
command:
- /bin/sh
- -c
- TOKEN=`cat /var/run/secrets/kubernetes.io/serviceaccount/token`; /usr/bin/curl -kv -X PATCH -H &amp;#34;Authorization:Bearer $TOKEN&amp;#34; -H &amp;#34;Content-Type:application/strategic-merge-patch&amp;#43;json&amp;#34; -d &amp;#39;{&amp;#34;spec&amp;#34;:{&amp;#34;template&amp;#34;:{&amp;#34;metadata&amp;#34;:{&amp;#34;annotations&amp;#34;:{&amp;#34;kubectl.kubernetes.io/restartedAt&amp;#34;:&amp;#34;&amp;#39;`date &amp;#43;%Y-%m-%dT%H:%M:%S%z`&amp;#39;&amp;#34;}}}}}&amp;#39; &amp;#39;https://kubernetes.default/apis/apps/v1/namespaces/neuvector/deployments/neuvector-scanner-pod&amp;#39;
restartPolicy: Never&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;8. 修改 Sample Yaml 檔&lt;span class="hx:absolute hx:-mt-20" id="8-修改-sample-yaml-檔"&gt;&lt;/span&gt;
&lt;a href="#8-%e4%bf%ae%e6%94%b9-sample-yaml-%e6%aa%94" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;8-1. 修改 Image Registry 的位置
8-2. 修改 CRI-O 的位置，如果 CRI-O Socket 的位置是 &lt;code&gt;/var/run/crio/crio.sock&lt;/code&gt;，則不需修改
8-3. 新增多餘的 Taints，除了&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;[{&amp;quot;effect&amp;quot;:&amp;quot;NoSchedule&amp;quot;,&amp;quot;key&amp;quot;:&amp;quot;node-role.kubernetes.io/master&amp;quot;}]&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[{&amp;quot;effect&amp;quot;:&amp;quot;NoSchedule&amp;quot;,&amp;quot;key&amp;quot;:&amp;quot;node-role.kubernetes.io/controlplane&amp;quot;}]&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;8-4. 修改 neuvector-service-webui 這個 Service 的 type 為 &lt;code&gt;NodePort&lt;/code&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;9. 建立 Neuvector&lt;span class="hx:absolute hx:-mt-20" id="9-建立-neuvector"&gt;&lt;/span&gt;
&lt;a href="#9-%e5%bb%ba%e7%ab%8b-neuvector" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc create -f neuvector.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;service/neuvector-svc-crd-webhook created
service/neuvector-svc-admission-webhook created
service/neuvector-service-webui created
service/neuvector-svc-controller created
route.route.openshift.io/neuvector-route-webui created
deployment.apps/neuvector-manager-pod created
deployment.apps/neuvector-controller-pod created
daemonset.apps/neuvector-enforcer-pod created
deployment.apps/neuvector-scanner-pod created
cronjob.batch/neuvector-updater-pod created&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;10. 檢視 Neuvector 運作狀態&lt;span class="hx:absolute hx:-mt-20" id="10-檢視-neuvector-運作狀態"&gt;&lt;/span&gt;
&lt;a href="#10-%e6%aa%a2%e8%a6%96-neuvector-%e9%81%8b%e4%bd%9c%e7%8b%80%e6%85%8b" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc get pods,svc -o wide&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod/neuvector-controller-pod-6655ddf6b-kf69d 1/1 Running 0 10m 10.129.1.168 worker2.ocp4.example.com &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
pod/neuvector-controller-pod-6655ddf6b-l89tf 1/1 Running 0 10m 10.130.0.40 worker1.ocp4.example.com &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
pod/neuvector-controller-pod-6655ddf6b-ljhbq 1/1 Running 0 10m 10.129.1.170 worker2.ocp4.example.com &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
pod/neuvector-enforcer-pod-5d2j9 1/1 Running 0 10m 10.130.0.38 worker1.ocp4.example.com &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
pod/neuvector-enforcer-pod-vc6tk 1/1 Running 0 10m 10.129.1.166 worker2.ocp4.example.com &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
pod/neuvector-enforcer-pod-vpg56 1/1 Running 0 10m 10.128.0.249 master.ocp4.example.com &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
pod/neuvector-manager-pod-896b46c9f-bgm8n 1/1 Running 0 10m 10.129.1.169 worker2.ocp4.example.com &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
pod/neuvector-scanner-pod-56c798bb86-8dh2m 1/1 Running 0 10m 10.130.0.39 worker1.ocp4.example.com &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
pod/neuvector-scanner-pod-56c798bb86-kvgrh 1/1 Running 0 10m 10.129.1.167 worker2.ocp4.example.com &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
pod/web 1/1 Running 0 47m 10.129.1.163 worker2.ocp4.example.com &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
service/neuvector-service-webui NodePort 172.30.139.142 &amp;lt;none&amp;gt; 8443:32744/TCP 10m app=neuvector-manager-pod
service/neuvector-svc-admission-webhook ClusterIP 172.30.188.201 &amp;lt;none&amp;gt; 443/TCP 10m app=neuvector-controller-pod
service/neuvector-svc-controller ClusterIP None &amp;lt;none&amp;gt; 18300/TCP,18301/TCP,18301/UDP 10m app=neuvector-controller-pod
service/neuvector-svc-crd-webhook ClusterIP 172.30.208.182 &amp;lt;none&amp;gt; 443/TCP 10m app=neuvector-controller-p&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;看 &lt;code&gt;neuvector-manager-pod-*-*&lt;/code&gt; 的 Pod 在哪一台 Node 上
以及 &lt;code&gt;neuvector-service-webui&lt;/code&gt; 這個 Service 開的 Port 好是多少&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;11.Access Neuvector WebUI&lt;span class="hx:absolute hx:-mt-20" id="11access-neuvector-webui"&gt;&lt;/span&gt;
&lt;a href="#11access-neuvector-webui" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;https://&amp;lt;worker2.ocp4.example.com 的 IP 位址&amp;gt;:32744&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;預設帳號: admin&lt;/li&gt;
&lt;li&gt;預設密碼: admin&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/HJPCVQ8jh.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Neuvector Dashboard&lt;span class="hx:absolute hx:-mt-20" id="neuvector-dashboard"&gt;&lt;/span&gt;
&lt;a href="#neuvector-dashboard" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/B134S78s2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;hr&gt;
&lt;h1&gt;Replacing Self-Signed Certificate&lt;/h1&gt;&lt;h2&gt;Prerequest&lt;span class="hx:absolute hx:-mt-20" id="prerequest"&gt;&lt;/span&gt;
&lt;a href="#prerequest" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;The NeuVector web console supports 2 different self-signed certificate types, specifically,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PKCS8 (Private-Key Information Syntax Standard)&lt;/li&gt;
&lt;li&gt;PKCS1 (RSA Cryptography Standard).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The self-signed certificate can be replaced with either of these PKCS types.&lt;/p&gt;
&lt;h3&gt;what is difference between &amp;ldquo;PKCS1&amp;rdquo; and &amp;ldquo;PKCS8&amp;rdquo;?&lt;span class="hx:absolute hx:-mt-20" id="what-is-difference-between-pkcs1-and-pkcs8"&gt;&lt;/span&gt;
&lt;a href="#what-is-difference-between-pkcs1-and-pkcs8" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;PKCS is short for &amp;ldquo;Public Key Cryptography Standards&amp;rdquo;，中文翻譯為 &amp;ldquo;公鑰加密標準&amp;rdquo;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PKCS1，用來定義 RSA 格式的公私鑰，是最基本的格式。
&lt;ul&gt;
&lt;li&gt;通過 &lt;code&gt;openssl&lt;/code&gt; 生成的金鑰，默認私鑰是 PKCS1 格式，不會輸出公鑰（因為公鑰可以通過私鑰導出）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;PKCS8，是一種用於處理所有算法（而不僅僅是 RSA）的私鑰的標準。&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-1"&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;私鑰格式&lt;/th&gt;
&lt;th&gt;支持的加密算法&lt;/th&gt;
&lt;th&gt;私鑰檔案內容的開頭&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PKCS#1&lt;/td&gt;
&lt;td&gt;RSA&lt;/td&gt;
&lt;td&gt;&lt;code&gt;—–BEGIN RSA PRIVATE KEY—–&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PKCS#8&lt;/td&gt;
&lt;td&gt;RSA、DSA、ECDSA 等&lt;/td&gt;
&lt;td&gt;&lt;code&gt;—–BEGIN PRIVATE KEY—–&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Create Certificate Authority&lt;span class="hx:absolute hx:-mt-20" id="create-certificate-authority"&gt;&lt;/span&gt;
&lt;a href="#create-certificate-authority" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;我們需要建立自己的 root CA certificate，讓瀏覽器信任自簽發憑證。&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ mkdir ssl &amp;amp;&amp;amp; cd ssl&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;執行以下 &lt;code&gt;openssl&lt;/code&gt; 指令，以建立 &lt;code&gt;rootCA.key&lt;/code&gt; 和 &lt;code&gt;rootCA.crt&lt;/code&gt;。
請將 &lt;code&gt;SUSE.Lab&lt;/code&gt; 替換為您的網域名稱或 IP 位址。&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ openssl req -x509 \
-sha256 -days 356 \
-nodes \
-newkey rsa:2048 \
-subj &amp;#34;/CN=SUSE.Lab/C=TW/L=Taipei&amp;#34; \
-keyout rootCA.key -out rootCA.crt &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;等下會使用 &lt;code&gt;rootCA.key&lt;/code&gt; 和 &lt;code&gt;rootCA.crt&lt;/code&gt; 來簽署 SSL 憑證。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;h2&gt;Create Self-Signed Certificates using OpenSSL&lt;span class="hx:absolute hx:-mt-20" id="create-self-signed-certificates-using-openssl"&gt;&lt;/span&gt;
&lt;a href="#create-self-signed-certificates-using-openssl" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;1. Create the Server Private Key&lt;span class="hx:absolute hx:-mt-20" id="1-create-the-server-private-key"&gt;&lt;/span&gt;
&lt;a href="#1-create-the-server-private-key" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ openssl genrsa -out server.key 2048&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;2. Create Certificate Signing Request Configuration&lt;span class="hx:absolute hx:-mt-20" id="2-create-certificate-signing-request-configuration"&gt;&lt;/span&gt;
&lt;a href="#2-create-certificate-signing-request-configuration" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;建立一個 &lt;code&gt;csr.conf&lt;/code&gt; 檔案，把所有生成 CSR 所需的資訊都放進去。&lt;/li&gt;
&lt;li&gt;把 &lt;code&gt;ocp4.example.com&lt;/code&gt; 替換成你自己的網域名稱或 IP 地址。&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ cat &amp;gt; csr.conf &amp;lt;&amp;lt;EOF
[req]
default_bits = 2048
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[dn]
C = TW
ST = Taiwan
L = Taipei
O = SUSE
OU = IT Department
emailAddress = admin@example.com
CN = ocp4.example.com
[req_ext]
subjectAltName = @alt_names
[alt_names]
DNS.1 = ocp4.example.com
DNS.2 = *.apps.ocp4.example.com
DNS.3 = api.ocp4.example.com
DNS.4 = api-int.ocp4.example.com
IP.1 = 192.168.11.80
EOF&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;3. Generate Certificate Signing Request (CSR) Using Server Private Key&lt;span class="hx:absolute hx:-mt-20" id="3-generate-certificate-signing-request-csr-using-server-private-key"&gt;&lt;/span&gt;
&lt;a href="#3-generate-certificate-signing-request-csr-using-server-private-key" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;執行以下命令生成 &lt;code&gt;server.csr&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ openssl req -new -key server.key -out server.csr -config csr.conf&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;4. Create a external file&lt;span class="hx:absolute hx:-mt-20" id="4-create-a-external-file"&gt;&lt;/span&gt;
&lt;a href="#4-create-a-external-file" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;執行以下命令建立 &lt;code&gt;cert.conf&lt;/code&gt; 檔案，目的是透過這個檔案，來產生 SSL 憑證。&lt;/li&gt;
&lt;li&gt;將 &lt;code&gt;*.apps.ocp4.example.com&lt;/code&gt; 替換為你的網域名稱或 IP 地址。&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ cat &amp;gt; cert.conf &amp;lt;&amp;lt;EOF
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = *.apps.ocp4.example.com
EOF&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;5. Generate SSL certificate With self signed CA&lt;span class="hx:absolute hx:-mt-20" id="5-generate-ssl-certificate-with-self-signed-ca"&gt;&lt;/span&gt;
&lt;a href="#5-generate-ssl-certificate-with-self-signed-ca" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;執行以下指令產生 SSL 憑證，這個憑證是由我們自己的憑證機構所建立的 &lt;code&gt;rootCA.crt&lt;/code&gt; 和 &lt;code&gt;rootCA.key&lt;/code&gt; 簽署的。&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ openssl x509 -req \
-in server.csr \
-CA rootCA.crt -CAkey rootCA.key \
-CAcreateserial -out server.crt \
-days 365 \
-sha256 -extfile cert.conf&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;上述指令會產生 &lt;code&gt;server.crt&lt;/code&gt; 憑證，我們將與 &lt;code&gt;server.key&lt;/code&gt; 一起使用這個憑證，以在 Neuvector web console 中啟用 SSL 功能。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;h2&gt;Create the secret from the generated key and certificate files&lt;span class="hx:absolute hx:-mt-20" id="create-the-secret-from-the-generated-key-and-certificate-files"&gt;&lt;/span&gt;
&lt;a href="#create-the-secret-from-the-generated-key-and-certificate-files" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;執行以下命令，把要給 Neuvector 用的私鑰和憑證做成 secret&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc create secret generic https-cert -n neuvector --from-file=server.key --from-file=server.crt&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Edit the yaml directly for the manager and controller deployments to add the mounts&lt;span class="hx:absolute hx:-mt-20" id="edit-the-yaml-directly-for-the-manager-and-controller-deployments-to-add-the-mounts"&gt;&lt;/span&gt;
&lt;a href="#edit-the-yaml-directly-for-the-manager-and-controller-deployments-to-add-the-mounts" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;spec:
template:
spec:
containers:
volumeMounts:
- mountPath: /etc/neuvector/certs/ssl-cert.key
name: cert
readOnly: true
subPath: server.key
- mountPath: /etc/neuvector/certs/ssl-cert.pem
name: cert
readOnly: true
subPath: server.crt
volumes:
- name: cert
secret:
defaultMode: 420
secretName: https-cert&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;# neuvector yaml version for NeuVector 5.2.x on CRI-O
apiVersion: v1
kind: Service
metadata:
name: neuvector-svc-crd-webhook
namespace: neuvector
spec:
ports:
- port: 443
targetPort: 30443
protocol: TCP
name: crd-webhook
type: ClusterIP
selector:
app: neuvector-controller-pod
---
apiVersion: v1
kind: Service
metadata:
name: neuvector-svc-admission-webhook
namespace: neuvector
spec:
ports:
- port: 443
targetPort: 20443
protocol: TCP
name: admission-webhook
type: ClusterIP
selector:
app: neuvector-controller-pod
---
apiVersion: v1
kind: Service
metadata:
name: neuvector-service-webui
namespace: neuvector
spec:
ports:
- port: 443
targetPort: 8443
name: manager
protocol: TCP
type: ClusterIP
selector:
app: neuvector-manager-pod
---
apiVersion: v1
kind: Service
metadata:
name: neuvector-svc-controller
namespace: neuvector
spec:
ports:
- port: 18300
protocol: &amp;#34;TCP&amp;#34;
name: &amp;#34;cluster-tcp-18300&amp;#34;
- port: 18301
protocol: &amp;#34;TCP&amp;#34;
name: &amp;#34;cluster-tcp-18301&amp;#34;
- port: 18301
protocol: &amp;#34;UDP&amp;#34;
name: &amp;#34;cluster-udp-18301&amp;#34;
clusterIP: None
selector:
app: neuvector-controller-pod
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: neuvector-route-webui
namespace: neuvector
spec:
to:
kind: Service
name: neuvector-service-webui
port:
targetPort: manager
tls:
termination: passthrough
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: neuvector-manager-pod
namespace: neuvector
spec:
selector:
matchLabels:
app: neuvector-manager-pod
replicas: 1
template:
metadata:
labels:
app: neuvector-manager-pod
spec:
serviceAccountName: basic
serviceAccount: basic
containers:
- name: neuvector-manager-pod
image: docker.io/neuvector/manager:5.2.0
env:
- name: CTRL_SERVER_IP
value: neuvector-svc-controller.neuvector
volumeMounts:
- mountPath: /etc/neuvector/certs/ssl-cert.key
name: cert
readOnly: true
subPath: server.key
- mountPath: /etc/neuvector/certs/ssl-cert.pem
name: cert
readOnly: true
subPath: server.crt
volumes:
- name: cert
secret:
defaultMode: 420
secretName: https-cert
restartPolicy: Always
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: neuvector-controller-pod
namespace: neuvector
spec:
selector:
matchLabels:
app: neuvector-controller-pod
minReadySeconds: 60
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
replicas: 3
template:
metadata:
labels:
app: neuvector-controller-pod
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- neuvector-controller-pod
topologyKey: &amp;#34;kubernetes.io/hostname&amp;#34;
serviceAccountName: controller
serviceAccount: controller
containers:
- name: neuvector-controller-pod
image: docker.io/neuvector/controller:5.2.0
securityContext:
privileged: true
readinessProbe:
exec:
command:
- cat
- /tmp/ready
initialDelaySeconds: 5
periodSeconds: 5
env:
- name: CLUSTER_JOIN_ADDR
value: neuvector-svc-controller.neuvector
- name: CLUSTER_ADVERTISED_ADDR
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: CLUSTER_BIND_ADDR
valueFrom:
fieldRef:
fieldPath: status.podIP
volumeMounts:
- mountPath: /var/neuvector
name: nv-share
readOnly: false
- mountPath: /var/run/crio/crio.sock
name: runtime-sock
readOnly: true
- mountPath: /host/proc
name: proc-vol
readOnly: true
- mountPath: /host/cgroup
name: cgroup-vol
readOnly: true
- mountPath: /etc/config
name: config-volume
readOnly: true
- mountPath: /etc/neuvector/certs/ssl-cert.key
name: cert
readOnly: true
subPath: server.key
- mountPath: /etc/neuvector/certs/ssl-cert.pem
name: cert
readOnly: true
subPath: server.crt
terminationGracePeriodSeconds: 300
restartPolicy: Always
volumes:
- name: nv-share
hostPath:
path: /var/neuvector
- name: runtime-sock
hostPath:
path: /var/run/crio/crio.sock
- name: proc-vol
hostPath:
path: /proc
- name: cgroup-vol
hostPath:
path: /sys/fs/cgroup
- name: cert
secret:
defaultMode: 420
secretName: https-cert
- name: config-volume
projected:
sources:
- configMap:
name: neuvector-init
optional: true
- secret:
name: neuvector-init
optional: true
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: neuvector-enforcer-pod
namespace: neuvector
spec:
selector:
matchLabels:
app: neuvector-enforcer-pod
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: neuvector-enforcer-pod
spec:
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
hostPID: true
serviceAccountName: enforcer
serviceAccount: enforcer
containers:
- name: neuvector-enforcer-pod
image: docker.io/neuvector/enforcer:5.2.0
securityContext:
privileged: true
env:
- name: CLUSTER_JOIN_ADDR
value: neuvector-svc-controller.neuvector
- name: CLUSTER_ADVERTISED_ADDR
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: CLUSTER_BIND_ADDR
valueFrom:
fieldRef:
fieldPath: status.podIP
volumeMounts:
- mountPath: /lib/modules
name: modules-vol
readOnly: true
- mountPath: /var/run/crio/crio.sock
name: runtime-sock
readOnly: true
- mountPath: /host/proc
name: proc-vol
readOnly: true
- mountPath: /host/cgroup
name: cgroup-vol
readOnly: true
terminationGracePeriodSeconds: 1200
restartPolicy: Always
volumes:
- name: modules-vol
hostPath:
path: /lib/modules
- name: runtime-sock
hostPath:
path: /var/run/crio/crio.sock
- name: proc-vol
hostPath:
path: /proc
- name: cgroup-vol
hostPath:
path: /sys/fs/cgroup
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: neuvector-scanner-pod
namespace: neuvector
spec:
selector:
matchLabels:
app: neuvector-scanner-pod
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
replicas: 2
template:
metadata:
labels:
app: neuvector-scanner-pod
spec:
serviceAccountName: basic
serviceAccount: basic
containers:
- name: neuvector-scanner-pod
image: docker.io/neuvector/scanner:latest
imagePullPolicy: Always
env:
- name: CLUSTER_JOIN_ADDR
value: neuvector-svc-controller.neuvector
restartPolicy: Always
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: neuvector-updater-pod
namespace: neuvector
spec:
schedule: &amp;#34;0 0 * * *&amp;#34;
jobTemplate:
spec:
template:
metadata:
labels:
app: neuvector-updater-pod
spec:
serviceAccountName: updater
serviceAccount: updater
containers:
- name: neuvector-updater-pod
image: docker.io/neuvector/updater:latest
imagePullPolicy: Always
command:
- /bin/sh
- -c
- TOKEN=`cat /var/run/secrets/kubernetes.io/serviceaccount/token`; /usr/bin/curl -kv -X PATCH -H &amp;#34;Authorization:Bearer $TOKEN&amp;#34; -H &amp;#34;Content-Type:application/strategic-merge-patch&amp;#43;json&amp;#34; -d &amp;#39;{&amp;#34;spec&amp;#34;:{&amp;#34;template&amp;#34;:{&amp;#34;metadata&amp;#34;:{&amp;#34;annotations&amp;#34;:{&amp;#34;kubectl.kubernetes.io/restartedAt&amp;#34;:&amp;#34;&amp;#39;`date &amp;#43;%Y-%m-%dT%H:%M:%S%z`&amp;#39;&amp;#34;}}}}}&amp;#39; &amp;#39;https://kubernetes.default/apis/apps/v1/namespaces/neuvector/deployments/neuvector-scanner-pod&amp;#39;
restartPolicy: Never&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;What is Route in OpenShift?&lt;span class="hx:absolute hx:-mt-20" id="what-is-route-in-openshift"&gt;&lt;/span&gt;
&lt;a href="#what-is-route-in-openshift" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;An OpenShift Container Platform route &lt;strong&gt;exposes a service at a host name&lt;/strong&gt;, such as &lt;code&gt;www.example.com&lt;/code&gt;, so that external clients can reach it by name.&lt;/p&gt;
&lt;h3&gt;Route Types&lt;span class="hx:absolute hx:-mt-20" id="route-types"&gt;&lt;/span&gt;
&lt;a href="#route-types" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/BJqx7k5sh.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;What is a Passthrough Route&lt;span class="hx:absolute hx:-mt-20" id="what-is-a-passthrough-route"&gt;&lt;/span&gt;
&lt;a href="#what-is-a-passthrough-route" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: neuvector-route-webui
namespace: neuvector
spec:
to:
kind: Service
name: neuvector-service-webui
port:
targetPort: manager
tls:
termination: passthrough&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;spec.tls.termination: passthrough&lt;/code&gt;，With passthrough termination, &lt;strong&gt;encrypted traffic is sent straight to the destination without the router providing TLS termination.&lt;/strong&gt; Therefore no key or certificate is required on the route.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;建立 Neuvector&lt;span class="hx:absolute hx:-mt-20" id="建立-neuvector"&gt;&lt;/span&gt;
&lt;a href="#%e5%bb%ba%e7%ab%8b-neuvector" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc create -f neuvector.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;執行以下命令檢查 Pod 運行狀態和 route&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc get pod,route&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME READY STATUS RESTARTS AGE
pod/neuvector-controller-pod-76bbbfc5dc-5t8lk 1/1 Running 0 167m
pod/neuvector-controller-pod-76bbbfc5dc-8znrb 1/1 Running 0 167m
pod/neuvector-controller-pod-76bbbfc5dc-t5tbb 1/1 Running 0 167m
pod/neuvector-enforcer-pod-4kgrn 1/1 Running 0 167m
pod/neuvector-enforcer-pod-kwsrr 1/1 Running 0 167m
pod/neuvector-enforcer-pod-lwnkp 1/1 Running 0 167m
pod/neuvector-manager-pod-6bb5555c7b-cx7lr 1/1 Running 0 167m
pod/neuvector-scanner-pod-56c798bb86-fvp8l 1/1 Running 0 167m
pod/neuvector-scanner-pod-56c798bb86-scqjk 1/1 Running 0 167m
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
route.route.openshift.io/neuvector-route-webui neuvector-route-webui-neuvector.apps.ocp4.example.com neuvector-service-webui manager passthrough None&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;在本機測試 Neuvector web console&lt;span class="hx:absolute hx:-mt-20" id="在本機測試-neuvector-web-console"&gt;&lt;/span&gt;
&lt;a href="#%e5%9c%a8%e6%9c%ac%e6%a9%9f%e6%b8%ac%e8%a9%a6-neuvector-web-console" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;
&lt;li&gt;將 CA 憑證複製到指定目錄&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="indent-title-2"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ sudo cp rootCA.crt /etc/pki/ca-trust/source/anchors/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="2"&gt;
&lt;li&gt;更新 Linux 系統的 CA (Certificate Authority) 信任我們自己建的 CA 憑證&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="indent-title-2"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ sudo update-ca-trust extract&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="3"&gt;
&lt;li&gt;驗證我們自己建的 CA 憑證是否由可信任的根憑證機構 (CA) 簽發&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="indent-title-2"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ openssl verify /etc/pki/ca-trust/source/anchors/rootCA.crt&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;/etc/pki/ca-trust/source/anchors/rootCA.crt: OK&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start="4"&gt;
&lt;li&gt;訪問 Neuvector web console&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="indent-title-2"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ curl https://neuvector-route-webui-neuvector.apps.ocp4.example.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;oc get route neuvector-route-webui&lt;/code&gt; 可以得到 Domain name&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;This and all future requests should be directed to &amp;lt;a href=&amp;#34;/index.html?v=2358c7ec6b&amp;#34;&amp;gt;this URI&amp;lt;/a&amp;gt;.&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;透過 Firefox 瀏覽器連線至 Neuvector web console&lt;span class="hx:absolute hx:-mt-20" id="透過-firefox-瀏覽器連線至-neuvector-web-console"&gt;&lt;/span&gt;
&lt;a href="#%e9%80%8f%e9%81%8e-firefox-%e7%80%8f%e8%a6%bd%e5%99%a8%e9%80%a3%e7%b7%9a%e8%87%b3-neuvector-web-console" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;將 &lt;code&gt;rootCA.crt&lt;/code&gt; 放入瀏覽器&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;設定&lt;/code&gt; &amp;gt; &lt;code&gt;隱私權與安全性&lt;/code&gt; &amp;gt; 往下滑點選 &lt;code&gt;檢視憑證&lt;/code&gt; &amp;gt; &lt;code&gt;匯入&lt;/code&gt; &amp;gt; 選擇 &lt;code&gt;rootCA.crt&lt;/code&gt; 後按 &lt;code&gt;開啟&lt;/code&gt; &amp;gt; &lt;code&gt;確定&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;輸入以下網址 : &lt;code&gt;https://neuvector-route-webui-neuvector.apps.ocp4.example.com/&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-2"&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/HkDeWZ5s3.jpg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;hr&gt;
&lt;h1&gt;參考文件&lt;/h1&gt;&lt;h2&gt;Neuvector&lt;span class="hx:absolute hx:-mt-20" id="neuvector"&gt;&lt;/span&gt;
&lt;a href="#neuvector" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a
href="https://open-docs.neuvector.com/deploying/openshift"target="_blank" rel="noopener"&gt;Deploy Separate NeuVector Components with RedHat OpenShift - Neuvector Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a
href="https://open-docs.neuvector.com/configuration/console/replacecert"target="_blank" rel="noopener"&gt;Replacing Self-Signed Certificate - Neuvector Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Self-Signed Certificate&lt;span class="hx:absolute hx:-mt-20" id="self-signed-certificate"&gt;&lt;/span&gt;
&lt;a href="#self-signed-certificate" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a
href="https://ji3g4zo6qi6.medium.com/openssl-public-key-and-private-key-certificate-28b990457496"target="_blank" rel="noopener"&gt;OpenSSL&amp;amp; public key and private key &amp;amp; Certificate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a
href="https://stackoverflow.com/questions/48958304/pkcs1-and-pkcs8-format-for-rsa-private-key"target="_blank" rel="noopener"&gt;PKCS#1 and PKCS#8 format for RSA private key&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a
href="https://razeen.me/posts/introduce-pkcs/"target="_blank" rel="noopener"&gt;簡單了解 PKCS 規範&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a
href="https://devopscube.com/create-self-signed-certificates-openssl/"target="_blank" rel="noopener"&gt;How to Create Self-Signed Certificates using OpenSSL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;OpenShift Route&lt;span class="hx:absolute hx:-mt-20" id="openshift-route"&gt;&lt;/span&gt;
&lt;a href="#openshift-route" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a
href="https://medium.com/swlh/understanding-openshift-route-bd973d8a620a"target="_blank" rel="noopener"&gt;Understanding OpenShift Route&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a
href="https://docs.openshift.com/container-platform/4.12/networking/routes/secured-routes.html#nw-ingress-creating-a-passthrough-route_secured-routes"target="_blank" rel="noopener"&gt;Creating a passthrough route - RedHat Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>NeuVector Onboarding and Best Practices Guide</title><link>https://blog.kubeantony.com/archive/security/neuvector-onboarding-and-best-practices-guide/</link><pubDate>Wed, 21 Aug 2024 09:14:24 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/neuvector-onboarding-and-best-practices-guide/</guid><description>
&lt;style&gt;
.indent-title-1{
margin-left: 1em;
}
.indent-title-2{
margin-left: 2em;
}
.indent-title-3{
margin-left: 3em;
}
&lt;/style&gt;
&lt;h2&gt;Preface&lt;span class="hx:absolute hx:-mt-20" id="preface"&gt;&lt;/span&gt;
&lt;a href="#preface" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;可以透過點擊展開以下目錄，選擇想看的內容，跳轉至特定章節&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Neuvector 各 Container 所扮演的角色&lt;span class="hx:absolute hx:-mt-20" id="neuvector-各-container-所扮演的角色"&gt;&lt;/span&gt;
&lt;a href="#neuvector-%e5%90%84-container-%e6%89%80%e6%89%ae%e6%bc%94%e7%9a%84%e8%a7%92%e8%89%b2" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Manager&lt;/strong&gt;: 顯示 web-based console 的 stateless container。通常只需要一個，而且可以在任何地方執行。Manager 失敗不會影響 Controller 或 enforcer 的任何作業。但是，一些通知（事件）和最近的連線資料會被 Manager 快取到記憶體中，因此檢視這些資料會受到影響。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Controller&lt;/strong&gt;: NeuVector 的 「control plane」，應該部署在 HA 的架構中，以便在節點故障時不會遺失設定。Controller 可在任何地方執行，但在許多情況下，由於其關鍵性，客戶會選擇將其放置在「management」、master node或 infra node 上。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;enforcer&lt;/strong&gt;: 此 container 作為 daemonset 部署，因此每個要保護的節點上都有一個 Enforcer。通常會部署到每個 Worker 節點，但也可以部屬到 master 和 infra 節點。注意：如果 Enforcer 不在叢集中的節點上，且連線來自該節點上的 Pod，這些 workloads 在 NeuVector 中會顯示為「unmanaged」workloads。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;scanner&lt;/strong&gt;: 根據 Controller 的指示，使用內建的 CVE 資料庫執行弱點掃描。可部署多個 scanner 以增加掃描容量。 scanner 可在任何地方執行，但通常在 Controller 執行的節點上執行。scanner 節點的大小考量請參閱下文。當 scanner 用於建立階段掃描時，也可以獨立調用，例如在 pipeline 中觸發掃描、擷取結果並停止 scanner 。 scanner 包含最新的 CVE 資料庫，因此應每日更新。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;updater&lt;/strong&gt;: 當需要更新 CVE 資料庫時，updater 會透過 Kubernetes cron job 觸發 scanner 的更新。請務必針對您的環境進行設定。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Architecture&lt;span class="hx:absolute hx:-mt-20" id="architecture"&gt;&lt;/span&gt;
&lt;a href="#architecture" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;最簡單的部署模式是讓 Kubernetes 或 orchestrator 根據每個 Container 的記憶體（可能還有 cpu）需求，決定將每個 Contiainer 放置在哪裡。對於每個節點資源相近的叢集，而且可以保證所有 workloads 都有足夠的空間，這樣就沒問題了。其他考慮因素，例如獨立節點的維護週期、網路隔離和大小，都可能影響 NeuVector containers 的放置位置（在每個受保護節點上執行的 Enforcer 除外）。 下圖顯示了部署模式範例以及 NeuVector 部署的彈性 :&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/HyLNwZmoC.png" alt="image" loading="lazy" /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Kubernetes 可以將 NeuVector Container 放置在任何節點 (在此例中為 worker 節點) 上的部署，除非也啟用了調度至 Master node。在 EKS、AKS 等公有雲管理服務中，NeuVector 只能在 worker 節點上執行。最常見的部署。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/SkZiv-XiC.png" alt="image" loading="lazy" /&gt;&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;NeuVector control plane 的 Container 和 scanner 是透過 taints/tolerations 或 labels 放置在 Master node 上。Master node 可根據 control plane 的需求適當調整 node 資源的大小。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/HJgDuW7oA.png" alt="image" loading="lazy" /&gt;&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;類似於 2，但會選擇 node 來執行 NeuVector control plane 和 scanners。這些節點可以是 worker node，而且大小適當。請注意，其中一個 NeuVector node 也允許 workloads 在上面執行，而其他節點則不允許 workloads 在上面執行。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/H1Cgtbms0.png" alt="image" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;NeuVectorcontrol plane 和 scanners 在 Master node 或 專用節點上執行，但由於 Master node 或專用節點上沒有 workloads ，因此不會在主節點或專用節點上部署 Enforcer。在這種情況下，NeuVector 不會監控在主節點上執行的 system containers，這與公有雲的情況類似。&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa"&gt;&lt;/span&gt;
&lt;a href="#qa" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q: 是否可以在同一個節點上執行兩個或兩個以上的 Controller？
A: 可以，但如果節點領便當，該節點上的所有 Controller 都會丟失。範例部署的 yaml 中有一個「affinity」設定，預設會偏好在不同節點上部署 Controller。
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;apiVersion: apps/v1
kind: Deployment
metadata:
name: neuvector-controller-pod
namespace: neuvector
spec:
template:
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- neuvector-controller-pod
topologyKey: &amp;#34;kubernetes.io/hostname&amp;#34;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;這個 AntiAffinity 規則告訴 Kubernetes 的 scheduler，當指派新的 Pod 時，應該儘量避免將它們指派到已經有標籤 &lt;code&gt;app=neuvector-controller-pod&lt;/code&gt; 的 Pod 所在的節點上。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;Q: 我們應該在 master 節點和 infra 節點上部署 Enforcer 嗎？
A: 是的，如果可能，建議這樣做，這樣它也可以監控這些節點上的 Container 和網路流量。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Sizing and Scale&lt;span class="hx:absolute hx:-mt-20" id="sizing-and-scale"&gt;&lt;/span&gt;
&lt;a href="#sizing-and-scale" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;NeuVector Containers 需要足夠的記憶體和 cpu 才能正常運作。這是規劃部署架構時最重要的考量。確保每種 NeuVector Containers 的最低需求 (通常為 1GB RAM) 已經分配且可用。在某些情況下，這應該增加，例如 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Large image scanning&lt;/strong&gt;。Scanner Containers 必須有足夠的記憶體，才能將要掃描的 Container images 拉入記憶體並展開。如果要掃瞄大於 1GB 的 Container images ，請將掃瞄機的記憶體增加至略高於預期的最大 Container images 大小。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;在保護模式下，預期網路連線數很高&lt;/strong&gt;。Enforcer 在保護（線上防火牆封鎖）模式下需要 CPU 和記憶體來保持和檢查連線及可能的有效負載 (DLP)。增加記憶體並將一個 CPU 核心專用於 Enforcer 可確保足夠的封包過濾能力。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Tip： 在 NeuVector Container 上設定不足的 Pod 資源限制，可能會導致意想不到的行為。我們建議您不要在 NeuVector Pod 上設定任何記憶體或 CPU 約束（最大值），如果有需要，請確保根據 staging/production 環境（目標 workloads 規模）中的實際效能特性，有足夠的可用空間。&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;其他擴充考量&lt;span class="hx:absolute hx:-mt-20" id="其他擴充考量"&gt;&lt;/span&gt;
&lt;a href="#%e5%85%b6%e4%bb%96%e6%93%b4%e5%85%85%e8%80%83%e9%87%8f" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;K8s 叢集中的節點數量&lt;/strong&gt;。隨著叢集中節點數量的增加，從每個 enforcer 到 controllers 的網路連接將共同增加。此外，在 Web 控制台中檢視節點的實際管理可能會變得更具挑戰性。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;節點上的 Pod（ workloads ）數量&lt;/strong&gt;。節點上 Pod 的數量會影響資源消耗，並可能影響網路流量 (節點上 Pod 與 Pod 之間或與其他節點之間的網路流量)。NeuVector Enforcer 也將會有更多的 Pods 來收集掃描資料和合規性資料，以傳送給 controllers。&lt;/li&gt;
&lt;li&gt;叢集中的 Namespaces、Containers 和其他資產數量。隨著 Containers、 Namespaces、群組和其他資產的增加，主控台中的各種顯示會變得更繁忙，可能需要更多的時間來載入。大多數畫面都有篩選器可用，以快速隔離要檢視的 Namespaces或 Containers/pod。&lt;/li&gt;
&lt;li&gt;Registry 中要掃描 Container images 的數量。如果 Registry 中的 Container images 數量超過一千個，且/或掃描或重新掃描整個 Registry/repository 所需的時間超過預期，請考慮在不同節點上部署多個 scanner pod。請記住，每個 scanner pod 會在掃描期間消耗其主機上的資源。自動擴展功能可設定為自動擴展可用 scanner pod 的數量，以滿足需求。&lt;/li&gt;
&lt;li&gt;聯邦中的叢集數量。多叢集 Primary 會在其與遠端叢集之間啟動雙向連線。此外，如果部署了聯邦規則，這些規則會在發生任何變更時推送至所有遠端叢集。&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;提示： 在與預期生產環境相似的環境中，觀察所有 pod（包括 NeuVector）的記憶體和 CPU 消耗統計，以確保沒有觀察到任何不利影響。&lt;/p&gt;
&lt;p&gt;提示：在網路拓樸中，選擇一個或多個 namespaces 和核取標記，以將檢視限制為選取的物件。這將使地圖的載入速度更快。&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-1"&gt;&lt;/span&gt;
&lt;a href="#qa-1" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q：運行 Controller 的 Host 主機最低規格為何？
A：假設 Controller 將與其他系統的 Containers 或 workloads 一起執行，我們建議至少使用 16 GB RAM 和 4 個 CPU 核心。&lt;/li&gt;
&lt;li&gt;Q：NeuVector 最多可支援多少節點？
A：NeuVector 沒有硬性的限制，但是根據環境和主機資源的不同，超過 500 個節點的叢集可能會遇到實際的困難。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Deployment and Initial Configuration&lt;span class="hx:absolute hx:-mt-20" id="deployment-and-initial-configuration"&gt;&lt;/span&gt;
&lt;a href="#deployment-and-initial-configuration" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-2"&gt;&lt;/span&gt;
&lt;a href="#qa-2" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q：樣本部署預設值需要做哪些變更？
A：變更可能包括：
&lt;ol&gt;
&lt;li&gt;Manager Service 的存取方法。Loadbalancer、nodeport、ingress controllers &amp;hellip;等。&lt;/li&gt;
&lt;li&gt;如果從不同的 Registries 拉取重新命名或重新標記的 Container Image。就要修改 Container Image Path&amp;rsquo;s/Registries/names/version。&lt;/li&gt;
&lt;li&gt;Container run-time 的 volume mounts。預設 containerd、CRI-O、docker 及其他需要變更磁碟區掛載的 run-times。&lt;/li&gt;
&lt;li&gt;多叢集 (主叢集/遠端叢集)。如果需要多叢集，請啟用 service access。&lt;/li&gt;
&lt;li&gt;Controller、scanner Replicas 的數量。Controller 的 Replcas 預設值為 3。&lt;/li&gt;
&lt;li&gt;用於 Control-plane 節點部署的 Taints/tolerations。用於控制 Controller 被部署在哪些節點，或 enforcers 是否應該部署在 master node 上。&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Managing NeuVector&lt;span class="hx:absolute hx:-mt-20" id="managing-neuvector"&gt;&lt;/span&gt;
&lt;a href="#managing-neuvector" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;大多數 NeuVector 部署至少部分是透過網頁式主控台來管理。然而，REST API、CLI、configMaps 和 CRD 都可用於 non-console-based (非控制台管理)。&lt;/p&gt;
&lt;p&gt;Tip： 在「My Profile」功能表 (右上方) 中，增加「Session Timeout」，這樣您就不會在 5 分鐘後登出。&lt;/p&gt;
&lt;p&gt;簡單的部署可以使用整合式 load balancer (例如 EKS、AKS、GKE、IKS 上的 load balancer) 來啟用 Manager 服務的外部存取，或是開放一個 nodePort 供存取。請注意，nodePort 存取有其安全性考量，因為它會在每個節點上開放連接埠供外部存取，而不是強制透過 load balancer 或 ingress controller 進入入口。&lt;/p&gt;
&lt;p&gt;Tip： 使用 load balancer 或 ingress controller (例如 nginx) 來控制 NeuVector console 的存取。&lt;/p&gt;
&lt;p&gt;Tip：SSL 連線可以在入口 ingress controller 終止，並使用 HTTP 連線到 manager。在 Manager deployment 的 YAML 檔中使用環境變數關閉到 manager 的 SSL&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-3"&gt;&lt;/span&gt;
&lt;a href="#qa-3" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q：Manager container 可以在叢集外執行嗎？
A：可以，但這並不常見。Manager 需要將 controller 的 REST API 暴露在叢集之外。&lt;/li&gt;
&lt;li&gt;Q：NeuVector Manager 服務可以使用 Istio 等 service mesh 類型的 ingress controller 嗎？
A：不支援。請使用其他 Kubernetes ingress 方法。&lt;/li&gt;
&lt;li&gt;Q：Manager 可以管理多個叢集嗎？
A：可以，這需要部署 Multi-cluster federation (多叢集聯邦)的 controllers。可能還需要單獨的授權。&lt;/li&gt;
&lt;li&gt;Q：自簽證書可以更換嗎？
A：可以。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Policy Modes – Discover, Monitor, Protect&lt;span class="hx:absolute hx:-mt-20" id="policy-modes--discover-monitor-protect"&gt;&lt;/span&gt;
&lt;a href="#policy-modes--discover-monitor-protect" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;每個 Group 的 policy 模式會決定 NeuVector 在偵測到 processes、網路連線和檔案活動時會做什麼。一般而言，「Discover」模式應該用於測試和暫存環境，以建立保護應用程式 workloads 的白名單規則。Monitor 或 Protect 模式應在生產環境中使用，以回應 Security Events (安全事件)。也可在測試/暫存環境中使用「Monitor」或「Protect」模式，觀察 NeuVector 在生產環境中的預期 run-time 行為。&lt;/p&gt;
&lt;p&gt;Tip： 在「Discover」模式下部署 workloads 後，執行測試 script 或流量，以運用 Container 中的所有功能（網路連線、process、檔案）。當幾天未建立新規則時，請將群組切換至 Monitor 模式，並觀察至少一週。尋找 Notification -&amp;gt; Security Events，看看合法活動是否被警告。加入適當的網路或程序規則，將合法活動列入白名單。如果需要 Protect (封鎖) 模式，請將群組切換至 Protect 模式，並在接下來幾天特別注意任何被封鎖的活動。&lt;/p&gt;
&lt;p&gt;Tip：預設會啟用 Container 中的程序和檔案保護的 Zero-drift 模式。這對於允許有限 functions/processes 的強化 Container 非常有用。&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-4"&gt;&lt;/span&gt;
&lt;a href="#qa-4" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q：在轉移至「Monitor」或「Protect」模式之前，我應該讓群組處於「Discover」模式多久？
A：在執行所有應用程式測試，並確定 NeuVector 已學會所有網路連線和程序之後，最快也要幾個小時。也可能需要數天或一週的時間。舉例來說，有些開放原始碼工具會定期與外部連線以檢查更新，而您可能看不到這些連線。您應該決定是否允許這些外部連線，如果允許，就為它們加入白名單規則。好的做法是將規則匯出為 CRD yaml 檔案，並與應用程式開發人員一起檢閱，以確認預期的行為。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Backups and Persistent Data&lt;span class="hx:absolute hx:-mt-20" id="backups-and-persistent-data"&gt;&lt;/span&gt;
&lt;a href="#backups-and-persistent-data" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;NeuVector 的設定以及任何狀態資料 (連線、通知等) 都會在可用的 controllers 之間同步。但是，如果所有 controllers 都領便當，設定和狀態資料就會遺失。若要讓 NeuVector 在領便當後自動復原叢集的組態，請啟用 persistent volume。當 controllers 啟動時，它們會從 persistent volume 中提取最新備份的設定資訊。&lt;/p&gt;
&lt;p&gt;Tip： 建立 RWX persistent volume 來自動備份 NeuVector 設定，並在任何 NeuVector、主機作業系統或 orchestrator 更新（重新開機）之前，定期透過 Web Console 或 REST API 進行手動匯出備份。某些公共雲端儲存系統不支援 RWX，因此可能需要部署 NFS 等獨立儲存設備。&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-5"&gt;&lt;/span&gt;
&lt;a href="#qa-5" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q：匯出的備份檔案可以匯入不同的群集進行設定嗎？
A：不建議這樣做，因為名稱、namespace、IP 位址、system container 或其他組態設定的變更，可能在目標群集中無法運作。請使用 Helm、configMaps 和 CRD 來自動設定叢集。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Integration Into CI/CD Pipeline&lt;span class="hx:absolute hx:-mt-20" id="integration-into-cicd-pipeline"&gt;&lt;/span&gt;
&lt;a href="#integration-into-cicd-pipeline" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;安全應該儘可能整合並自動化到 CI/CD pipeline 中。漏洞與合規性管理將在下一節說明。整合可使用 NeuVector 的 plug-ins (外掛程式)與支援介面，或使用 REST API 自訂。 Admission control 是 Pipeline 與生產環境之間的重要橋樑，建議啟用。&lt;/p&gt;
&lt;p&gt;Tip：在 Policy -&amp;gt; Admission Control 中啟用並測試 admission controller。然後建立一些簡單的規則來阻止未經授權的部署。即使尚未設定 registry scan，根據 registry 的名稱、namespace 或其他一般條件的規則，也可針對 Container image 的部署提供保障。&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Enterprise Integration: Alerts, Notifications, SIEM/SYSLOG, Webhooks&lt;span class="hx:absolute hx:-mt-20" id="enterprise-integration-alerts-notifications-siemsyslog-webhooks"&gt;&lt;/span&gt;
&lt;a href="#enterprise-integration-alerts-notifications-siemsyslog-webhooks" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;NeuVector 在「Notifications」功能表中顯示 alerts，並透過 SYSLOG、webhooks 或 Prometheus exporter 匯出事件。事件也可以使用 REST API 匯出。NeuVector 會顯示每種事件類型 (security events、risk reports 及一般事件) 的最新事件。不過，這些資料僅限於每種類型最近的 4K 事件。預期事件將透過 SYSLOG 或其他方式匯出，以進行永久儲存、alerting 及進階處理。&lt;/p&gt;
&lt;p&gt;Tip：使用 webhooks 將特殊事件通知直接傳送至 webhook endpoint (例如 Slack) 或叢集內的自訂 webhook receptor container，以便進行額外處理。&lt;/p&gt;
&lt;p&gt;Tip: 提示： 若要與 alerting/paging 系統、case management (案件管理)系統或 SIEM 自訂整合，請使用 REST API、webhooks 或其組合。&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Policy Migration – Staging to Production&lt;span class="hx:absolute hx:-mt-20" id="policy-migration--staging-to-production"&gt;&lt;/span&gt;
&lt;a href="#policy-migration--staging-to-production" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;一旦應用程式經過測試，且 NeuVector 的執行時 security rules 經過驗證，就應該將規則複製到生產環境中。&lt;/p&gt;
&lt;p&gt;Tip：使用 NeuVector CRD 將 security rules 從暫存環境匯出、檢閱、登入及遷移到生產環境。&lt;/p&gt;
&lt;p&gt;Tip：在生產環境中，在「Settings」-&amp;gt;「Configuration」中將「New Services Mode」設定為「Monitor」或「Protect」，以防止任何未知服務啟動而不產生警示。在部署任何新的 workloads 之前，請確保透過 CRD、REST API 或主控台部署白名單規則 (程序、網路、檔案)，以便 workloads 可以在受保護狀態下不中斷地開始執行。&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-6"&gt;&lt;/span&gt;
&lt;a href="#qa-6" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Q：在轉移到生產環境之前，我們應該在暫存環境中運行多久？
A：確保您的暫存環境擁有與生產環境相同的 node、orchestrator、system containers 及其他重要資產。也應該測試預期在生產中的 Initial application workloads，但預期新的和更新的應用程式會持續發生。對於初始部署，這通常需要在暫存環境中進行幾週的測試，而對於新增或更新的 application workloads，則需要幾天到幾週的時間。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Q：我們應該在生產中以「Monitor」或「Protect」模式執行嗎？
A：一開始，我們建議您在生產中以 Monitor 模式執行所有群組數天或數週，直到您對通知中偵測到的任何安全事件感到滿意為止。然後，您可以切換到 Protect 模式，只針對希望 NeuVector 阻擋網路、程序和檔案違規的群組。這可以根據具有出口連線的群組、關鍵資料庫，或是您 100% 確信所有預期行為都已列入白名單的 workloads 來決定。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Q：我可以使用「Settings」-&amp;gt;「Configuration」中的 export/import 設定檔案來進行遷移嗎？
答：不建議這樣做，因為名稱、namespace、IP 位址、system containers 或其他設定可能有變，無法在目標叢集中運作。使用 CRD 來進行遷移，方法是匯出群組規則，並在 yamls 中編輯這些規則，以反映生產環境中的任何變更，然後再進行部署。ConfigMaps 可用於在暫存環境和生產環境中一致配置其他設定。&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-1"&gt;
&lt;blockquote&gt;
&lt;p&gt;References&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using CRD: &lt;a
href="https://open-docs.neuvector.com/policy/usingcrd"target="_blank" rel="noopener"&gt;https://open-docs.neuvector.com/policy/usingcrd&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;h2&gt;Vulnerability and Compliance Management&lt;span class="hx:absolute hx:-mt-20" id="vulnerability-and-compliance-management"&gt;&lt;/span&gt;
&lt;a href="#vulnerability-and-compliance-management" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;每家公司都會有不同的流程和標準來管理 Vulnerability (漏洞)和 Compliance (合規性) 測試。NeuVector 可彈性適應您的流程。&lt;/p&gt;
&lt;p&gt;弱點與法規遵循管理的主要最佳實務包括：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;要求開發人員在有修復方法時修復關鍵弱點，並盡可能在建立階段就停止或警示。&lt;/li&gt;
&lt;li&gt;如果在 registry 中的現有 (已核准) Container images 或生產環境的 Container 中發現新的弱點，通知開發人員或適當的團隊。&lt;/li&gt;
&lt;li&gt;提供寬限期，讓開發人員修復關鍵弱點，但確保運作中的 workloads 受到 NeuVector 白名單規則與「virtual patching」的保護。請參閱以下有關 virtual patching 的 Q&amp;amp;A 與參考連結， virtual patching 可保護執行漏洞的容器。&lt;/li&gt;
&lt;li&gt;允許開發人員與 devops 團隊申請政策的例外情況，並能夠忽略某些漏洞掃描警示 (根據 CVE 編號)。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Tip：利用欄位「已修復」、「發佈日期」和自訂「Author/developer」 的 metadata，自動執行政策，要求開發者修復已發佈超過 7 天 (寬限期) 的弱點 (已修復)。&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-7"&gt;&lt;/span&gt;
&lt;a href="#qa-7" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q：為什麼 NeuVector 的掃描報告與我使用的其他 scanner 不同？
A：每家掃描廠商都維護自己的 CVE 資料庫，以及對 CVE 來源的詮釋，例如嚴重性/關鍵性等級。&lt;/li&gt;
&lt;li&gt;Q：NeuVector 是否可以在 Container images 推送到 registry 時立即進行掃描？
A：有些 registry (例如 Openshift) 支援 imagestreams，可讓 NeuVector 在 Container images 推送時自動掃描。對於其他 registry，則可設定定期掃描，每隔幾分鐘或幾小時掃描一次新 Container images。對於真正的按需掃描，可使用 REST API 在特定 Container images 推送至 registry 後觸發掃描。&lt;/li&gt;
&lt;li&gt;Q：什麼是 Virtual Patching (虛擬修補)？
A：NeuVector 所使用的這個詞彙，是指在生產環境中運行的 Container，如果存在 critical 的漏洞，NeuVector 在 Monitor 或 Protect 模式下運行時，會對其進行「virtually patched (虛擬修補)」，因為任何利用漏洞的嘗試都會立即被偵測到並封鎖，因為它會創建未經授權的 process、網路連線或檔案存取。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Compliance Management&lt;span class="hx:absolute hx:-mt-20" id="compliance-management"&gt;&lt;/span&gt;
&lt;a href="#compliance-management" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;NeuVector 的 Compliance (合規性)檢查包括 CIS benchmarks (docker、kubernetes、openshift 等) 以及自訂合規性檢查 (在 Container 或主機上執行的 script)。這些都可以針對 PCI、GDPR 等各種產業標準進行 tag 與報告。&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-8"&gt;&lt;/span&gt;
&lt;a href="#qa-8" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q：我可以自訂合規性報告嗎？
A：可以，透過標記適當的合規檢查，可以建立 PCI、GDPR 及其他的標準報告。每項報告都可以自訂，以包含或排除某些檢查。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Improving the Security Risk Score in the Dashboard&lt;span class="hx:absolute hx:-mt-20" id="improving-the-security-risk-score-in-the-dashboard"&gt;&lt;/span&gt;
&lt;a href="#improving-the-security-risk-score-in-the-dashboard" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;Dashboard 提供整體安全風險評分，該評分根據 Container 的 Policy 模式、ingress/egress 連線、vulnerabilities (弱點)、privileged/root Container 和 admission
control。使用分數旁邊的精靈工具來逐步改善您的分數。&lt;/p&gt;
&lt;p&gt;Tip：通常不可能將風險分數降至零，因為任何執行中的 Container、Kubernetes system container 或 egress 連線都代表風險。任何在「良好」範圍（小於 20）內的分數都被認為是可以接受的。&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Network Rules – Ingress, Egress, Segmentation&lt;span class="hx:absolute hx:-mt-20" id="network-rules--ingress-egress-segmentation"&gt;&lt;/span&gt;
&lt;a href="#network-rules--ingress-egress-segmentation" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;網路 Segmentation (分割)、檢查和保護是 run-time 最重要的安全防護措施。應仔細檢閱和調整網路規則，以達到所需的行為（允許、警示、封鎖）。NeuVector 在「發現」模式下學習到的網路規則，在某些情況下會變得支離破碎，例如 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;連線來源或目的地總是在變，因為使用的是隨機連接埠，例如透過 load balancer 或 ingress 連接&lt;/li&gt;
&lt;li&gt;部屬同一應用程式的 Pod 或同一應用程式的新版本在命名慣例中有版本號或隨機字串，導致 NeuVector 認為這是一個新應用程式，並為其建立新規則。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Tip： 透過在 Policy -&amp;gt; Network Rules 中篩選應用程式，檢視並編輯影響每個應用程式的網路規則。如果您注意到許多規則重複出現，且出發地或目的地的 IP 位址、連接埠或節點不斷變更，請考慮如何根據通訊協定、標籤或其他條件 (有或沒有通配符) 建立更高層級的網路規則，以整合這些規則。&lt;/p&gt;
&lt;p&gt;Egress 的連接可能是高風險的來源，因此應加以評估，並在可能的情況下，聲明只允許存取特定目的地。&lt;/p&gt;
&lt;p&gt;Tip： 為需要存取叢及外部的 workloads 建立自訂出口規則。使用 &lt;code&gt;address=&amp;lt;destination&amp;gt;&lt;/code&gt; 建立目標 (目的地) 自訂群組，並建立相對應的網路規則，允許從 Pod 群組存取到目標群組，可能的話使用應用程式通訊協定 (例如 MySQL、redis、mongodb、SSL 等)。&lt;/p&gt;
&lt;p&gt;在部署過程中套用的 Pod 標籤也可以用來強制執行規則。舉例來說，&lt;code&gt;scope=cde&lt;/code&gt;、&lt;code&gt;scope=non_cde&lt;/code&gt;、&lt;code&gt;external_access=allowed&lt;/code&gt; 都是標籤的範例，這些標籤可以套用到 Pod，並在 NeuVector 中為這些 Pod 建立規則。可以建立符合標籤的自訂群組，並將規則套用至該群組。&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-9"&gt;&lt;/span&gt;
&lt;a href="#qa-9" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q：網路規則可以訂製嗎？
A：可以，自訂和學習的網路規則可以透過 console 或 REST API 排序。聯邦規則和 CRD 建立的規則無法編輯，且總是先進行評估（即優先於其他規則）。&lt;/li&gt;
&lt;li&gt;Q：建立自訂群組時，可以使用通配符嗎？
Q：可以，通配符通常支援在條件中使用，例如 &lt;code&gt;address=*.google.com&lt;/code&gt;。如果需要更靈活的匹配，也可以使用 regex 表達式，用 &lt;code&gt;~&lt;/code&gt; 符號表示，例如 &lt;code&gt;label~my.label*-xyz&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;Q：我可以將自訂群組的 &lt;code&gt;policymode&lt;/code&gt; 變更為 Monitor 或 Protect 嗎？
A：目前自訂群組的政策模式是無法設定的，因為所引用的底層 Pod 可能處於不同的模式 (Discover、Monitor、Protect)。&lt;/li&gt;
&lt;li&gt;Q：DLP 網路 payload 檢查 regex 引擎可否用於其他政策？
A：可以，它可以用於 secrets 檢查、檢查 HTTP 標頭或路徑，或其他用途。&lt;/li&gt;
&lt;li&gt;Q：某些群組可以設定為 block，而其他群組只設定為警示嗎？
A：可以，NeuVector 中每個已學習的「Group」都可以有不同的模式：「Discover」、「Monitor」或「Protect」。&lt;/li&gt;
&lt;li&gt;Q：是否可以將「Group」設定為封鎖外部 egress 連線，但只在叢集或 namespace 中的其他 pod 違規時發出警示？
A：目前不可以。群組對於所有流量只能使用一種模式。我們正考慮在未來的版本中使用更細緻的政策。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Automation – REST API&lt;span class="hx:absolute hx:-mt-20" id="automation--rest-api"&gt;&lt;/span&gt;
&lt;a href="#automation--rest-api" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;使用 REST API 可直接在 Controller 上執行任何動作，而無需透過 Web console。Manager container 使用 REST API 存取 Controller。REST API 的預設連接埠為 &lt;code&gt;10443&lt;/code&gt;，可從叢集內部存取。若要從群集外部對 Controller 進行呼叫，請在外部將 REST API expose 為服務。&lt;/p&gt;
&lt;p&gt;Tip：在 script 中使用 REST API 來自動執行 Policy 備份、根據可疑活動的封包擷取、觸發 Container images 掃描、讀取掃描結果等工作。&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-10"&gt;&lt;/span&gt;
&lt;a href="#qa-10" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q： authentication (驗證) 和 authorization (授權) 如何執行？
A：api token 請求需要使用者帳號和密碼進行驗證。使用者的角色決定該使用者可透過 api 進行哪些動作。&lt;/li&gt;
&lt;li&gt;Q：token 可使用多久？
A：token 的持續時間與使用者個人資料中設定的使用者逾時時間相同。例如，如果超時設定為 10 分鐘 (600 秒)，只要在 10 分鐘內使用，token 就會有效。10 分鐘未使用後，它就會過期。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Automation – Security Policy, CRD&lt;span class="hx:absolute hx:-mt-20" id="automation--security-policy-crd"&gt;&lt;/span&gt;
&lt;a href="#automation--security-policy-crd" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;NeuVector Custom Resource Definition (CRD) 提供了一個強大的機制，可在 NeuVector 中宣告並自動化 security rules (安全規則)。它可讓安全、開發與開發人員協同討論與檢視允許的應用程式行為。&lt;/p&gt;
&lt;p&gt;Tip：使用 NeuVector 來學習應用程式在 staging/test 中的行為，然後將規則匯出為 CRD，以便與開發人員和 devops 團隊一起檢閱與核准。然後檢查 CRD，像管理其他「code (程式碼)」一樣管理安全政策。&lt;/p&gt;
&lt;p&gt;CRD 用來「宣告」一組 Groups、rules 和 NeuVector objects 的 policy 模式。一旦宣告後，就只能套用更新的 CRD 來編輯。&lt;/p&gt;
&lt;p&gt;Tip：使用 CRD 設定不與特定應用程式行為掛鉤的「global」安全規則，例如在「所有 Container」上防止 SSH 或 SCP (Container 是 NeuVector 中的保留群組名稱，可用於此)。或是允許外部 api 存取特定標籤的 Pod。&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Q&amp;amp;A&lt;span class="hx:absolute hx:-mt-20" id="qa-11"&gt;&lt;/span&gt;
&lt;a href="#qa-11" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Q：如何匯出應用程式的 CRD？
A：移至 Groups，選擇要匯出的 Group，然後按一下匯出 Group Policy。選取 Groups 的所有 rules，以及相關 Groups (即在 network rules [網路規則] 中定義為選取群組的來源或目的地的群組) 將會匯出。&lt;/li&gt;
&lt;li&gt;Q：在 CRD 中應用之前，我可以變更自訂群組的「policy mode」嗎？
A：目前，自訂 Group 的 policy mode 必須為 &lt;code&gt;null&lt;/code&gt;，因為所引用的底層 Pod 可能處於不同的模式 (Discover、Monitor、Protect)。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Reviewing Notifications and Reducing False Positives&lt;span class="hx:absolute hx:-mt-20" id="reviewing-notifications-and-reducing-false-positives"&gt;&lt;/span&gt;
&lt;a href="#reviewing-notifications-and-reducing-false-positives" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;在 NeuVector 部署的最初幾天或幾週內，應檢查事件以確定它們是否為誤報。有幾種方法可以減少誤報：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;檢視「Notifications」中的事件，如果適用，選擇「Review Rule」按鈕，立即新增違規事件的白名單規則。&lt;/li&gt;
&lt;li&gt;檢閱事件通知後，在適當的政策功能表中手動建立白名單規則 - admission control、process (Group 下)、network rules 等。&lt;/li&gt;
&lt;li&gt;建立 Response rule，以「抑制通知」這些類型的事件。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Tip： 盡可能建立白名單規則，以允許被報告為違反的行為。若要暫時壓制通知，請使用 Response rule，此規則稍後可輕鬆停用或移除。&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Updating – NeuVector, Nodes, Host OS, Orchestrator Platforms&lt;span class="hx:absolute hx:-mt-20" id="updating--neuvector-nodes-host-os-orchestrator-platforms"&gt;&lt;/span&gt;
&lt;a href="#updating--neuvector-nodes-host-os-orchestrator-platforms" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;NeuVector 支援對 critical containers 進行滾動式的更新，但對於環境的任何更新，都應該特別小心。controllers 之間會維持一個狀態，如果所有 controllers 同時不可用，這個狀態就會消失。因此，在升級 hosts/nodes (重新開機) 或 orchestrator (例如 Kubernetes) 時，請特別小心，即使已啟用節點 draining process。&lt;/p&gt;
&lt;p&gt;Tip： 對於主機作業系統或如 Kubernetes 等 orchestrator 平台的更新，需要重新啟動節點或排出 Pod 時，請確保至少有一個 NeuVector Controller 一直處於活動狀態。當重新啟動有 Controller 的節點時，請觀察新 Controller，以確保它至少有 60 秒（幾分鐘更好）處於 available (可用) 的狀態，以確保它有時間與領導 Controller 同步狀態，然後再重新啟動下一個有 Controller 的節點。&lt;/p&gt;
&lt;p&gt;Tip： 在更新 NeuVector、其運行的主機或 orchestrator 之前，請務必手動備份整個設定檔。您可以在 &lt;code&gt;Settings&lt;/code&gt; -&amp;gt; &lt;code&gt;Configuration&lt;/code&gt; -&amp;gt; &lt;code&gt;Export All&lt;/code&gt; 中匯出備份。&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Appendix - Pre-Deployment Checklist&lt;span class="hx:absolute hx:-mt-20" id="appendix---pre-deployment-checklist"&gt;&lt;/span&gt;
&lt;a href="#appendix---pre-deployment-checklist" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;收集所需的資訊
&lt;ul&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; NeuVector 版本和 K8s 版本。&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 拉取 NeuVector Container image 的 Dockerhub ID。&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 目標節點的 CPU/記憶體 設定文件。&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 正在使用的 Container run-time。&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; manager 使用 Ingress 的方法對外。&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; SYSLOG servers、LDAP/AD、SSO/SAML servers 的整合資訊。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;檢閱 &lt;a
href="https://open-docs.neuvector.com/"target="_blank" rel="noopener"&gt;NeuVector 官方文件&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 特別是第 1 節 &lt;a
href="https://open-docs.neuvector.com/basics/installation/native"target="_blank" rel="noopener"&gt;Deployment Preparation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 第 2 節 &lt;a
href="https://open-docs.neuvector.com/deploying/production"target="_blank" rel="noopener"&gt;Deploying&lt;/a&gt;。每個協調平台也在本節有特定的部署說明。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;準備目標環境
&lt;ul&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 如果不是從 NeuVector docker hub registry 動態拉取，請預先拉取 images。&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 建立 RWX 儲存空間（如果使用持久化儲存空間來備份設定） ‧&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;確保網路連通性
&lt;ul&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 測試從 Cluster 到 Registry 或 docker hub 拉取映像的能力。&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 啟用並測試從集群內部存取 Registry 以進行 Registry 掃描（如適用）。&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 透過 load balancer、route、IP/port（預設埠 8443），存取集群中的 manager service 的控制台。&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 檢查網路或本機防火牆（如 firewalld）是否阻擋 NeuVector 所需連接埠的存取。&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 啟用 SYSLOG（預設埠514）和 webhook 通知所需的 outbound connections。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;建立部署流程與範本
&lt;ul&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 決定部署方法： &lt;code&gt;Helm&lt;/code&gt;、&lt;code&gt;kubectl/yaml&lt;/code&gt; 檔案、&lt;code&gt;Operator&lt;/code&gt;&amp;hellip;&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 檢閱範例 yaml 檔案和 值 與設定選項&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; Kubernetes - &lt;a
href="https://open-docs.neuvector.com/deploying/kubernetes"target="_blank" rel="noopener"&gt;https://open-docs.neuvector.com/deploying/kubernetes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 從 Rancher Manager 部署 - &lt;a
href="https://opendocs.neuvector.com/deploying/rancher"target="_blank" rel="noopener"&gt;https://opendocs.neuvector.com/deploying/rancher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; Openshift - &lt;a
href="https://open-docs.neuvector.com/deploying/openshift"target="_blank" rel="noopener"&gt;https://open-docs.neuvector.com/deploying/openshift&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 在 Helm 中編輯 yamls 或部署值（如適用）：
&lt;ul&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; Manager 存取方式 - LoadBalancer、ingress、NodePort&amp;hellip;&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 啟用/停用多叢集 master 和 remote services&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; Container Images 名稱、版本標籤或 NeuVector images 的路徑&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 若為 containerd 或 CRI-O 則為 Container run-time&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; 控制 NeuVector Pod 部署位置的 Taints/tolerations 或節點標籤。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Ref&lt;span class="hx:absolute hx:-mt-20" id="ref"&gt;&lt;/span&gt;
&lt;a href="#ref" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a
href="https://open-docs.neuvector.com/assets/files/NV_Onboarding_5.0-e780f27e1cde02dad5ebf3650377aff0.pdf"target="_blank" rel="noopener"&gt;NeuVector Onboarding and Best Practices Guide
&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Neuvector Project Plan</title><link>https://blog.kubeantony.com/archive/security/neuvector-project-plan/</link><pubDate>Tue, 20 Aug 2024 03:38:56 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/neuvector-project-plan/</guid><description>
&lt;div role="img" aria-label="圖表"&gt;
&lt;pre class="mermaid hx:mt-6"&gt;
gantt
%% 宣告這是甘特圖
title Neuvector Project Plan
%% 給它一個標題
dateFormat MM-DD
%% 日期格式
axisFormat %m-%d
%% 縱軸的日期格式
section Deploy
%% 宣告一個區塊
Testing : active, work, 09-01, 2d
Dev : active, dev, after work, 2d
Production : active, production, 09-07, 2d
%%語法：
%%甘特圖上的任務名稱 : [crit], [active|done], 任務名稱, [日期|after 任務名稱], 長度
section 功能驗測
Testing : active, b1, after dev, 1d
Dev : active, b2, after b1, 1d
Production :active, b3, after production, 1d
section Report
Report : active, b4, after b3, 1d
%%todayMarker off
&lt;/pre&gt;
&lt;/div&gt;</description></item><item><title>Helm Install Neuvector on community Kubernetes</title><link>https://blog.kubeantony.com/archive/security/helm-install-neuvector-on-community-kubernetes/</link><pubDate>Sat, 06 Jul 2024 08:02:38 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/helm-install-neuvector-on-community-kubernetes/</guid><description>
&lt;style&gt;
.indent-title-1{
margin-left: 1em;
}
.indent-title-2{
margin-left: 2em;
}
.indent-title-3{
margin-left: 3em;
}
&lt;/style&gt;
&lt;h1&gt;Preface&lt;/h1&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;本篇文章會介紹以下內容&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;如何透過 Helm 安裝 Neuvector 5.2.0&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;可以透過點擊展開以下目錄，選擇想看的內容，跳轉至特定章節&lt;/p&gt;
&lt;/div&gt;
&lt;h1&gt;測試環境&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;master node resource:
&lt;ul&gt;
&lt;li&gt;os: Alpine Linux 3.18.2&lt;/li&gt;
&lt;li&gt;memory: 4 G&lt;/li&gt;
&lt;li&gt;CPU: 2 Core&lt;/li&gt;
&lt;li&gt;cri-o: 1.27&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;w1 node resource:
&lt;ul&gt;
&lt;li&gt;os: Alpine Linux 3.18.2&lt;/li&gt;
&lt;li&gt;memory: 8 G&lt;/li&gt;
&lt;li&gt;CPU: 2 Core&lt;/li&gt;
&lt;li&gt;cri-o: 1.27&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;w2 node resource:
&lt;ul&gt;
&lt;li&gt;os: Alpine Linux 3.18.2&lt;/li&gt;
&lt;li&gt;memory: 8 G&lt;/li&gt;
&lt;li&gt;CPU: 2 Core&lt;/li&gt;
&lt;li&gt;cri-o: 1.27&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;確認 K8S Node 狀態&lt;span class="hx:absolute hx:-mt-20" id="確認-k8s-node-狀態"&gt;&lt;/span&gt;
&lt;a href="#%e7%a2%ba%e8%aa%8d-k8s-node-%e7%8b%80%e6%85%8b" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;kubectl get nodes -o wide&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
c1m1 Ready control-plane 45m v1.27.4 120.96.143.212 &amp;lt;none&amp;gt; Alpine Linux v3.18 6.1.39-0-virt cri-o://1.27.0
c1w1 Ready worker 45m v1.27.4 120.96.143.219 &amp;lt;none&amp;gt; Alpine Linux v3.18 6.1.39-0-virt cri-o://1.27.0
c1w2 Ready worker 45m v1.27.4 120.96.143.220 &amp;lt;none&amp;gt; Alpine Linux v3.18 6.1.39-0-virt cri-o://1.27.0&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h1&gt;Install Neuvector&lt;/h1&gt;&lt;h2&gt;準備 Neuvector 5.2.0 的 Image 壓縮檔&lt;span class="hx:absolute hx:-mt-20" id="準備-neuvector-520-的-image-壓縮檔"&gt;&lt;/span&gt;
&lt;a href="#%e6%ba%96%e5%82%99-neuvector-520-%e7%9a%84-image-%e5%a3%93%e7%b8%ae%e6%aa%94" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a
href="https://drive.google.com/file/d/12dlIHkbCKFDHonNllP7l1cTdQ9G999dO/view?usp=drive_link"target="_blank" rel="noopener"&gt;下載連結&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;將 image 都準備到 Kubernetes 中的每一台 Node 上&lt;/li&gt;
&lt;li&gt;或是執行以下 Command ，程式會在每一台主機座以下動作，
&lt;ul&gt;
&lt;li&gt;到我的下載連結把 Image 的壓縮檔下載下來&lt;/li&gt;
&lt;li&gt;透過 &lt;code&gt;sudo podman load&lt;/code&gt; 將 Image 壓縮檔還原成 Image&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="indent-title-2"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ kubectl apply -f https://raw.githubusercontent.com/braveantony/k8s-yaml/main/prepare-neuvector-image.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;注意，以上方法只適用於 K8S 的 CRI 是 &lt;code&gt;CRI-O&lt;/code&gt;，並且每台主機有裝 Podman&lt;/li&gt;
&lt;li&gt;此方法會占用大約 4 G 的記憶體&lt;/li&gt;
&lt;li&gt;看 log 命令 : &lt;code&gt;kubectl logs -f -l app=install-neuvector-image -c install-neuvector-image&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2&gt;Install Helm3&lt;span class="hx:absolute hx:-mt-20" id="install-helm3"&gt;&lt;/span&gt;
&lt;a href="#install-helm3" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;check helm version&lt;span class="hx:absolute hx:-mt-20" id="check-helm-version"&gt;&lt;/span&gt;
&lt;a href="#check-helm-version" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ helm version&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;version.BuildInfo{Version:&amp;#34;v3.12.2&amp;#34;, GitCommit:&amp;#34;1e210a2c8cc5117d1055bfaa5d40f51bbc2e345e&amp;#34;, GitTreeState:&amp;#34;clean&amp;#34;, GoVersion:&amp;#34;go1.20.5&amp;#34;}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Adding chart repo&lt;span class="hx:absolute hx:-mt-20" id="adding-chart-repo"&gt;&lt;/span&gt;
&lt;a href="#adding-chart-repo" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ helm repo add neuvector https://neuvector.github.io/neuvector-helm/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;&amp;#34;neuvector&amp;#34; has been added to your repositories&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;透過 Helm 安裝 Neuvector 5.2.0&lt;span class="hx:absolute hx:-mt-20" id="透過-helm-安裝-neuvector-520"&gt;&lt;/span&gt;
&lt;a href="#%e9%80%8f%e9%81%8e-helm-%e5%ae%89%e8%a3%9d-neuvector-520" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ helm install neuvector --namespace neuvector --create-namespace neuvector/core \
--set crio.enabled=true \
--set tag=5.2.0 \
--set controller.replicas=1&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;pre&gt;
NAME: neuvector
LAST DEPLOYED: Mon Jul 24 11:18:20 2023
NAMESPACE: neuvector
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
&lt;font color=blue&gt;Get the NeuVector URL by running these commands:
NODE_PORT=$(kubectl get --namespace neuvector -o jsonpath="{.spec.ports[0].nodePort}" services neuvector-service-webui)
NODE_IP=$(kubectl get nodes --namespace neuvector -o jsonpath="{.items[0].status.addresses[0].address}")
echo https://$NODE_IP:$NODE_PORT&lt;/font&gt;
&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;可以透過 Helm 給的資訊，取得 NeuVector URL&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;h2&gt;檢查 Neuvector Pod 運作狀態&lt;span class="hx:absolute hx:-mt-20" id="檢查-neuvector-pod-運作狀態"&gt;&lt;/span&gt;
&lt;a href="#%e6%aa%a2%e6%9f%a5-neuvector-pod-%e9%81%8b%e4%bd%9c%e7%8b%80%e6%85%8b" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ kubectl -n neuvector get pod&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME READY STATUS RESTARTS AGE
neuvector-controller-pod-85bd66d98-g2jwx 1/1 Running 0 10m
neuvector-enforcer-pod-bfnht 1/1 Running 0 10m
neuvector-enforcer-pod-f6xvb 1/1 Running 0 10m
neuvector-enforcer-pod-zpb5p 1/1 Running 0 10m
neuvector-manager-pod-5894fd44b9-hdq6n 1/1 Running 0 10m
neuvector-scanner-pod-6c68cc78d6-6rg55 1/1 Running 0 3m10s
neuvector-scanner-pod-6c68cc78d6-k96hk 1/1 Running 0 3m9s&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;將 neuvector-scanner-pod 這個 Deployment 的 ImagePullPolicy 改為 IfNotPresent&lt;span class="hx:absolute hx:-mt-20" id="將-neuvector-scanner-pod-這個-deployment-的-imagepullpolicy-改為-ifnotpresent"&gt;&lt;/span&gt;
&lt;a href="#%e5%b0%87-neuvector-scanner-pod-%e9%80%99%e5%80%8b-deployment-%e7%9a%84-imagepullpolicy-%e6%94%b9%e7%82%ba-ifnotpresent" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ kubectl patch deployment neuvector-scanner-pod -n neuvector -p &amp;#39;{&amp;#34;spec&amp;#34;: {&amp;#34;template&amp;#34;: {&amp;#34;spec&amp;#34;:
{&amp;#34;containers&amp;#34;: [{&amp;#34;name&amp;#34;: &amp;#34;neuvector-scanner-pod&amp;#34;, &amp;#34;imagePullPolicy&amp;#34;: &amp;#34;IfNotPresent&amp;#34;}]}}}}&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;讓 scanner deplotment 的 Pod 不要被指派到 master Node 上&lt;span class="hx:absolute hx:-mt-20" id="讓-scanner-deplotment-的-pod-不要被指派到-master-node-上"&gt;&lt;/span&gt;
&lt;a href="#%e8%ae%93-scanner-deplotment-%e7%9a%84-pod-%e4%b8%8d%e8%a6%81%e8%a2%ab%e6%8c%87%e6%b4%be%e5%88%b0-master-node-%e4%b8%8a" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ kubectl patch deployment neuvector-scanner-pod -n neuvector --type=&amp;#39;json&amp;#39; -p=&amp;#39;[{&amp;#34;op&amp;#34;: &amp;#34;add&amp;#34;, &amp;#34;path&amp;#34;: &amp;#34;/spec/template/spec/affinity&amp;#34;, &amp;#34;value&amp;#34;: {&amp;#34;nodeAffinity&amp;#34;: {&amp;#34;requiredDuringSchedulingIgnoredDuringExecution&amp;#34;: {&amp;#34;nodeSelectorTerms&amp;#34;: [{&amp;#34;matchExpressions&amp;#34;: [{&amp;#34;key&amp;#34;: &amp;#34;node-role.kubernetes.io/worker&amp;#34;, &amp;#34;operator&amp;#34;: &amp;#34;In&amp;#34;, &amp;#34;values&amp;#34;: [&amp;#34;&amp;#34;]}]}]}}}}]&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;將 scanner pod 數量縮減為 2&lt;span class="hx:absolute hx:-mt-20" id="將-scanner-pod-數量縮減為-2"&gt;&lt;/span&gt;
&lt;a href="#%e5%b0%87-scanner-pod-%e6%95%b8%e9%87%8f%e7%b8%ae%e6%b8%9b%e7%82%ba-2" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ kubectl -n neuvector scale deploy neuvector-scanner-pod --replicas=2&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;檢查修改後 Neuvector Pod 運作狀態&lt;span class="hx:absolute hx:-mt-20" id="檢查修改後-neuvector-pod-運作狀態"&gt;&lt;/span&gt;
&lt;a href="#%e6%aa%a2%e6%9f%a5%e4%bf%ae%e6%94%b9%e5%be%8c-neuvector-pod-%e9%81%8b%e4%bd%9c%e7%8b%80%e6%85%8b" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ kubectl -n neuvector get pod -o wide&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
neuvector-controller-pod-85bd66d98-qwbb4 1/1 Running 0 54s 10.244.161.134 c1w1 &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
neuvector-enforcer-pod-6jp5p 1/1 Running 0 54s 10.244.54.135 c1w2 &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
neuvector-enforcer-pod-9pp2f 1/1 Running 0 54s 10.244.161.133 c1w1 &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
neuvector-enforcer-pod-fk6k9 1/1 Running 0 54s 10.244.74.9 c1m1 &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
neuvector-manager-pod-5894fd44b9-kwtgv 1/1 Running 0 54s 10.244.54.134 c1w2 &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
neuvector-scanner-pod-7cd7d597df-755bv 1/1 Running 0 13s 10.244.161.137 c1w1 &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;
neuvector-scanner-pod-7cd7d597df-9w55b 1/1 Running 0 11s 10.244.54.137 c1w2 &amp;lt;none&amp;gt; &amp;lt;none&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;檢查 Neuvector Service&lt;span class="hx:absolute hx:-mt-20" id="檢查-neuvector-service"&gt;&lt;/span&gt;
&lt;a href="#%e6%aa%a2%e6%9f%a5-neuvector-service" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ kubectl -n neuvector get svc&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
neuvector-service-webui NodePort 10.98.0.202 &amp;lt;none&amp;gt; 8443:30039/TCP 8m33s
neuvector-svc-admission-webhook ClusterIP 10.98.0.62 &amp;lt;none&amp;gt; 443/TCP 8m33s
neuvector-svc-controller ClusterIP None &amp;lt;none&amp;gt; 18300/TCP,18301/TCP,18301/UDP 8m33s
neuvector-svc-crd-webhook ClusterIP 10.98.0.88 &amp;lt;none&amp;gt; 443/TCP 8m33s&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;預設會有一個 Service 開 NodePort&lt;span class="hx:absolute hx:-mt-20" id="預設會有一個-service-開-nodeport"&gt;&lt;/span&gt;
&lt;a href="#%e9%a0%90%e8%a8%ad%e6%9c%83%e6%9c%89%e4%b8%80%e5%80%8b-service-%e9%96%8b-nodeport" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ NODE_PORT=$(kubectl get --namespace neuvector -o jsonpath=&amp;#34;{.spec.ports[0].nodePort}&amp;#34; services neuvector-service-webui)
$ NODE_IP=$(kubectl get nodes --namespace neuvector -o jsonpath=&amp;#34;{.items[0].status.addresses[0].address}&amp;#34;)
$ echo https://$NODE_IP:$NODE_PORT&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;https://120.96.143.212:30039&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;打開瀏覽器輸入 NeuVector 的 URL&lt;span class="hx:absolute hx:-mt-20" id="打開瀏覽器輸入-neuvector-的-url"&gt;&lt;/span&gt;
&lt;a href="#%e6%89%93%e9%96%8b%e7%80%8f%e8%a6%bd%e5%99%a8%e8%bc%b8%e5%85%a5-neuvector-%e7%9a%84-url" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;https://120.96.143.212:30039&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;帳號密碼預設都是 : admin
勾選同意 License 後，按 login 登入&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/r1S3WKo9h.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Neuvector Dashboard 畫面&lt;span class="hx:absolute hx:-mt-20" id="neuvector-dashboard-畫面"&gt;&lt;/span&gt;
&lt;a href="#neuvector-dashboard-%e7%95%ab%e9%9d%a2" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/BkrSGFiq3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;解除安裝 Neuvector&lt;span class="hx:absolute hx:-mt-20" id="解除安裝-neuvector"&gt;&lt;/span&gt;
&lt;a href="#%e8%a7%a3%e9%99%a4%e5%ae%89%e8%a3%9d-neuvector" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ helm uninstall neuvector --namespace neuvector&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;release &amp;#34;neuvector&amp;#34; uninstalled&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;參考資料&lt;span class="hx:absolute hx:-mt-20" id="參考資料"&gt;&lt;/span&gt;
&lt;a href="#%e5%8f%83%e8%80%83%e8%b3%87%e6%96%99" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a
href="https://github.com/neuvector/neuvector-helm"target="_blank" rel="noopener"&gt;NeuVector Helm charts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;helm install neuvector --namespace neuvector --create-namespace neuvector/core \
--set containerd.enabled=true \
--set runtimePath=/run/containerd/containerd.sock \
--set containerd.path=/run/containerd/containerd.sock \
--set tag=5.3.3 \
--set controller.replicas=1 \
--set manager.ingress.enabled=true \
--set manager.ingress.host=neuvector.example.com \
--set manager.ingress.ingressClassName=nginx \
--set manager.ingress.path=/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Increase SSH Connection Timeout in Linux</title><link>https://blog.kubeantony.com/archive/security/increase-ssh-connection-timeout-in-linux/</link><pubDate>Tue, 02 Jan 2024 09:19:20 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/increase-ssh-connection-timeout-in-linux/</guid><description>
&lt;h2&gt;1. SSH Server 設定&lt;span class="hx:absolute hx:-mt-20" id="1-ssh-server-設定"&gt;&lt;/span&gt;
&lt;a href="#1-ssh-server-%e8%a8%ad%e5%ae%9a" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ cat &amp;lt;&amp;lt;EOF | sudo tee -a /etc/ssh/sshd_config
ClientAliveInterval 1200
ClientAliveCountMax 9
EOF&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;ClientAliveInterval&lt;/code&gt; parameter specifies the time in seconds that the server will wait before sending a null packet to the client system to keep the connection alive.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;the &lt;code&gt;ClientAliveCountMax&lt;/code&gt; parameter defines the number of client alive messages which are sent without getting any messages from the client. If this limit is reached while the messages are being sent, the sshd daemon will drop the session, effectively terminating the ssh session.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;Timeout value = ClientAliveInterval * ClientAliveCountMax&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;以上設定等於連續連接 9 小時都沒發送命令後才會斷線&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;2. 重啟 SSHD 服務&lt;span class="hx:absolute hx:-mt-20" id="2-重啟-sshd-服務"&gt;&lt;/span&gt;
&lt;a href="#2-%e9%87%8d%e5%95%9f-sshd-%e6%9c%8d%e5%8b%99" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ sudo systemctl restart sshd&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Persistent Data for NeuVector Policy and Configuration</title><link>https://blog.kubeantony.com/archive/security/persistent-data-for-neuvector-policy-and-configuration/</link><pubDate>Wed, 27 Sep 2023 09:09:32 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/persistent-data-for-neuvector-policy-and-configuration/</guid><description>
&lt;style&gt;
.indent-title-1{
margin-left: 1em;
}
.indent-title-2{
margin-left: 2em;
}
.indent-title-3{
margin-left: 3em;
}
&lt;/style&gt;
&lt;h2&gt;Preface&lt;span class="hx:absolute hx:-mt-20" id="preface"&gt;&lt;/span&gt;
&lt;a href="#preface" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;本篇文章會採取 Step by Step 和 ScreenShot 的介紹，&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;如何將 Neuvector 的 Policy and Configuration 透過 Kubernetes Persistent Volume 永久保存資料&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;可以透過點擊展開以下目錄，選擇想看的內容，跳轉至特定章節&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Intro&lt;span class="hx:absolute hx:-mt-20" id="intro"&gt;&lt;/span&gt;
&lt;a href="#intro" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;預設情況下，NeuVector 將各種設定檔儲存在 Controller-Pods 的 &lt;strong&gt;&lt;code&gt;/var/neuvector/config/backup&lt;/code&gt;&lt;/strong&gt; 中。&lt;/p&gt;
&lt;p&gt;NeuVector 可以將 configuration ( 設定 ) 和 policy ( 規則 ) 儲存到硬碟上，這樣即使 Controller 故障，設定和規則也不會遺失。這可以通過將一個 Kubernetes volume 掛載到 Controller pod 中的 &lt;strong&gt;&lt;code&gt;/var/neuvector/&lt;/code&gt;&lt;/strong&gt; 目錄區來實現。&lt;/p&gt;
&lt;p&gt;如果 K8S 集群完全故障，當創建新 K8S 集群時，設定和規則會自動恢復。設定和規則也可以手動從 Volume 中恢復或刪除。&lt;/p&gt;
&lt;p&gt;如果在 HA 配置中執行多個 Controller-Pods，只要其中一個 Controller-Pod 始終處於運作狀態，所有資料都會在 Controller 之間同步。&lt;/p&gt;
&lt;p&gt;如果希望儲存 violations ( 違規 )、threats ( 威脅 )、vulnerabilities ( 漏洞 ) 和 events ( 事件 ) 等 Logs，請在 &amp;ldquo;Settings&amp;rdquo; 中啟用 SYSLOG server。&lt;/p&gt;
&lt;p&gt;如果沒有使用「Kuberentes Persistent Volume」，NeuVector 就不會將設定或規則儲存到硬碟上。在停止所有 Neuvector-Controller-Pods 之前，請先備份 Controller 的設定和規則，這可以在「Settings」&amp;gt;「Configuration」中完成。&lt;/p&gt;
&lt;p&gt;如果要確保設定和規則在 Neuvector Controller 更新時不會遺失，可以將 Neuvector Controller 部署在高可用性 (HA) 配置中，以 3 或 5 個 Neuvector-Controller-Pods 運行。&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;環境介紹&lt;span class="hx:absolute hx:-mt-20" id="環境介紹"&gt;&lt;/span&gt;
&lt;a href="#%e7%92%b0%e5%a2%83%e4%bb%8b%e7%b4%b9" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;將 Neuvector 5.2.0 安裝在 OpenShift 4.12 之上&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Step1: Create Persistent Volume Claim&lt;span class="hx:absolute hx:-mt-20" id="step1-create-persistent-volume-claim"&gt;&lt;/span&gt;
&lt;a href="#step1-create-persistent-volume-claim" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ nano neuvector-pvc.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;檔案內容如下 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: neuvector-data
namespace: neuvector
spec:
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
storage: 1Gi&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;如果在您的環境中有 StorageClass 則可跳過 Step2 建立 Persistent Volume&lt;/li&gt;
&lt;li&gt;NeuVector 對於 accessModes 的要求必須是 ReadWriteMany(RWX).&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;建立 PVC&lt;span class="hx:absolute hx:-mt-20" id="建立-pvc"&gt;&lt;/span&gt;
&lt;a href="#%e5%bb%ba%e7%ab%8b-pvc" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc create -f neuvector-pvc.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Step2: Create Persistent Volume&lt;span class="hx:absolute hx:-mt-20" id="step2-create-persistent-volume"&gt;&lt;/span&gt;
&lt;a href="#step2-create-persistent-volume" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ nano neuvector-pv.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;檔案內容如下 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;apiVersion: v1
kind: PersistentVolume
metadata:
name: neuvector-data
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
hostPath:
path: &amp;#34;/var/neuvector&amp;#34;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;建立 PV&lt;span class="hx:absolute hx:-mt-20" id="建立-pv"&gt;&lt;/span&gt;
&lt;a href="#%e5%bb%ba%e7%ab%8b-pv" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc create -f neuvector-pv.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;檢查 PV 和 PVC 是否 Bound 在一起&lt;span class="hx:absolute hx:-mt-20" id="檢查-pv-和-pvc-是否-bound-在一起"&gt;&lt;/span&gt;
&lt;a href="#%e6%aa%a2%e6%9f%a5-pv-%e5%92%8c-pvc-%e6%98%af%e5%90%a6-bound-%e5%9c%a8%e4%b8%80%e8%b5%b7" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc get pv,pvc&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/neuvector-data 1Gi RWX Retain Bound neuvector/neuvector-data 18m
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/neuvector-data Bound neuvector-data 1Gi RWX 18&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Step3: Modify the NeuVector-Controller sample yaml file&lt;span class="hx:absolute hx:-mt-20" id="step3-modify-the-neuvector-controller-sample-yaml-file"&gt;&lt;/span&gt;
&lt;a href="#step3-modify-the-neuvector-controller-sample-yaml-file" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;If Neuvector is existed&lt;span class="hx:absolute hx:-mt-20" id="if-neuvector-is-existed"&gt;&lt;/span&gt;
&lt;a href="#if-neuvector-is-existed" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;Settings &amp;ndash;&amp;gt; Configuration &amp;ndash;&amp;gt; Export &amp;ndash;&amp;gt; All &amp;ndash;&amp;gt; Submit&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/BJkzbUWx6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;如果 Volume 重新掛載到 Neuvector Controller 之後，有發現設定檔有殘缺，就可以 Import 回去&lt;/p&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;點 Choose File &amp;ndash;&amp;gt; 再點擊向上的箭頭，匯入檔案&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/rkrI-L-la.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;執行以下命令修改 neuvector-controller-pod&lt;span class="hx:absolute hx:-mt-20" id="執行以下命令修改-neuvector-controller-pod"&gt;&lt;/span&gt;
&lt;a href="#%e5%9f%b7%e8%a1%8c%e4%bb%a5%e4%b8%8b%e5%91%bd%e4%bb%a4%e4%bf%ae%e6%94%b9-neuvector-controller-pod" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc edit deploy neuvector-controller-pod&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;修改檔案內容如下 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;...
metadata:
name: neuvector-controller-pod
spec:
template:
spec:
containers:
- env:
- name: CTRL_PERSIST_CONFIG ## 新增這個 ENV
...
volumes:
- #hostPath: ## 註解掉這行
# path: /var/neuvector ## 註解掉這行
# type: &amp;#34;&amp;#34; ## 註解掉這行
name: nv-share
persistentVolumeClaim: ## 新增 PVC
claimName: neuvector-data ## 指定 Pods 使用哪個 PVC&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;Rollout Restart Controller Pods&lt;span class="hx:absolute hx:-mt-20" id="rollout-restart-controller-pods"&gt;&lt;/span&gt;
&lt;a href="#rollout-restart-controller-pods" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc rollout restart deploy neuvector-controller-pod&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;檢視 Pods 被滾動式重新佈署之後的狀態&lt;span class="hx:absolute hx:-mt-20" id="檢視-pods-被滾動式重新佈署之後的狀態"&gt;&lt;/span&gt;
&lt;a href="#%e6%aa%a2%e8%a6%96-pods-%e8%a2%ab%e6%bb%be%e5%8b%95%e5%bc%8f%e9%87%8d%e6%96%b0%e4%bd%88%e7%bd%b2%e4%b9%8b%e5%be%8c%e7%9a%84%e7%8b%80%e6%85%8b" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ watch -n 1 oc get pods -l app=neuvector-controller-pod&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;成功部屬後的螢幕輸出&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME READY STATUS RESTARTS AGE
neuvector-controller-pod-7bd8dd947f-8tw66 1/1 Running 0 8m34s
neuvector-controller-pod-7bd8dd947f-qtghq 1/1 Running 0 9m50s
neuvector-controller-pod-7bd8dd947f-vf94c 1/1 Running 0 7m19s&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;If Neuvector doesn&amp;rsquo;t existed&lt;span class="hx:absolute hx:-mt-20" id="if-neuvector-doesnt-existed"&gt;&lt;/span&gt;
&lt;a href="#if-neuvector-doesnt-existed" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ nano neuvector.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;修改檔案內容如下 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;...
spec:
template:
spec:
volumes:
- name: nv-share
# hostPath: // replaced by persistentVolumeClaim
# path: /var/neuvector // replaced by persistentVolumeClaim
persistentVolumeClaim:
claimName: neuvector-data&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Add the following environment variable in the Controller&lt;span class="hx:absolute hx:-mt-20" id="add-the-following-environment-variable-in-the-controller"&gt;&lt;/span&gt;
&lt;a href="#add-the-following-environment-variable-in-the-controller" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt; - name: CTRL_PERSIST_CONFIG&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Step4: Build Neuvector&lt;span class="hx:absolute hx:-mt-20" id="step4-build-neuvector"&gt;&lt;/span&gt;
&lt;a href="#step4-build-neuvector" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc create -f neuvector.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;檢視 Neuvector Pods 運作狀況&lt;span class="hx:absolute hx:-mt-20" id="檢視-neuvector-pods-運作狀況"&gt;&lt;/span&gt;
&lt;a href="#%e6%aa%a2%e8%a6%96-neuvector-pods-%e9%81%8b%e4%bd%9c%e7%8b%80%e6%b3%81" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc get pods&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME READY STATUS RESTARTS AGE
neuvector-controller-pod-74d88c4df6-7kqxk 1/1 Running 0 4m4s
neuvector-controller-pod-74d88c4df6-m9spn 1/1 Running 0 4m3s
neuvector-controller-pod-74d88c4df6-vp96s 1/1 Running 0 4m3s
neuvector-enforcer-pod-4zsj8 1/1 Running 0 4m3s
neuvector-enforcer-pod-f5znw 1/1 Running 0 4m3s
neuvector-enforcer-pod-tqhz5 1/1 Running 0 4m3s
neuvector-manager-pod-6bb5555c7b-85sdk 1/1 Running 0 4m4s
neuvector-operator-86dd64f497-nqmbg 1/1 Running 2 19d
neuvector-scanner-pod-56c798bb86-8ktcl 1/1 Running 0 4m3s
neuvector-scanner-pod-56c798bb86-rvftv 1/1 Running 0 4m3s&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Step5: 建立掃描 Image Registry 的規則&lt;span class="hx:absolute hx:-mt-20" id="step5-建立掃描-image-registry-的規則"&gt;&lt;/span&gt;
&lt;a href="#step5-%e5%bb%ba%e7%ab%8b%e6%8e%83%e6%8f%8f-image-registry-%e7%9a%84%e8%a6%8f%e5%89%87" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;Assets -&amp;gt; Registries -&amp;gt; Add&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Name: &lt;code&gt;quay.io&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Registry: &lt;code&gt;https://quay.io/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;User Name: &lt;code&gt;hahappyman&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Password: &lt;code&gt;***&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Filter: &lt;code&gt;hahappyman/alpine-*&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;勾選 Scan Layers -&amp;gt; Submit&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/H1uRPa8Ja.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;點擊 Start Scan 按鈕&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/H1v6daLJa.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;檢視掃描 Image Registry 的相關設定是否被保存到 Node 上&lt;span class="hx:absolute hx:-mt-20" id="檢視掃描-image-registry-的相關設定是否被保存到-node-上"&gt;&lt;/span&gt;
&lt;a href="#%e6%aa%a2%e8%a6%96%e6%8e%83%e6%8f%8f-image-registry-%e7%9a%84%e7%9b%b8%e9%97%9c%e8%a8%ad%e5%ae%9a%e6%98%af%e5%90%a6%e8%a2%ab%e4%bf%9d%e5%ad%98%e5%88%b0-node-%e4%b8%8a" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ cat &amp;lt;&amp;lt;EOF | oc debug node/worker2.ocp4.example.com 2&amp;gt; /dev/null
chroot /host
/bin/bash -c &amp;#34;[[ -d /var/neuvector/config/backup/ ]] &amp;amp;&amp;amp; cat /var/neuvector/config/backup/registry.backup || ls -al /var/neuvector&amp;#34;
EOF&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;因為本次範例 PV 使用的是 HostPath ，資料可能只存在特定的 Node 上，Neuvector 的 Controller 會自行同步，所以有的節點的 /var/neuvector 目錄底下沒有資料，如以下螢幕輸出&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;total 4
drwxr-xr-x. 2 root root 6 Aug 1 04:25 .
drwxr-xr-x. 26 root root 4096 Aug 1 04:25 ..&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;正確螢幕輸出如下&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;{&amp;#34;auth_token&amp;#34;:&amp;#34;&amp;#34;,&amp;#34;auth_with_token&amp;#34;:false,&amp;#34;aws_key&amp;#34;:null,&amp;#34;cfg_type&amp;#34;:2,&amp;#34;creater_domains&amp;#34;:null,&amp;#34;disable_files&amp;#34;:false,&amp;#34;domains&amp;#34;:null,&amp;#34;filters&amp;#34;:[&amp;#34;hahappyman/*&amp;#34;],&amp;#34;gcr_key&amp;#34;:null,&amp;#34;gitlab_api_url&amp;#34;:&amp;#34;&amp;#34;,&amp;#34;gitlab_private_token&amp;#34;:&amp;#34;&amp;#34;,&amp;#34;ibmcloud_account&amp;#34;:&amp;#34;&amp;#34;,&amp;#34;ibmcloud_token_url&amp;#34;:&amp;#34;&amp;#34;,&amp;#34;jfrog_aql&amp;#34;:false,&amp;#34;jfrog_mode&amp;#34;:&amp;#34;&amp;#34;,&amp;#34;name&amp;#34;:&amp;#34;quay.io&amp;#34;,&amp;#34;parsed_filters&amp;#34;:[{&amp;#34;organization&amp;#34;:&amp;#34;hahappyman&amp;#34;,&amp;#34;repository&amp;#34;:&amp;#34;.*&amp;#34;,&amp;#34;tag&amp;#34;:&amp;#34;.*&amp;#34;}],&amp;#34;password&amp;#34;:&amp;#34;tZS7XXX6T0bkk0Pim8y3//qb0xmTVx5eGboJcrck&amp;#34;,&amp;#34;poll_period&amp;#34;:0,&amp;#34;registry&amp;#34;:&amp;#34;https://quay.io/&amp;#34;,&amp;#34;repo_limit&amp;#34;:200,&amp;#34;rescan_image&amp;#34;:true,&amp;#34;scan_layers&amp;#34;:true,&amp;#34;schedule&amp;#34;:&amp;#34;manual&amp;#34;,&amp;#34;tag_limit&amp;#34;:20,&amp;#34;type&amp;#34;:&amp;#34;Docker Registry&amp;#34;,&amp;#34;username&amp;#34;:&amp;#34;hahappyman&amp;#34;}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;此時就可以看到掃描 Image Registry 的設定被儲存在 Node 上&lt;/li&gt;
&lt;li&gt;Image 掃描的結果也會被儲存到 &lt;code&gt;/var/neuvector/registry/&lt;/code&gt; 目錄下&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2&gt;Step6: 建立 Admission Control 規則&lt;span class="hx:absolute hx:-mt-20" id="step6-建立-admission-control-規則"&gt;&lt;/span&gt;
&lt;a href="#step6-%e5%bb%ba%e7%ab%8b-admission-control-%e8%a6%8f%e5%89%87" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;Policy -&amp;gt; Admission Control -&amp;gt; Add&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Criterion:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Run as privileged&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Namespace is one of [test]&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Mode: &lt;code&gt;Protect&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/HJMmqpUyT.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;勾選 Status: &lt;code&gt;Enabled&lt;/code&gt;，並切換到 &lt;code&gt;Protect&lt;/code&gt; Mode&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/rJ9FqaL1T.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;測試 Admission Control 規則&lt;span class="hx:absolute hx:-mt-20" id="測試-admission-control-規則"&gt;&lt;/span&gt;
&lt;a href="#%e6%b8%ac%e8%a9%a6-admission-control-%e8%a6%8f%e5%89%87" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc run nginx --image=nginx:stable -n test --privileged=true&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;Error from server: admission webhook &amp;#34;neuvector-validating-admission-webhook.neuvector.svc&amp;#34; denied the request: Creation of Kubernetes Pod is denied.&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;檢視 Admission Control 規則是否被保存到 Node 上&lt;span class="hx:absolute hx:-mt-20" id="檢視-admission-control-規則是否被保存到-node-上"&gt;&lt;/span&gt;
&lt;a href="#%e6%aa%a2%e8%a6%96-admission-control-%e8%a6%8f%e5%89%87%e6%98%af%e5%90%a6%e8%a2%ab%e4%bf%9d%e5%ad%98%e5%88%b0-node-%e4%b8%8a" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ cat &amp;lt;&amp;lt;EOF | oc debug node/worker2.ocp4.example.com 2&amp;gt; /dev/null
chroot /host
/bin/bash -c &amp;#34;[[ -d /var/neuvector/config/backup/ ]] &amp;amp;&amp;amp; cat /var/neuvector/config/backup/admission_control.backup || ls -al /var/neuvector&amp;#34;
EOF&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;{&amp;#34;id&amp;#34;:1000,&amp;#34;category&amp;#34;:&amp;#34;Kubernetes&amp;#34;,&amp;#34;comment&amp;#34;:&amp;#34;&amp;#34;,&amp;#34;criteria&amp;#34;:[{&amp;#34;name&amp;#34;:&amp;#34;runAsPrivileged&amp;#34;,&amp;#34;op&amp;#34;:&amp;#34;=&amp;#34;,&amp;#34;value&amp;#34;:&amp;#34;true&amp;#34;,&amp;#34;value_slice&amp;#34;:null,&amp;#34;path&amp;#34;:&amp;#34;runAsPrivileged&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;namespace&amp;#34;,&amp;#34;op&amp;#34;:&amp;#34;containsAny&amp;#34;,&amp;#34;value&amp;#34;:&amp;#34;test&amp;#34;,&amp;#34;value_slice&amp;#34;:null,&amp;#34;path&amp;#34;:&amp;#34;namespace&amp;#34;}],&amp;#34;disable&amp;#34;:false,&amp;#34;critical&amp;#34;:false,&amp;#34;cfg_type&amp;#34;:2,&amp;#34;rule_type&amp;#34;:&amp;#34;deny&amp;#34;,&amp;#34;use_as_risky_role_tag&amp;#34;:false,&amp;#34;rule_mode&amp;#34;:&amp;#34;protect&amp;#34;}
...以下省略&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Step7: 刪除 Neuvector&lt;span class="hx:absolute hx:-mt-20" id="step7-刪除-neuvector"&gt;&lt;/span&gt;
&lt;a href="#step7-%e5%88%aa%e9%99%a4-neuvector" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc delete -f neuvector.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;須確認 Pods 都已被刪除&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2&gt;Step8: 重新建立 Neuvector&lt;span class="hx:absolute hx:-mt-20" id="step8-重新建立-neuvector"&gt;&lt;/span&gt;
&lt;a href="#step8-%e9%87%8d%e6%96%b0%e5%bb%ba%e7%ab%8b-neuvector" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc create -f neuvector.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;檢視 Pods 運作狀態&lt;span class="hx:absolute hx:-mt-20" id="檢視-pods-運作狀態"&gt;&lt;/span&gt;
&lt;a href="#%e6%aa%a2%e8%a6%96-pods-%e9%81%8b%e4%bd%9c%e7%8b%80%e6%85%8b" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc get pods&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME READY STATUS RESTARTS AGE
neuvector-controller-pod-74d88c4df6-h7npj 1/1 Running 0 3m43s
neuvector-controller-pod-74d88c4df6-k6fvg 1/1 Running 0 3m43s
neuvector-controller-pod-74d88c4df6-th8lj 1/1 Running 0 3m43s
neuvector-enforcer-pod-b2n8r 1/1 Running 0 3m43s
neuvector-enforcer-pod-mzvkb 1/1 Running 0 3m43s
neuvector-enforcer-pod-rdvq8 1/1 Running 0 3m43s
neuvector-manager-pod-6bb5555c7b-zlq78 1/1 Running 0 3m43s
neuvector-operator-86dd64f497-nqmbg 1/1 Running 2 19d
neuvector-scanner-pod-56c798bb86-qpfc6 1/1 Running 0 3m43s
neuvector-scanner-pod-56c798bb86-v29w8 1/1 Running 0 3m43&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Step9: 確認設定和規則都還存在&lt;span class="hx:absolute hx:-mt-20" id="step9-確認設定和規則都還存在"&gt;&lt;/span&gt;
&lt;a href="#step9-%e7%a2%ba%e8%aa%8d%e8%a8%ad%e5%ae%9a%e5%92%8c%e8%a6%8f%e5%89%87%e9%83%bd%e9%82%84%e5%ad%98%e5%9c%a8" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;連線至 Neuvector Web Console&lt;/p&gt;
&lt;h3&gt;掃描 Image Registry 的相關設定&lt;span class="hx:absolute hx:-mt-20" id="掃描-image-registry-的相關設定"&gt;&lt;/span&gt;
&lt;a href="#%e6%8e%83%e6%8f%8f-image-registry-%e7%9a%84%e7%9b%b8%e9%97%9c%e8%a8%ad%e5%ae%9a" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/HJlCBRLkT.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h3&gt;Admission Control 規則&lt;span class="hx:absolute hx:-mt-20" id="admission-control-規則"&gt;&lt;/span&gt;
&lt;a href="#admission-control-%e8%a6%8f%e5%89%87" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/SyaMLCIJp.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Config 會被備份的種類&lt;span class="hx:absolute hx:-mt-20" id="config-會被備份的種類"&gt;&lt;/span&gt;
&lt;a href="#config-%e6%9c%83%e8%a2%ab%e5%82%99%e4%bb%bd%e7%9a%84%e7%a8%ae%e9%a1%9e" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ ls -l /var/neuvector/config/backup&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;total 1332
-rw-------. 1 root root 2615 Sep 19 08:11 admission_control.backup
-rw-------. 1 root root 96 Sep 19 07:53 compliance.backup
-rw-------. 1 root root 378 Sep 19 07:53 crd.backup
-rw-------. 1 root root 14903 Sep 19 07:53 dlp_group.backup
-rw-------. 1 root root 2539 Sep 19 07:53 dlp_rule.backup
-rw-------. 1 root root 29463 Sep 19 07:53 domain.backup
-rw-------. 1 root root 41 Sep 19 07:53 eula_oss.backup
-rw-------. 1 root root 488 Sep 19 07:53 federation.backup
-rw-------. 1 root root 433060 Sep 19 07:53 file_monitor.backup
-rw-------. 1 root root 554801 Sep 19 07:53 file_rule.backup
-rw-------. 1 root root 80549 Sep 19 07:53 group.backup
-rw-------. 1 root root 72943 Sep 19 08:06 policy.backup
-rw-------. 1 root root 93486 Sep 19 07:53 process_profile.backup
-rw-------. 1 root root 464 Sep 19 07:53 pwd_profile.backup
-rw-------. 1 root root 664 Sep 19 07:53 registry.backup
-rw-------. 1 root root 1738 Sep 19 07:53 response_rule.backup
-rw-------. 1 root root 1295 Sep 19 07:53 system.backup
-rw-------. 1 root root 532 Sep 19 08:02 user.backup
-rw-r--r--. 1 root root 45 Sep 19 07:53 version.backup
-rw-------. 1 root root 76 Sep 19 07:53 vulnerability.backup
-rw-------. 1 root root 14903 Sep 19 07:53 waf_group.backup
-rw-------. 1 root root 1481 Sep 19 07:53 waf_rule.backup&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Ref&lt;span class="hx:absolute hx:-mt-20" id="ref"&gt;&lt;/span&gt;
&lt;a href="#ref" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a
href="https://open-docs.neuvector.com/deploying/production#backups-and-persistent-data"target="_blank" rel="noopener"&gt;Backups and Persistent Data - Neuvector docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Introduction to NeuVector</title><link>https://blog.kubeantony.com/archive/security/introduction-to-neuvector/</link><pubDate>Tue, 19 Sep 2023 09:09:56 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/introduction-to-neuvector/</guid><description>
&lt;style&gt;
.indent-title-1{
margin-left: 1em;
}
.indent-title-2{
margin-left: 2em;
}
.indent-title-3{
margin-left: 3em;
}
&lt;/style&gt;
&lt;h1&gt;Preface&lt;/h1&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;本篇文章會介紹以下內容&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;甚麼是 NeuVector ，它的功能有哪些?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;可以透過點擊展開以下目錄，選擇想看的內容，跳轉至特定章節&lt;/p&gt;
&lt;/div&gt;
&lt;h1&gt;5.x Overview&lt;/h1&gt;&lt;p&gt;NeuVector 提供雲原生的 Kubernetes 安全平台&lt;/p&gt;
&lt;h2&gt;Features&lt;span class="hx:absolute hx:-mt-20" id="features"&gt;&lt;/span&gt;
&lt;a href="#features" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;&lt;font size=4&gt;&lt;strong&gt;1. CI/CD Vulnerability Management &amp;amp; Admission Control&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;透過 Jenkins 掃描 Image，掃描 Registries 並執行 Admission Control Rule (准入控制規則)，以便部署到生產中。&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;font size=4&gt;&lt;strong&gt;2. Violation Protection&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;發現行為並創建「白名單」的策略，用來偵測違反正常行為。&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;font size=4&gt;&lt;strong&gt;3. Threat Detection&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;檢測常見的應用攻擊，如對 Container 的 DDoS 和 DNS 攻擊。&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;font size=4&gt;&lt;strong&gt;4. DLP and WAF Sensors&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;檢查網路流量以防止敏感數據丟失，並檢測常見的 OWASP Top10 WAF 攻擊。&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;font size=4&gt;&lt;strong&gt;5. Run-time Vulnerability Scanning&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;掃描 Registries、Image，以及在 Kubernetes 和主機上運行的 Container ，以尋找常見的（CVE）和應用程式特定的安全漏洞。&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;font size=4&gt;&lt;strong&gt;6. Compliance &amp;amp; Auditing&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;自動運行 Docker Bench 測試和 Kubernetes CIS Benchmarks。&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;font size=4&gt;&lt;strong&gt;7. Endpoint/Host Security&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;檢測權限升級，監控主機和 Container 內的程序和檔案活動，並監控 Container 檔案系統的可疑活動。&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;font size=4&gt;&lt;strong&gt;8. Multi-cluster Management&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class="indent-title-1"&gt;
&lt;p&gt;從一個控制台監控和管理多個 Kubernetes 叢集。&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Manage SUSE NeuVector Using REST API</title><link>https://blog.kubeantony.com/archive/security/manage-suse-neuvector-using-rest-api/</link><pubDate>Fri, 11 Aug 2023 09:31:26 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/manage-suse-neuvector-using-rest-api/</guid><description>
&lt;style&gt;
.indent-title-1{
margin-left: 1em;
}
.indent-title-2{
margin-left: 2em;
}
.indent-title-3{
margin-left: 3em;
}
&lt;/style&gt;
&lt;h1&gt;Preface&lt;/h1&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;本篇文章會介紹，&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;透過 Swagger 給的 API 指令與 Neuvector 溝通&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;可以透過點擊展開以下目錄，選擇想看的內容，跳轉至特定章節&lt;/p&gt;
&lt;/div&gt;
&lt;h1&gt;Setup Neuvector&lt;/h1&gt;&lt;h2&gt;Expose REST API&lt;span class="hx:absolute hx:-mt-20" id="expose-rest-api"&gt;&lt;/span&gt;
&lt;a href="#expose-rest-api" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;To expose the REST API for access from outside of the Kubernetes cluster, enable port 10443.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;apiVersion: v1
kind: Service
metadata:
name: neuvector-service-rest
namespace: neuvector
spec:
ports:
- port: 10443
name: controller
protocol: TCP
type: NodePort
selector:
app: neuvector-controller-pod&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;建立 Service&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc create -f neuvector-service-rest.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;檢視服務狀態&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ oc get svc neuvector-service-rest&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
neuvector-service-rest NodePort 172.30.84.78 &amp;lt;none&amp;gt; 10443:32215/TCP 3h8m&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h1&gt;Swagger&lt;/h1&gt;&lt;h2&gt;Install Swagger with Podman&lt;span class="hx:absolute hx:-mt-20" id="install-swagger-with-podman"&gt;&lt;/span&gt;
&lt;a href="#install-swagger-with-podman" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ podman run -d -p 80:8080 docker.io/swaggerapi/swagger-ui&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-d&lt;/code&gt;，將 Container 推到背景執行&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-p&lt;/code&gt;，將 Container 的 8080 Port 對應到 Host 主機的 80 Port&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2&gt;Access Swagger Web&lt;span class="hx:absolute hx:-mt-20" id="access-swagger-web"&gt;&lt;/span&gt;
&lt;a href="#access-swagger-web" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;打開瀏覽器連線至 Podman Host 主機的 80 Port&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;http://192.168.11.211/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/Hk1hCqe23.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;匯入設定檔&lt;span class="hx:absolute hx:-mt-20" id="匯入設定檔"&gt;&lt;/span&gt;
&lt;a href="#%e5%8c%af%e5%85%a5%e8%a8%ad%e5%ae%9a%e6%aa%94" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;在上方搜尋欄輸入以下網址，並點選 &amp;ldquo;Explore&amp;rdquo; 按鈕&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;https://raw.githubusercontent.com/neuvector/neuvector/main/controller/api/apis.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/SkrM1og33.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Setup Authentication&lt;span class="hx:absolute hx:-mt-20" id="setup-authentication"&gt;&lt;/span&gt;
&lt;a href="#setup-authentication" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Create an authentication token&lt;span class="hx:absolute hx:-mt-20" id="create-an-authentication-token"&gt;&lt;/span&gt;
&lt;a href="#create-an-authentication-token" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;p&gt;在 swagger 的網站找到 &lt;code&gt;Authentication&lt;/code&gt; 標題底下的 &lt;code&gt;/v1/auth Login Authentication&lt;/code&gt;，點擊展開後，再點選 &lt;code&gt;Try it out&lt;/code&gt; 按鈕，就可以對 body 的部分進行修改，&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/HyO1Kng33.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;修改後點 &lt;code&gt;Execute&lt;/code&gt; 就可以產出 Sample 指令，再根據實際環境進行修改&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.kubeantony.com/images/hackmd-uploads/Hkbb53gn2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;以下是一個實際範例，執行以下命令，生成身分驗證的 Token&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;curl -s -k -X &amp;#39;POST&amp;#39; \
&amp;#39;https://192.168.11.82:32215/v1/auth&amp;#39; \
-H &amp;#39;accept: application/json&amp;#39; \
-H &amp;#39;Content-Type: application/json&amp;#39; \
-d &amp;#39;{
&amp;#34;client_ip&amp;#34;: &amp;#34;&amp;#34;,
&amp;#34;password&amp;#34;: {
&amp;#34;username&amp;#34;: &amp;#34;admin&amp;#34;,
&amp;#34;password&amp;#34;: &amp;#34;admin&amp;#34;
},
&amp;#34;Token&amp;#34;: {
&amp;#34;token&amp;#34;: &amp;#34;&amp;#34;,
&amp;#34;state&amp;#34;: &amp;#34;&amp;#34;,
&amp;#34;redirect_endpoint&amp;#34;: &amp;#34;&amp;#34;
}
}&amp;#39; | jq -r &amp;#39;.token.token&amp;#39; &amp;gt; token.json&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;檢視 &lt;code&gt;token.json&lt;/code&gt; 檔案內容&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ cat token.json&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;sUeU1TK648M4Y2RsScwiVceXB3zDuAPtIbzEHO_r&amp;#43;&amp;#43;vMUbdriGCkjCVlcvVjZuK2dzV9hLgce_oKhJlhGXexL_4kmdJ0REtiwrTZb94uudgdjXz8QlkyzXsjbGpHVnqjMDhVqQSoJZ7WMQ&amp;#43;mslJOd6oHPiff476Xyl0&amp;#43;vwTj9tPlEkdeZkZcKjKH37aFbtbvrinCUpwIVl9kuJEV72OmL8p5kcjufydHPW0E6auxiLLmVKp46gki4hPt7CjgiSbtMG4vfanNMnOFpibmwRp9tRfDFnb4Q7z8b1iiuAouXqftJ1VMHuv2LKX_wuKTQAmj0e020_jwmR&amp;#43;MVgTwqVDQ5Uu0NmaeouSTuKbj39clCa&amp;#43;HzXWARNv735QsBDOAeoPt4r6BZTu1mPvo2A5ztcroAL77rZvtEpV0s2xTzxlVAYsXAK1Nu5asUDRqrWbtMkRJIbzXVBq6JYJE8w18&amp;#43;txwbo&amp;#43;JazJQU5vOWxIL93aQtzIveper&amp;#43;vmWjYHd5ieBOvHNlfjt4WJEnfxZ0A61RANPFEfb8HCNQCeFnv4heNV8GuAqstm5BxmsZVWIxW3_b&amp;#43;p0TFaqAl3Sfz1LlewbVFERGKoBNsWRYMsOPD5vgwgZP73r&amp;#43;SLJCVJGIyPbr1RugjOyackA_MFVjtjuLJzINR_IBpp6eiIctWF3Oqlj8Z2a_GhAA8HtYvcXFoM49E8V8IyQxN_KLGkSw_7HbI6LY63gKUzrAeisMuD9iBFkvqxURYEjhmu6F0UI6OFMR55S72GV4Q6afHnPRvmMiPDMuQ1h_bfZAvaGmQryhiboOu8mmcXap0mQLkp&amp;#43;FIBHhQgrqNmvcbC0BHkw859cxV4OOWRKdVVfSNC6mr6VG8uPxn29uLSonbmTc985pYhUfC0LAoQ&amp;#43;Y&amp;#43;gmeKfmsN_DebwMW72tVjb9EBbiTlXLTO&amp;#43;tj9BkdzCWb2zH1d9IBOqkaExEaw7JcMOzv44PqN1NBUy_SiO6nb7QXgNCGc7KKxoP7CrqLOSsUbxg1UxNhMQXNU0sdz3trAy8QUHP2kExTFbW_0_GVjA4hClx1b25GMt3nBhaJT1tp0aSnQMj47zsgJGz5ybxa6bAsUVcQEipA4dlA3orrkBZ0gKkQofpvBF1xAz8h2j6I5HLqbHj1RhT&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Keep login session alive&lt;span class="hx:absolute hx:-mt-20" id="keep-login-session-alive"&gt;&lt;/span&gt;
&lt;a href="#keep-login-session-alive" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ _token_=$(cat token.json)
$ curl -s -k -X &amp;#39;PATCH&amp;#39; \
&amp;#39;https://192.168.11.82:32215/v1/auth&amp;#39; \
-H &amp;#39;accept: application/json&amp;#39; \
-H &amp;#34;X-Auth-Token: $_token_&amp;#34;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Logout current logged in user&lt;span class="hx:absolute hx:-mt-20" id="logout-current-logged-in-user"&gt;&lt;/span&gt;
&lt;a href="#logout-current-logged-in-user" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ _token_=$(cat token.json)
$ curl -s -k -X &amp;#39;DELETE&amp;#39; \
&amp;#39;https://192.168.11.82:32215/v1/auth&amp;#39; \
-H &amp;#39;accept: application/json&amp;#39; \
-H &amp;#34;X-Auth-Token: $_token_&amp;#34;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Process&lt;span class="hx:absolute hx:-mt-20" id="process"&gt;&lt;/span&gt;
&lt;a href="#process" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;檢視特定 Group 的 Process Profile Rules&lt;span class="hx:absolute hx:-mt-20" id="檢視特定-group-的-process-profile-rules"&gt;&lt;/span&gt;
&lt;a href="#%e6%aa%a2%e8%a6%96%e7%89%b9%e5%ae%9a-group-%e7%9a%84-process-profile-rules" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="indent-title-1"&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;$ _token_=$(cat token.json)
$ curl -s -k -X &amp;#39;GET&amp;#39; \
&amp;#39;https://192.168.11.82:32215/v1/process_profile/nv.nginx.neuvector&amp;#39; \
-H &amp;#39;accept: application/json&amp;#39; \
-H &amp;#34;X-Auth-Token: $_token_&amp;#34;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;螢幕輸出 :&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;{
&amp;#34;process_profile&amp;#34;: {
&amp;#34;baseline&amp;#34;: &amp;#34;basic&amp;#34;,
&amp;#34;group&amp;#34;: &amp;#34;nv.nginx.neuvector&amp;#34;,
&amp;#34;mode&amp;#34;: &amp;#34;Protect&amp;#34;,
&amp;#34;process_list&amp;#34;: [
{
&amp;#34;action&amp;#34;: &amp;#34;allow&amp;#34;,
&amp;#34;allow_update&amp;#34;: false,
&amp;#34;cfg_type&amp;#34;: &amp;#34;user_created&amp;#34;,
&amp;#34;created_timestamp&amp;#34;: 1691398024,
&amp;#34;last_modified_timestamp&amp;#34;: 1691398024,
&amp;#34;name&amp;#34;: &amp;#34;bash&amp;#34;,
&amp;#34;path&amp;#34;: &amp;#34;/bin/bash&amp;#34;,
&amp;#34;uuid&amp;#34;: &amp;#34;505a3ce0-c1c0-44a3-89ee-4bc6ed7ef675&amp;#34;
},
{
&amp;#34;action&amp;#34;: &amp;#34;allow&amp;#34;,
&amp;#34;allow_update&amp;#34;: false,
&amp;#34;cfg_type&amp;#34;: &amp;#34;user_created&amp;#34;,
&amp;#34;created_timestamp&amp;#34;: 1691398143,
&amp;#34;last_modified_timestamp&amp;#34;: 1691398143,
&amp;#34;name&amp;#34;: &amp;#34;cat&amp;#34;,
&amp;#34;path&amp;#34;: &amp;#34;/bin/cat&amp;#34;,
&amp;#34;uuid&amp;#34;: &amp;#34;5ff92222-1818-45ed-9b9c-9edcebdb9125&amp;#34;
},
{
&amp;#34;action&amp;#34;: &amp;#34;allow&amp;#34;,
&amp;#34;allow_update&amp;#34;: false,
&amp;#34;cfg_type&amp;#34;: &amp;#34;user_created&amp;#34;,
&amp;#34;created_timestamp&amp;#34;: 1691398053,
&amp;#34;last_modified_timestamp&amp;#34;: 1691398191,
&amp;#34;name&amp;#34;: &amp;#34;ls&amp;#34;,
&amp;#34;path&amp;#34;: &amp;#34;/bin/ls&amp;#34;,
&amp;#34;uuid&amp;#34;: &amp;#34;55380afb-3164-40cb-a830-ca352b9c0a2a&amp;#34;
},
{
&amp;#34;action&amp;#34;: &amp;#34;allow&amp;#34;,
&amp;#34;allow_update&amp;#34;: false,
&amp;#34;cfg_type&amp;#34;: &amp;#34;learned&amp;#34;,
&amp;#34;created_timestamp&amp;#34;: 1691397615,
&amp;#34;last_modified_timestamp&amp;#34;: 1691397615,
&amp;#34;name&amp;#34;: &amp;#34;nginx&amp;#34;,
&amp;#34;path&amp;#34;: &amp;#34;/usr/sbin/nginx&amp;#34;,
&amp;#34;user&amp;#34;: &amp;#34;root&amp;#34;,
&amp;#34;uuid&amp;#34;: &amp;#34;3e286470-aa88-4ae6-adcc-26c60d6446c5&amp;#34;
},
{
&amp;#34;action&amp;#34;: &amp;#34;allow&amp;#34;,
&amp;#34;allow_update&amp;#34;: false,
&amp;#34;cfg_type&amp;#34;: &amp;#34;user_created&amp;#34;,
&amp;#34;created_timestamp&amp;#34;: 1691398031,
&amp;#34;last_modified_timestamp&amp;#34;: 1691398031,
&amp;#34;name&amp;#34;: &amp;#34;sh&amp;#34;,
&amp;#34;path&amp;#34;: &amp;#34;/bin/sh&amp;#34;,
&amp;#34;uuid&amp;#34;: &amp;#34;36de28dc-cf30-4795-920e-afd93b6af790&amp;#34;
},
{
&amp;#34;action&amp;#34;: &amp;#34;allow&amp;#34;,
&amp;#34;allow_update&amp;#34;: false,
&amp;#34;cfg_type&amp;#34;: &amp;#34;user_created&amp;#34;,
&amp;#34;created_timestamp&amp;#34;: 1691398216,
&amp;#34;last_modified_timestamp&amp;#34;: 1691398216,
&amp;#34;name&amp;#34;: &amp;#34;whoami&amp;#34;,
&amp;#34;path&amp;#34;: &amp;#34;/usr/bin/whoami&amp;#34;,
&amp;#34;uuid&amp;#34;: &amp;#34;b1aa8a28-1f28-4247-a4f4-f3540cf41634&amp;#34;
}
]
}
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="複製程式碼"
aria-label="複製程式碼"
data-copied-label="已複製！"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>合規</title><link>https://blog.kubeantony.com/archive/security/%E5%90%88%E8%A6%8F/</link><pubDate>Sat, 10 Jun 2023 07:37:36 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/%E5%90%88%E8%A6%8F/</guid><description>
&lt;h2&gt;Common Criteria&lt;span class="hx:absolute hx:-mt-20" id="common-criteria"&gt;&lt;/span&gt;
&lt;a href="#common-criteria" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;目的&lt;span class="hx:absolute hx:-mt-20" id="目的"&gt;&lt;/span&gt;
&lt;a href="#%e7%9b%ae%e7%9a%84" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;幫助買家確信任和產品的規範、實施和評估過程都是以標準化的方式進行。也就是說，已經根據國際公認的規格進行了獨立驗證，認明它是值得被信賴的&lt;/p&gt;
&lt;p&gt;Data Center、Internet Service Providers(電信公司)、金融和醫療的組織&amp;hellip;等，非常重視安全的非政府公司也會要求使用它&lt;/p&gt;
&lt;h3&gt;適用對象&lt;span class="hx:absolute hx:-mt-20" id="適用對象"&gt;&lt;/span&gt;
&lt;a href="#%e9%81%a9%e7%94%a8%e5%b0%8d%e8%b1%a1" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Computer systems
&lt;ul&gt;
&lt;li&gt;OS&lt;/li&gt;
&lt;li&gt;Databases&lt;/li&gt;
&lt;li&gt;Network Devices&lt;/li&gt;
&lt;li&gt;&amp;hellip;等&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;這份文件定義了一個能在網路環境下運作的通用作業系統所預期要提供的安全功能。&lt;/p&gt;</description></item><item><title>Linux 合規逐字稿</title><link>https://blog.kubeantony.com/archive/security/linux-%E5%90%88%E8%A6%8F%E9%80%90%E5%AD%97%E7%A8%BF/</link><pubDate>Tue, 06 Jun 2023 17:02:06 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/linux-%E5%90%88%E8%A6%8F%E9%80%90%E5%AD%97%E7%A8%BF/</guid><description>
&lt;h2&gt;資訊安全的重要性&lt;span class="hx:absolute hx:-mt-20" id="資訊安全的重要性"&gt;&lt;/span&gt;
&lt;a href="#%e8%b3%87%e8%a8%8a%e5%ae%89%e5%85%a8%e7%9a%84%e9%87%8d%e8%a6%81%e6%80%a7" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;維護資料的機密性
&lt;ol&gt;
&lt;li&gt;假設在家目錄，有一個檔案，裡面的內容包含了你的銀行帳號、密碼和其他敏感資料，這個檔案的權限是 777，存放這個檔案的目錄權限也是 777，權限都是 3 個 7 ，是不是代表會很幸運 ? 開玩笑地，下午幫大家提個神，是不是就代表這份資料非常的不機密。再來，&lt;/li&gt;
&lt;li&gt;我今天下了一個命令 &lt;code&gt;chmod 000 /etc/shadow&lt;/code&gt;，這樣是不是很機密，還沒完，有一台 Container 在啟動的時候，它的 Data Volume 把 Host 主機上的 /etc/shadow 這個檔案掛進來，怎麼辦? 你的資料是不是就不是這麼給他感覺不機密了。&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;維護資料的完整性&lt;/li&gt;
&lt;li&gt;確保系統的可用性&lt;/li&gt;
&lt;li&gt;遵守法律法規&lt;/li&gt;
&lt;li&gt;保護企業聲譽&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Multi Tenancy Security AAA</title><link>https://blog.kubeantony.com/archive/security/multi-tenancy-security-aaa/</link><pubDate>Sat, 07 Jan 2023 05:56:08 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/multi-tenancy-security-aaa/</guid><description>
&lt;hr&gt;
&lt;h2&gt;Kubernetes 一個大樓標準藍圖&lt;span class="hx:absolute hx:-mt-20" id="kubernetes-一個大樓標準藍圖"&gt;&lt;/span&gt;
&lt;a href="#kubernetes-%e4%b8%80%e5%80%8b%e5%a4%a7%e6%a8%93%e6%a8%99%e6%ba%96%e8%97%8d%e5%9c%96" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;img src="https://i.imgur.com/k8sLGAC.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;把 Kubernetes 想成一棟大樓的標準藍圖，把自己想成要當地產大亨，首先要先確認多少土地，能蓋多少大樓和住戶&amp;hellip;等，在 kubernetes 中，土地代表建立 k8s 的資源，以目前來說就是虛擬平台、三大公有雲 or 實體機，接著要開始蓋房子，以大樓來看，就是分住戶、公共建設和管理委員等，
公共建設是 K8s 啟動後須先安裝的&lt;/p&gt;
&lt;h2&gt;Multi Tenancy&lt;span class="hx:absolute hx:-mt-20" id="multi-tenancy"&gt;&lt;/span&gt;
&lt;a href="#multi-tenancy" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Soft multi-tenancy&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;which doesn’t have very strict isolation between tenants, is aimed at preventing accidental interference, and is suitable for trusted tenants.&lt;/li&gt;
&lt;li&gt;多人共用 k8s ，透過內建軟體隔離。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hard multi-tenancy&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;which assumes tenants cannot be trusted, enforces stricter isolation to protect tenants from malicious interference, and is suitable for both trusted and untrusted tenants.&lt;/li&gt;
&lt;li&gt;一個用戶一個 k8s ，代表會啟動不同的 K8s Cluster&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;AAA&lt;span class="hx:absolute hx:-mt-20" id="aaa"&gt;&lt;/span&gt;
&lt;a href="#aaa" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Authentication 身分認證
&lt;ul&gt;
&lt;li&gt;驗證你是誰&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Authorization 授權
&lt;ul&gt;
&lt;li&gt;你有什麼權限，可以做什麼事情&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Accounting(Auditing) 統計
&lt;ul&gt;
&lt;li&gt;使用者行為的紀錄&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Landlord 角色設計&lt;span class="hx:absolute hx:-mt-20" id="landlord-角色設計"&gt;&lt;/span&gt;
&lt;a href="#landlord-%e8%a7%92%e8%89%b2%e8%a8%ad%e8%a8%88" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Gateway
&lt;ul&gt;
&lt;li&gt;提供 SSH 登入的入口，透過 Deployment 分流，將連線轉向用戶專用的資源。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Tenant
&lt;ul&gt;
&lt;li&gt;用戶的專用資源，每個用戶家目錄都有 wk 資料夾，供用戶儲存個人資料，屬於永存資料區塊。&lt;/li&gt;
&lt;li&gt;透過 K8s 的 namespace 做環境的隔離&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Kuser
&lt;ul&gt;
&lt;li&gt;建立 Tenant 對應的 K8S 認證及授權。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Logger
&lt;ul&gt;
&lt;li&gt;接收 Tenant 操作命令及檔案編輯歷程，送至資料庫儲存。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Mariadb
&lt;ul&gt;
&lt;li&gt;儲存 Tenant 操作命令及檔案編輯歷程&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Landlord 架構圖&lt;span class="hx:absolute hx:-mt-20" id="landlord-架構圖"&gt;&lt;/span&gt;
&lt;a href="#landlord-%e6%9e%b6%e6%a7%8b%e5%9c%96" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;img src="https://i.imgur.com/5WKy3gp.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Landlord 資料流&lt;span class="hx:absolute hx:-mt-20" id="landlord-資料流"&gt;&lt;/span&gt;
&lt;a href="#landlord-%e8%b3%87%e6%96%99%e6%b5%81" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;img src="https://i.imgur.com/gUwZ5HK.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Landlord 監控&lt;span class="hx:absolute hx:-mt-20" id="landlord-監控"&gt;&lt;/span&gt;
&lt;a href="#landlord-%e7%9b%a3%e6%8e%a7" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Prometheus：住戶社區整體監控中心&lt;/li&gt;
&lt;li&gt;Grafana：監控中心裡的超大型 LED 儀表板&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;問題討論&lt;span class="hx:absolute hx:-mt-20" id="問題討論"&gt;&lt;/span&gt;
&lt;a href="#%e5%95%8f%e9%a1%8c%e8%a8%8e%e8%ab%96" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;為甚麼腳色大多使用 Deployment 設計
&lt;ul&gt;
&lt;li&gt;當管理的 pod 毀損或被刪除時，會自動再產生同樣的 pod 出來&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;為甚麼要有 Gateway 這個腳色
&lt;ul&gt;
&lt;li&gt;當我們透過 &lt;code&gt;ssh -p 20000 tenant-0@Gateway_Headless_Service_ExternalIP&lt;/code&gt; 連線時，&lt;/li&gt;
&lt;li&gt;Gateway 裡面的 &lt;code&gt;/etc/profile&lt;/code&gt; 會再放一段 &lt;code&gt;sshpass -p \$(whoami) ssh \$(whoami)@\$(whoami).${USERTAG}.${NS} -q 2&amp;gt;/dev/null&lt;/code&gt; 連線到 Tenant 的程式，&lt;/li&gt;
&lt;li&gt;Tenant 透過 StatefulSet 建出來的 pod 名字會有流水號，搭配無頭服務和 CoreDNS 來達到名稱解析&lt;/li&gt;
&lt;li&gt;當 Tenant 數量增加時，Gateway 也能知道連到哪一個 Tenant&lt;/li&gt;
&lt;li&gt;&lt;code&gt;${USERTAG}&lt;/code&gt; 是 StatefulSet 的名字&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;為甚麼 Tenant 要用 StatefulSets 設計
&lt;ul&gt;
&lt;li&gt;pod 的名字是流水號&lt;/li&gt;
&lt;li&gt;當所在主機掛點時，可在另一台主機生出來&lt;/li&gt;
&lt;li&gt;多個 pod 可共用 PVC&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Tenant 是透過何種方式達到永存資料
&lt;ul&gt;
&lt;li&gt;使用 Local Path Provisioner 來達到永存&lt;/li&gt;
&lt;li&gt;當 PV 所在的 node 掛了，資料還是救不回來，因為 PVC 建不出來 pod 也會無法建立&lt;/li&gt;
&lt;li&gt;可使用 NFS Storage 把資料備份到其他主機&lt;/li&gt;
&lt;li&gt;最佳解決方案 Ceph&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;可不可以沒有 Logger ，將資料直接放入 Mariadb
&lt;ul&gt;
&lt;li&gt;不行，要保護 Mariadb 不被 Tanent 隨意破壞&lt;/li&gt;
&lt;li&gt;Tanent 傳給 Logger 資料，再統一由 Logger 做資料傳送到 Mariadb&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;tags: &lt;code&gt;系統工程&lt;/code&gt;&lt;span class="hx:absolute hx:-mt-20" id="tags-系統工程"&gt;&lt;/span&gt;
&lt;a href="#tags-%e7%b3%bb%e7%b5%b1%e5%b7%a5%e7%a8%8b" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h6&gt;</description></item><item><title>`/etc/ssh/sshd_config` 的說明</title><link>https://blog.kubeantony.com/archive/security/etc-ssh-sshd-config-%E7%9A%84%E8%AA%AA%E6%98%8E/</link><pubDate>Sun, 07 Aug 2022 14:47:52 +0800</pubDate><guid>https://blog.kubeantony.com/archive/security/etc-ssh-sshd-config-%E7%9A%84%E8%AA%AA%E6%98%8E/</guid><description>
&lt;p&gt;一、修改nano /etc/ssh/sshd_config 文件&lt;/p&gt;
&lt;p&gt;1、修改默認端口：默認Port為22,並且已經註釋掉了；修改是把註釋去掉，並修改成其它的端口。
2、禁止root用戶遠程登陸：修改PermitRootLogin，默認為yes且註釋掉了；修改是把註釋去掉，並改成no。
3、PermitEmptyPasswords no不允許空密碼用戶login&lt;/p&gt;
&lt;p&gt;二、ssh的公鑰認證配置：
修改vi /etc/ssh/sshd_config 文件
RSAAuthentication yes # 啟用RSA 認證（默認是註釋掉的，將註釋去掉，如果不是yes，改為yes）
PubkeyAuthentication yes # 啟用公鑰認證（默認是註釋掉的，將註釋去掉，如果不是yes，改為yes）
PasswordAuthentication no # 禁止密碼認證(改為no,默認為yes是用密碼認證)
StrictModes no #修改為no,默認為yes.如果不修改用key登陸是出現server refused our key(如果StrictModes為yes必需保證存放公鑰的文件夾的擁有與登陸用戶名是相同的.“StrictModes”設置ssh在接收登錄請求之前是否檢查用戶家目錄和rhosts文件的權限和所有權。這通常是必要的，因為新手經常會把自己的目錄和文件設成任何人都有寫權限。)&lt;/p&gt;
&lt;p&gt;之後重新啟動ssh服務:/etc/init.d/ssh restart&lt;/p&gt;
&lt;p&gt;生成登陸公鑰與私鑰，
[root@usousou192_168_0_21 ssh]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /home/linden.guo/.ssh/id_rsa (生成私鑰與公鑰存放位置)
Enter passphrase (empty for no passphrase): 輸入密碼
Enter same passphrase again:再次輸入密碼
Your identification has been saved in /home/linden.guo/.ssh/id_rsa. (生成的私鑰)
Your public key has been saved in /home/linden.guo/.ssh/id_rsa.pub. (生成的公鑰)
The key fingerprint is:
76:04:4d:44:25:37:0f:b1:a5:b7:6e:63:d4:97:22:6b root@usousou192_168_0_21&lt;/p&gt;
&lt;p&gt;將生成的公鑰匙id_rsa.pub傳到要登陸的服務器上並追加到authorized_keys文件中，放到用戶目錄的.ssh中cat id_rsa.pub &amp;raquo; .ssh/authorized_keys (如果沒有authorized_keys，可直接將id_rsa.pub重命名為authorized_keys,自己認為，沒有測試過)&lt;/p&gt;
&lt;p&gt;使用putty連接ssh服務器。為了使用公鑰認證，我們需要同時下載puttygen 這個工具來生成putty 所使用的密鑰
如果你按照上面的介紹，在Linux下生成了公鑰和密鑰的話，那麼需要利用puttygen 將密鑰轉換成putty 使用的格式。將Linux下生成的密鑰id_rsa 複製到Windows 下。啟動puttygen，然後單擊Load按鈕，選擇文件類型為所有文件，然後選擇id_rsa，打開。若在生成密鑰時輸入了密碼，則打開時需要輸入該密碼(用linux生成密鑰時輸入的密碼)。之後就可以在puttygen 的主界面上單擊Save private key，保存成putty 格式的密鑰。&lt;/p&gt;
&lt;p&gt;最好確定用戶目錄下的.ssh文件夾對於擁有者有讀寫執行的權限，最低要有執行權限，如700或者100；authorized_keys文件中有讀的權限&lt;/p&gt;
&lt;p&gt;注：AuthorizedKeysFile .ssh/authorized_keys（認證文件的目錄與公鑰文件名稱，可以修改，並且相應目錄也要修改，如AuthorizedKeysFile .sshd/linden.guo_keys，需要在用戶目錄下建立.sshd文件夾，將linden.guo_keys文件放到下面）&lt;/p&gt;
&lt;p&gt;三、為什麼要使用公鑰認證
通常，通過ssh登錄遠程服務器時，使用密碼認證，分別輸入用戶名和密碼，兩者滿足一定規則就可以登錄。但是密碼認證有以下的缺點：&lt;/p&gt;
&lt;p&gt;用戶無法設置空密碼（即使系統允許空密碼，也會十分危險）
密碼容易被人偷窺或猜到
服務器上的一個帳戶若要給多人使用，則必須讓所有使用者都知道密碼，導緻密碼容易洩露，而且修改密碼時必須通知所有人
而使用公鑰認證則可以解決上述問題。&lt;/p&gt;
&lt;p&gt;公鑰認證允許使用空密碼，省去每次登錄都需要輸入密碼的麻煩
多個使用者可以通過各自的密鑰登錄到系統上的同一個用戶
公鑰認證的原理
所謂的公鑰認證，實際上是使用一對加密字符串，一個稱為公鑰(public key)，任何人都可以看到其內容，用於加密；另一個稱為密鑰(private key)，只有擁有者才能看到，用於解密。通過公鑰加密過的密文使用密鑰可以輕鬆解密，但根據公鑰來猜測密鑰卻十分困難。&lt;/p&gt;
&lt;p&gt;ssh 的公鑰認證就是使用了這一特性。服務器和客戶端都各自擁有自己的公鑰和密鑰。為了說明方便，以下將使用這些符號。&lt;/p&gt;
&lt;p&gt;Ac 客戶端公鑰
Bc 客戶端密鑰
As 服務器公鑰
Bs 服務器密鑰&lt;/p&gt;
&lt;p&gt;在認證之前，客戶端需要通過某種方法將公鑰Ac 登錄到服務器上。&lt;/p&gt;
&lt;p&gt;認證過程分為兩個步驟。&lt;/p&gt;
&lt;p&gt;會話密鑰(session key)生成
客戶端請求連接服務器，服務器將As 發送給客戶端。
服務器生成會話ID(session id)，設為p，發送給客戶端。
客戶端生成會話密鑰(session key)，設為q，併計算r = p xor q。
客戶端將r 用As 進行加密，結果發送給服務器。
服務器用Bs 進行解密，獲得r。
服務器進行r xor p 的運算，獲得q。
至此服務器和客戶端都知道了會話密鑰q，以後的傳輸都將被q 加密。
認證
服務器生成隨機數x，並用Ac 加密後生成結果S(x)，發送給客戶端
客戶端使用Bc 解密S(x) 得到x
客戶端計算q + x 的md5 值n(q+x)，q為上一步得到的會話密鑰
服務器計算q + x 的md5 值m(q+x)
客戶端將n(q+x) 發送給服務器
服務器比較m(q+x) 和n(q+x)，兩者相同則認證成功
服務器端設置
使用公鑰認證需要對服務器進行一些設置。修改/etc/sshd_config 的以下配置。&lt;/p&gt;
&lt;p&gt;RSAAuthentication yes # 啟用RSA 認證
PubkeyAuthentication yes # 啟用公鑰認證
PasswordAuthentication no # 禁止密碼認證StrictModes no #修改為no,默認為yes.如果不修改用key登陸是出現server refused our key然後重新啟動sshd。&lt;/p&gt;
&lt;p&gt;/etc/init.d/ssh restart客戶端設置
Linux
假設客戶端的用戶charlee 要以guest 用戶登錄到服務器上。首先在客戶端執行下面的命令。&lt;/p&gt;
&lt;p&gt;[charlee@client:~]$ ssh-keygen -t rsa
Generating public/private rsa1 key pair.
Enter file in which to save the key (/home/charlee/.ssh/id_rsa):
Enterpassphrase (empty for no passphrase): 輸入密碼
Enter same passphrase again: 再次輸入密碼
Your identification has been sabed in /home/charlee/.ssh/id_rsa
Your public key has been saved in /home/charlee/.ssh/id_rsa.pub生成的文件保存在主目錄的.ssh 目錄下，id_rsa為客戶端密鑰，id_rsa.pub 為客戶端公鑰。&lt;/p&gt;
&lt;p&gt;之後，通過U 盤等方式將公鑰id_rsa.pub 複製到服務器上，並執行下列命令。&lt;/p&gt;
&lt;p&gt;[guest@server:~]$ cat id_rsa.pub &amp;raquo; .ssh/authorized_keys其中id_rsa.pub 是客戶端的用戶charlee 的公鑰。&lt;/p&gt;
&lt;p&gt;這樣在客戶端即可通過以下的命令連接服務器。&lt;/p&gt;
&lt;p&gt;[charlee@client:~]$ ssh -l guest server若不想每次登錄服務器時都輸入密碼，可以先執行下列命令：&lt;/p&gt;
&lt;p&gt;[charlee@client:~]$ ssh-add
Enter passphrase for /home/charlee/.ssh/id_rsa: 輸入密碼
Identity added: /home/charlee/.ssh/id_rsa (/home/charlee/.ssh/id_rsa)以後登錄服務器就不需要輸入密碼了。&lt;/p&gt;
&lt;p&gt;Windows
假設我們使用putty連接ssh服務器。為了使用公鑰認證，我們需要同時下載puttygen 這個工具來生成putty 所使用的密鑰。&lt;/p&gt;
&lt;p&gt;使用Linux下生成的公鑰和密鑰的情況
如果你按照上面的介紹，在Linux下生成了公鑰和密鑰的話，那麼需要利用puttygen 將密鑰轉換成putty 使用的格式。&lt;/p&gt;
&lt;p&gt;將Linux下生成的密鑰id_rsa 複製到Windows 下。啟動puttygen，然後單擊Load按鈕，選擇文件類型為所有文件，然後選擇id_rsa，打開。若在生成密鑰時輸入了密碼，則打開時需要輸入該密碼。之後就可以在puttygen 的主界面上單擊Save private key，保存成putty 格式的密鑰。&lt;/p&gt;
&lt;p&gt;使用puttygen生成公鑰和密鑰
你也可以利用puttygen 直接生成公鑰和密鑰。打開puttygen，然後在畫面下方的Parameters 欄選擇加密算法和加密長度（一般取默認值即可），最後單擊Generate。畫面上會出現一個進度條，在界面上隨意移動鼠標以生成隨機數。最後提示生成結束，單擊Save private key 按鈕保存密鑰。最後將上方的Public key for pasting into OpenSSH authorized_keys file欄中的內容複製到Linux 下用戶主目錄下的~/.ssh/authorized_keys 文件中。&lt;/p&gt;
&lt;p&gt;設置putty 使用公鑰認證
先在putty中設置好連接的主機名、端口等信息（說明省略）。使用公鑰認證需要設置兩個地方：一個是Connection 中的Auto-login username，輸入在服務器上的用戶名；另一個是Connection-&amp;gt;SSH-&amp;gt;Auth中的Private key file for authentication，選擇剛才轉換或生成的.ppk 格式的密鑰。之後即可使用公鑰認證進行連接了。&lt;/p&gt;
&lt;h6&gt;tags: &lt;code&gt;Linux&lt;/code&gt;&lt;span class="hx:absolute hx:-mt-20" id="tags-linux"&gt;&lt;/span&gt;
&lt;a href="#tags-linux" class="subheading-anchor" aria-label="此章節的永久連結"&gt;&lt;/a&gt;&lt;/h6&gt;</description></item></channel></rss>