NeuVector
    https://github.com/neuvector/neuvector-helm
    https://github.com/neuvector/neuvector
    https://open-docs.neuvector.com/basics/overview

    设置中文
    image.png
    image.png
    image.png
    image.png
    image.png

    NeuVector-开源容器安全平台 - 图6

    NeuVector-开源容器安全平台 - 图7
    NeuVector-开源容器安全平台 - 图8

    image.png

    image.png

    image.png

    安装部署

    1. helm repo add neuvector https://neuvector.github.io/neuvector-helm/
    2. helm search repo neuvector/core
    1. kubectl create namespace neuvector
    1. [root@UR-20210425NAMA ~]# helm install neuvector --namespace neuvector neuvector/core
    2. NAME: neuvector
    3. LAST DEPLOYED: Tue Feb 22 15:10:14 2022
    4. NAMESPACE: neuvector
    5. STATUS: deployed
    6. REVISION: 1
    7. TEST SUITE: None
    8. NOTES:
    9. Get the NeuVector URL by running these commands:
    10. NODE_PORT=$(kubectl get --namespace neuvector -o jsonpath="{.spec.ports[0].nodePort}" services neuvector-service-webui)
    11. NODE_IP=$(kubectl get nodes --namespace neuvector -o jsonpath="{.items[0].status.addresses[0].address}")
    12. echo https://$NODE_IP:$NODE_PORT
    13. [root@UR-20210425NAMA ~]#
    1. kubectl set image deployment.apps/neuvector-controller-pod *=neuvector/controller.preview:5.0.0-preview.2 -n neuvector
    2. kubectl set image deployment.apps/neuvector-manager-pod *=neuvector/manager.preview:5.0.0-preview.2 -n neuvector
    3. kubectl set image deployment.apps/neuvector-scanner-pod *=neuvector/scanner.preview:latest -n neuvector
    4. kubectl set image daemonset.apps/neuvector-enforcer-pod *=neuvector/enforcer.preview:5.0.0-preview.2 -n neuvector
    5. kubectl get cronjob/neuvector-updater-pod -n neuvector -o yaml | sed 's#image: registry.neuvector.com/updater:latest#image: neuvector/updater.preview:latest#' | kubectl replace -f -

    修改镜像版本

    1. [root@UR-20210425NAMA ~]# ls -l core-1.9.1.tgz
    2. -rw-r--r-- 1 root root 14393 Mar 3 10:21 core-1.9.1.tgz
    3. [root@UR-20210425NAMA ~]# tar xf core-1.9.1.tgz
    4. [root@UR-20210425NAMA ~]# cd core/
    5. [root@UR-20210425NAMA core]# ls -l
    6. total 32
    7. -rwxr-xr-x 1 root root 285 Feb 19 15:43 Chart.yaml
    8. -rwxr-xr-x 1 root root 16378 Feb 19 15:43 README.md
    9. drwxr-xr-x 1 root root 4096 Mar 3 10:22 templates
    10. -rwxr-xr-x 1 root root 6550 Feb 19 15:43 values.yaml
    11. [root@UR-20210425NAMA core]# cat values.yaml
    12. # Default values for neuvector.
    13. # This is a YAML-formatted file.
    14. # Declare variables to be passed into the templates.
    15. openshift: false
    16. registry: registry.neuvector.com
    17. tag: 4.4.4
    18. oem:
    19. imagePullSecrets:
    20. psp: false
    21. serviceAccount: default
    22. controller:
    23. # If false, controller will not be installed
    24. enabled: true
    25. strategy:
    26. type: RollingUpdate
    27. rollingUpdate:
    28. maxSurge: 1
    29. maxUnavailable: 0
    30. image:
    31. repository: neuvector/controller
    32. hash:
    33. replicas: 3
    34. disruptionbudget: 0
    35. schedulerName:
    36. priorityClassName:
    37. env: []
    38. affinity:
    39. podAntiAffinity:
    40. preferredDuringSchedulingIgnoredDuringExecution:
    41. - weight: 100
    42. podAffinityTerm:
    43. labelSelector:
    44. matchExpressions:
    45. - key: app
    46. operator: In
    47. values:
    48. - neuvector-controller-pod
    49. topologyKey: "kubernetes.io/hostname"
    50. tolerations: []
    51. nodeSelector: {}
    52. # key1: value1
    53. # key2: value2
    54. apisvc:
    55. type:
    56. annotations: {}
    57. # OpenShift Route configuration
    58. route:
    59. enabled: false
    60. termination: passthrough
    61. host:
    62. pvc:
    63. enabled: false
    64. accessModes:
    65. - ReadWriteMany
    66. storageClass:
    67. capacity:
    68. azureFileShare:
    69. enabled: false
    70. secretName:
    71. shareName:
    72. certificate:
    73. secret:
    74. keyFile: tls.key
    75. pemFile: tls.pem
    76. federation:
    77. mastersvc:
    78. type:
    79. # Federation Master Ingress
    80. ingress:
    81. enabled: false
    82. host: # MUST be set, if ingress is enabled
    83. path: "/" # or this could be "/api", but might need "rewrite-target" annotation
    84. annotations:
    85. ingress.kubernetes.io/protocol: https
    86. # ingress.kubernetes.io/rewrite-target: /
    87. tls: false
    88. secretName:
    89. # OpenShift Route configuration
    90. route:
    91. enabled: false
    92. termination: passthrough
    93. host:
    94. managedsvc:
    95. type:
    96. # Federation Managed Ingress
    97. ingress:
    98. enabled: false
    99. host: # MUST be set, if ingress is enabled
    100. path: "/" # or this could be "/api", but might need "rewrite-target" annotation
    101. annotations:
    102. ingress.kubernetes.io/protocol: https
    103. # ingress.kubernetes.io/rewrite-target: /
    104. tls: false
    105. secretName:
    106. # OpenShift Route configuration
    107. route:
    108. enabled: false
    109. termination: passthrough
    110. host:
    111. ingress:
    112. enabled: false
    113. host: # MUST be set, if ingress is enabled
    114. path: "/" # or this could be "/api", but might need "rewrite-target" annotation
    115. annotations:
    116. ingress.kubernetes.io/protocol: https
    117. # ingress.kubernetes.io/rewrite-target: /
    118. tls: false
    119. secretName:
    120. resources: {}
    121. # limits:
    122. # cpu: 400m
    123. # memory: 2792Mi
    124. # requests:
    125. # cpu: 100m
    126. # memory: 2280Mi
    127. configmap:
    128. enabled: false
    129. data:
    130. # eulainitcfg.yaml: |
    131. # ...
    132. # ldapinitcfg.yaml: |
    133. # ...
    134. # oidcinitcfg.yaml: |
    135. # ...
    136. # samlinitcfg.yaml: |
    137. # ...
    138. # sysinitcfg.yaml: |
    139. # ...
    140. # userinitcfg.yaml: |
    141. # ...
    142. secret:
    143. # NOTE: files defined here have preferrence over the ones defined in the configmap section
    144. enabled: false
    145. data: {}
    146. # eulainitcfg.yaml:
    147. # license_key: 0Bca63Iy2FiXGqjk...
    148. # ...
    149. # ldapinitcfg.yaml:
    150. # directory: OpenLDAP
    151. # ...
    152. # oidcinitcfg.yaml:
    153. # Issuer: https://...
    154. # ...
    155. # samlinitcfg.yaml:
    156. # ...
    157. # sysinitcfg.yaml:
    158. # ...
    159. # userinitcfg.yaml:
    160. # ...
    161. enforcer:
    162. # If false, enforcer will not be installed
    163. enabled: true
    164. image:
    165. repository: neuvector/enforcer
    166. hash:
    167. priorityClassName:
    168. tolerations:
    169. - effect: NoSchedule
    170. key: node-role.kubernetes.io/master
    171. resources: {}
    172. # limits:
    173. # cpu: 400m
    174. # memory: 2792Mi
    175. # requests:
    176. # cpu: 100m
    177. # memory: 2280Mi
    178. manager:
    179. # If false, manager will not be installed
    180. enabled: true
    181. image:
    182. repository: neuvector/manager
    183. hash:
    184. priorityClassName:
    185. env:
    186. ssl: true
    187. svc:
    188. type: NodePort
    189. loadBalancerIP:
    190. annotations: {}
    191. # azure
    192. # service.beta.kubernetes.io/azure-load-balancer-internal: "true"
    193. # service.beta.kubernetes.io/azure-load-balancer-internal-subnet: "apps-subnet"
    194. # OpenShift Route configuration
    195. route:
    196. enabled: true
    197. termination: passthrough
    198. host:
    199. certificate:
    200. secret:
    201. keyFile: tls.key
    202. pemFile: tls.pem
    203. ingress:
    204. enabled: false
    205. host: # MUST be set, if ingress is enabled
    206. path: "/"
    207. annotations: {}
    208. # kubernetes.io/ingress.class: my-nginx
    209. # nginx.ingress.kubernetes.io/whitelist-source-range: "1.1.1.1"
    210. # nginx.ingress.kubernetes.io/rewrite-target: /
    211. # nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
    212. # only for end-to-end tls conf - ingress-nginx accepts backend self-signed cert
    213. # nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    214. tls: false
    215. secretName: # my-tls-secret
    216. resources: {}
    217. # limits:
    218. # cpu: 400m
    219. # memory: 2792Mi
    220. # requests:
    221. # cpu: 100m
    222. # memory: 2280Mi
    223. affinity: {}
    224. tolerations: []
    225. nodeSelector: {}
    226. # key1: value1
    227. # key2: value2
    228. cve:
    229. updater:
    230. # If false, cve updater will not be installed
    231. enabled: true
    232. secure: false
    233. image:
    234. repository: neuvector/updater
    235. tag: latest
    236. hash:
    237. schedule: "0 0 * * *"
    238. priorityClassName:
    239. scanner:
    240. enabled: true
    241. replicas: 3
    242. dockerPath: ""
    243. strategy:
    244. type: RollingUpdate
    245. rollingUpdate:
    246. maxSurge: 1
    247. maxUnavailable: 0
    248. image:
    249. repository: neuvector/scanner
    250. tag: latest
    251. hash:
    252. priorityClassName:
    253. resources: {}
    254. # limits:
    255. # cpu: 400m
    256. # memory: 2792Mi
    257. # requests:
    258. # cpu: 100m
    259. # memory: 2280Mi
    260. affinity: {}
    261. tolerations: []
    262. nodeSelector: {}
    263. # key1: value1
    264. # key2: value2
    265. docker:
    266. path: /var/run/docker.sock
    267. resources: {}
    268. # limits:
    269. # cpu: 400m
    270. # memory: 2792Mi
    271. # requests:
    272. # cpu: 100m
    273. # memory: 2280Mi
    274. k3s:
    275. enabled: false
    276. runtimePath: /run/k3s/containerd/containerd.sock
    277. bottlerocket:
    278. enabled: false
    279. runtimePath: /run/dockershim.sock
    280. containerd:
    281. enabled: false
    282. path: /var/run/containerd/containerd.sock
    283. crio:
    284. enabled: false
    285. path: /var/run/crio/crio.sock
    286. admissionwebhook:
    287. type: ClusterIP
    288. crdwebhook:
    289. enabled: true
    290. type: ClusterIP
    291. [root@UR-20210425NAMA core]#
    1. [root@ur-scm-master01 ~]# helm install neuvector --namespace neuvector neuvector/core
    2. Error: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "nvadmissioncontrolsecurityrules.neuvector.com" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "neuvector"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "neuvector"
    3. [root@ur-scm-master01 ~]#
    4. [root@ur-scm-master01 ~]#
    5. [root@ur-scm-master01 ~]# helm -n neuvector list
    6. NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
    7. [root@ur-scm-master01 ~]#
    8. [root@ur-scm-master01 ~]#
    9. [root@ur-scm-master01 ~]# kubectl get crd | grep nvad
    10. nvadmissioncontrolsecurityrules.neuvector.com 2022-01-19T05:23:50Z
    11. [root@ur-scm-master01 ~]#
    12. [root@ur-scm-master01 ~]#
    13. [root@ur-scm-master01 ~]#
    14. [root@ur-scm-master01 ~]# kubectl delete crd nvadmissioncontrolsecurityrules.neuvector.com
    15. customresourcedefinition.apiextensions.k8s.io "nvadmissioncontrolsecurityrules.neuvector.com" deleted
    16. [root@ur-scm-master01 ~]#
    17. [root@ur-scm-master01 ~]#
    18. [root@ur-scm-master01 ~]# helm install neuvector --namespace neuvector neuvector/core
    19. Error: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "nvwafsecurityrules.neuvector.com" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "neuvector"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "neuvector"
    20. [root@ur-scm-master01 ~]# kubectl get crd | grep neuvector
    21. nvwafsecurityrules.neuvector.com 2022-01-19T05:23:50Z
    22. [root@ur-scm-master01 ~]#
    23. [root@ur-scm-master01 ~]#
    24. [root@ur-scm-master01 ~]# kubectl delete crd nvwafsecurityrules.neuvector.com
    25. customresourcedefinition.apiextensions.k8s.io "nvwafsecurityrules.neuvector.com" deleted
    26. [root@ur-scm-master01 ~]# helm install neuvector --namespace neuvector neuvector/core
    27. NAME: neuvector
    28. LAST DEPLOYED: Thu Mar 3 10:06:43 2022
    29. NAMESPACE: neuvector
    30. STATUS: deployed
    31. REVISION: 1
    32. TEST SUITE: None
    33. NOTES:
    34. Get the NeuVector URL by running these commands:
    35. NODE_PORT=$(kubectl get --namespace neuvector -o jsonpath="{.spec.ports[0].nodePort}" services neuvector-service-webui)
    36. NODE_IP=$(kubectl get nodes --namespace neuvector -o jsonpath="{.items[0].status.addresses[0].address}")
    37. echo https://$NODE_IP:$NODE_PORT
    38. [root@ur-scm-master01 ~]#[root@ur-scm-master01 ~]# helm install neuvector --namespace neuvector neuvector/core
    39. Error: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "nvadmissioncontrolsecurityrules.neuvector.com" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "neuvector"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "neuvector"
    40. [root@ur-scm-master01 ~]#
    41. [root@ur-scm-master01 ~]#
    42. [root@ur-scm-master01 ~]# helm -n neuvector list
    43. NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
    44. [root@ur-scm-master01 ~]#
    45. [root@ur-scm-master01 ~]#
    46. [root@ur-scm-master01 ~]# kubectl get crd | grep nvad
    47. nvadmissioncontrolsecurityrules.neuvector.com 2022-01-19T05:23:50Z
    48. [root@ur-scm-master01 ~]#
    49. [root@ur-scm-master01 ~]#
    50. [root@ur-scm-master01 ~]#
    51. [root@ur-scm-master01 ~]# kubectl delete crd nvadmissioncontrolsecurityrules.neuvector.com
    52. customresourcedefinition.apiextensions.k8s.io "nvadmissioncontrolsecurityrules.neuvector.com" deleted
    53. [root@ur-scm-master01 ~]#
    54. [root@ur-scm-master01 ~]#
    55. [root@ur-scm-master01 ~]# helm install neuvector --namespace neuvector neuvector/core
    56. Error: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "nvwafsecurityrules.neuvector.com" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "neuvector"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "neuvector"
    57. [root@ur-scm-master01 ~]# kubectl get crd | grep neuvector
    58. nvwafsecurityrules.neuvector.com 2022-01-19T05:23:50Z
    59. [root@ur-scm-master01 ~]#
    60. [root@ur-scm-master01 ~]#
    61. [root@ur-scm-master01 ~]# kubectl delete crd nvwafsecurityrules.neuvector.com
    62. customresourcedefinition.apiextensions.k8s.io "nvwafsecurityrules.neuvector.com" deleted
    63. [root@ur-scm-master01 ~]# helm install neuvector --namespace neuvector neuvector/core
    64. NAME: neuvector
    65. LAST DEPLOYED: Thu Mar 3 10:06:43 2022
    66. NAMESPACE: neuvector
    67. STATUS: deployed
    68. REVISION: 1
    69. TEST SUITE: None
    70. NOTES:
    71. Get the NeuVector URL by running these commands:
    72. NODE_PORT=$(kubectl get --namespace neuvector -o jsonpath="{.spec.ports[0].nodePort}" services neuvector-service-webui)
    73. NODE_IP=$(kubectl get nodes --namespace neuvector -o jsonpath="{.items[0].status.addresses[0].address}")
    74. echo https://$NODE_IP:$NODE_PORT
    75. [root@ur-scm-master01 ~]#