Skip to content

Latest commit

 

History

History
718 lines (618 loc) · 37.3 KB

k8s_security.md

File metadata and controls

718 lines (618 loc) · 37.3 KB

https://cwal.tistory.com/18

https://coffeewhale.com/apiserver

https://sphong0417.tistory.com/53

https://happycloud-lee.tistory.com/259

https://www.samsungsds.com/kr/insights/kubernetes_security_automation.html

https://docs.openshift.com/container-platform/4.8/post_installation_configuration/machine-configuration-tasks.html

https://stackoverflow.com/questions/51027036/what-is-the-difference-between-apiserver-kubelet-client-apiserver-and-kubelet-c

인증서 기반 그룹 유저 생성

https://passwd.tistory.com/entry/k8s-%EC%9D%B8%EC%A6%9D%EC%84%9C-%EA%B8%B0%EB%B0%98-Group-User-%EC%83%9D%EC%84%B1?category=1213453

role , rolebinding 정리 좋음 https://jangcenter.tistory.com/123

openssl x509 -in kubelet-client.pem -text

[root@okd-4 pki]# pwd
/var/lib/kubelet/pki
[root@okd-4 pki]# openssl  x509 -in kubelet-client-current.pem -text
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            14:73:e6:28:19:d3:10:56:13:0f:ab:8c:ca:57:20:70
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: CN = kube-csr-signer_@1695003522
        Validity
            Not Before: Sep 18 05:28:57 2023 GMT
            Not After : Oct 18 02:18:43 2023 GMT
        Subject: O = system:nodes, CN = system:node:okd-4.okd4.ktdemo.duckdns.org
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub:
                    04:c7:f6:44:40:96:df:aa:8d:cc:56:98:59:80:aa:
                    3e:8d:25:ea:b5:d1:d7:69:f9:33:55:94:8d:03:df:
                    72:61:c4:f8:11:8a:e9:46:9a:74:3b:49:ea:ab:80:
                    58:f3:07:e5:2c:f2:3a:53:b8:e2:29:29:ab:06:16:
                    cb:e8:14:f0:31
                ASN1 OID: prime256v1
                NIST CURVE: P-256
        X509v3 extensions:
            X509v3 Key Usage: critical
                Digital Signature, Key Encipherment
            X509v3 Extended Key Usage:
                TLS Web Client Authentication
            X509v3 Basic Constraints: critical
                CA:FALSE
            X509v3 Authority Key Identifier:
                18:EA:C7:DE:10:D0:65:B1:9A:37:A9:E7:F9:91:C5:94:19:1B:1F:5E
    Signature Algorithm: sha256WithRSAEncryption
    Signature Value:
        55:b1:21:01:18:5a:31:67:bc:f8:7e:e7:e1:dd:1e:ae:83:82:
        97:2b:a9:b4:c5:5c:0a:cf:20:55:a8:90:26:1d:c1:84:f4:1e:
        0f:b0:aa:7d:35:4d:79:6b:77:f5:18:9a:b4:1a:dc:4f:03:ee:
        c7:6b:62:ef:51:a1:ab:45:84:02:04:bf:59:91:5f:d8:20:42:
        5e:05:d3:40:89:a3:f2:9f:b0:a0:4b:51:b2:60:59:39:ad:34:
        1d:d2:48:38:5d:6b:cb:cd:18:bd:20:24:bc:08:5f:04:f2:9d:
        76:df:6c:ae:47:fb:72:a6:31:81:70:c4:cb:c3:fe:73:2b:d5:
        7e:6b:f4:aa:d1:87:a5:df:96:32:16:7f:bb:e6:fa:3f:03:40:
        60:02:d8:e7:33:ef:ba:bb:59:06:51:c8:41:79:45:ef:97:3f:
        f8:56:20:79:98:8f:26:04:03:45:46:55:b9:c2:03:72:7f:6b:
        c8:c5:d7:5e:24:e2:c0:e1:6a:87:71:dd:55:e7:d4:e0:0f:41:
        99:9a:83:c5:36:60:b0:d1:83:57:9e:12:6a:90:5b:fa:35:34:
        4a:90:54:09:93:4e:be:3d:a7:e7:5b:a3:d1:98:a5:ab:fb:ee:
        25:81:4e:8e:d6:7a:94:c6:01:17:56:b9:6b:7d:1e:40:83:a0:
        38:78:75:2d
-----BEGIN CERTIFICATE-----
MIIChjCCAW6gAwIBAgIQFHPmKBnTEFYTD6uMylcgcDANBgkqhkiG9w0BAQsFADAm
MSQwIgYDVQQDDBtrdWJlLWNzci1zaWduZXJfQDE2OTUwMDM1MjIwHhcNMjMwOTE4
MDUyODU3WhcNMjMxMDE4MDIxODQzWjBLMRUwEwYDVQQKEwxzeXN0ZW06bm9kZXMx
MjAwBgNVBAMTKXN5c3RlbTpub2RlOm9rZC00Lm9rZDQua3RkZW1vLmR1Y2tkbnMu
b3JnMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEx/ZEQJbfqo3MVphZgKo+jSXq
tdHXafkzVZSNA99yYcT4EYrpRpp0O0nqq4BY8wflLPI6U7jiKSmrBhbL6BTwMaNW
MFQwDgYDVR0PAQH/BAQDAgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMCMAwGA1UdEwEB
/wQCMAAwHwYDVR0jBBgwFoAUGOrH3hDQZbGaN6nn+ZHFlBkbH14wDQYJKoZIhvcN
AQELBQADggEBAFWxIQEYWjFnvPh+5+HdHq6DgpcrqbTFXArPIFWokCYdwYT0Hg+w
qn01TXlrd/UYmrQa3E8D7sdrYu9RoatFhAIEv1mRX9ggQl4F00CJo/KfsKBLUbJg
WTmtNB3SSDhda8vNGL0gJLwIXwTynXbfbK5H+3KmMYFwxMvD/nMr1X5r9KrRh6Xf
ljIWf7vm+j8DQGAC2Ocz77q7WQZRyEF5Re+XP/hWIHmYjyYEA0VGVbnCA3J/a8jF
114k4sDhaodx3VXn1OAPQZmag8U2YLDRg1eeEmqQW/o1NEqQVAmTTr49p+dbo9GY
pav77iWBTo7WepTGARdWuWt9HkCDoDh4dS0=
-----END CERTIFICATE-----
[root@okd-4 pki]# ls
kubelet-client-2023-09-18-05-33-57.pem  kubelet-client-current.pem  kubelet-server-2023-09-18-05-34-21.pem  kubelet-server-current.pem
[root@okd-4 pki]# openssl  x509 -in kubelet-server-current.pem -text
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            a2:24:1e:38:57:aa:c3:2f:25:06:5d:6f:1a:9d:c2:b0
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: CN = kube-csr-signer_@1695003522
        Validity
            Not Before: Sep 18 05:29:21 2023 GMT
            Not After : Oct 18 02:18:43 2023 GMT
        Subject: O = system:nodes, CN = system:node:okd-4.okd4.ktdemo.duckdns.org
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub:
                    04:6d:9b:1b:cb:1f:79:0b:59:85:e1:d7:a2:06:48:
                    8f:fb:1e:50:dd:07:80:80:a1:b1:fa:1e:89:ef:9b:
                    d1:73:3e:28:a5:f8:e6:f6:55:fd:db:18:ed:a0:f3:
                    46:5c:a1:db:13:aa:fc:36:d5:4b:7a:8e:d6:05:72:
                    39:9e:94:5c:53
                ASN1 OID: prime256v1
                NIST CURVE: P-256
        X509v3 extensions:
            X509v3 Key Usage: critical
                Digital Signature, Key Encipherment
            X509v3 Extended Key Usage:
                TLS Web Server Authentication
            X509v3 Basic Constraints: critical
                CA:FALSE
            X509v3 Authority Key Identifier:
                18:EA:C7:DE:10:D0:65:B1:9A:37:A9:E7:F9:91:C5:94:19:1B:1F:5E
            X509v3 Subject Alternative Name:
                DNS:okd-4.okd4.ktdemo.duckdns.org, IP Address:192.168.1.150
    Signature Algorithm: sha256WithRSAEncryption
    Signature Value:
        70:a4:b6:13:2c:b2:06:0f:eb:69:1f:71:ad:0a:3e:49:00:2a:
        86:4a:38:69:fa:97:8a:52:72:93:22:37:3d:24:0a:ec:94:38:
        35:ab:70:65:33:48:bf:ca:76:b3:76:84:c9:cc:e9:af:bd:23:
        ce:93:a0:73:dd:f2:22:54:69:2f:02:10:29:a2:66:99:a5:35:
        73:8f:dc:9c:bb:46:a5:f8:38:b8:2b:95:1a:90:42:f6:86:9a:
        2c:f7:36:14:0d:66:ba:e6:20:b2:cd:34:45:0f:bb:f2:46:34:
        b9:a9:00:5a:95:3d:1e:6f:33:c7:b9:69:be:6b:10:5f:f6:6d:
        53:f1:b4:ca:f9:bf:50:11:52:c2:a5:f0:46:f5:a9:f5:25:41:
        26:bd:ae:41:61:cb:f7:da:07:d2:04:30:f2:b6:c1:da:b9:f9:
        46:da:ea:22:16:fb:66:e7:d5:1e:99:ca:98:bf:3c:d4:95:42:
        ff:eb:1c:6b:74:ff:98:bf:2f:76:13:24:e6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DVoaAKw0m2OaawzrItBOWpIYS2hO+q2P/0ZWT
LZZjFG4WNm9z9mkEdJIZoCFFVs0dk4nqvEruRDA=
-----END CERTIFICATE-----

[root@okd-4 pki]# cd /etc/kubernetes
[root@okd-4 kubernetes]# ls
ca.crt  cloud.conf  cni  kubeconfig  kubelet-ca.crt  kubelet-plugins  kubelet.conf  manifests  static-pod-resources
[root@okd-4 kubernetes]# cat kubelet.conf
kind: KubeletConfiguration
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
  x509:
    clientCAFile: /etc/kubernetes/kubelet-ca.crt
  anonymous:
    enabled: false
cgroupDriver: systemd
cgroupRoot: /
clusterDNS:
  - 172.30.0.10
clusterDomain: cluster.local
containerLogMaxSize: 50Mi
maxPods: 250
kubeAPIQPS: 50
kubeAPIBurst: 100
podPidsLimit: 4096
rotateCertificates: true
serializeImagePulls: false
staticPodPath: /etc/kubernetes/manifests
systemCgroups: /system.slice
featureGates:
  APIPriorityAndFairness: true
  RotateKubeletServerCertificate: true
  DownwardAPIHugePages: true
  CSIMigrationAzureFile: false
  CSIMigrationvSphere: false
serverTLSBootstrap: true
tlsMinVersion: VersionTLS12
tlsCipherSuites:
  - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
  - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
  - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
  - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
  - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
  - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256

[root@okd-4 kubernetes]# cat kubelet-ca.crt
-----BEGIN CERTIFICATE-----
MIIDMDCCAhigAwIBAgIITw6Zmi8uHKYwDQYJKoZIhvcNAQELBQAwNjESMBAGA1UE
CxMJb3BlbnNoaWZ0MSAwHgYDVQQDExdhZG1pbi1rdWJlY29uZmlnLXNpZ25lcjAe
Fw0yMzA5MDEwMDM2NTNaFw0zM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Ed5seAHIJJWtXwvOVsMQkUZ9v+DjniITr6DUSrilEGC0f3O1
OOnNdZ29ETm6h1l6NTmuYKh+byWN9xFELfqIqozQBxmS5FV0F+5pqDNjlJ7QlHfC
TfDMdNy49XFA8hp8kOvILqtxblQyTzsZ73vDVPykMNIs0S4hRir8PTrktkjFjCH2
TDAHLDmuOuM06WDH/GFEBl9ZGIlvm8Ta64co/4NRiMYjNZZsAwI1JR4t99589RjO
z4RaT9TYvahfW3uBnca7NBxwoYKSUbU8a+Tk87m6Z4zntgXVxTV9QuNdfCpvIMM1
58DDzBvs69PjLGNBdp7yV2peBQ8=
-----END CERTIFICATE-----

[root@okd-4 kubernetes]# cat kubeconfig
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURNakNDQWhxZ0F3SUJBZ0lJTlJZalpSZG0rQTR3RFFZSktvWklodmNOQVFFTEJRQXdOekVTTUJBR0ExVUUKQ3hNSmIzQmxibk5vYVdaME1TRXdId1lEVlFRREV4aHJkV0psTFdGd2FYTmxjblpsY2kxc1lpMXphV2R1WlhJdwpIaGNOTWpNd09UQXhNREF6TmpVMFdoY05Nek13T0RJNU1EQXpOalUwV2pBM01SSXdFQVlEVlFRTEV3bHZjR1Z1CmMyaHBablF4SVRBZkJnTlZCQU1UR0d0MVltVXRZWEJwYzJWeWRtVnlMV3hpTFhOcFoyNWxjakNDQVNJd0RRWUoKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBT2NIK0lwSU55c0w3S1NmUG1NaFNlUnYxayt1YUxXSApYL0E3em5DSlgzdWZiaWRXYVJiUjVUbHRVcVRDUUh2akZDWnJlT2txNjlUZGIyL1NsV04rQ3dCY1VZS2d3WGRoCkV6NjJGcTBDTHJPSHZPV3ZLeW04MGNnaVlHZ2lkR1BOdVBvbUdSTHVMZW04UXQyZGdONjU4V1hRUWJSWEtsK2cKOVUvaFpwYUs2RmphZWsvOW10WUJNQTNO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c0ZBQU9DQVFFQQpJOUlYckFzZTdkL01oZVV6U3BxYmNCOXl1ZE1xZzV2aDhNZ3VXS0sydEZvZDB0YVFCR2s3c3JWSElSOVY5OEFYClNyRXZiUSt6NEJCY3RXeFB4V3lJTGtEbU5RL3hlc2kvaFhyUVc1Q3d0ekZuWUIrNVdJRElJZFc3amt1M1dzUGwKZnRQcitPTTltS2VwYUFZUFpoUjhKUzBWWktzS3pmUVV0Q1hVUjFtakZ4RUV6VG1vQWlWZ1hrMEpyM01SeGFVSgpLRXZsamZ6WFpJSkdTVUdxVmtxMkNPUDV4ZXBNU0hpRmsxV05pdDVqTTVCNU1XckxDTzNidFl2dVBEdFEybXFWCmFsZlE4Vk9mazM4RDcyUnh2TllGNkNZdFJjQlBpZzJzUW5LYW9LMUFaYmVGWDB6cnFQNGR5SmRGZmhQRHU2OXMKR0hmWlZIeFN6cytlN0xBL0hPS3Ewdz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
    server: https://api-int.okd4.ktdemo.duckdns.org:6443
  name: local
contexts:
- context:
    cluster: local
    user: kubelet
  name: kubelet
current-context: kubelet
preferences: {}
users:
- name: kubelet
  user:
    token: eyJhbGciOiJSUzI1NiIsImtpZCI6IkJnWXp6Q1lqaW5qSjFvbDdaNWFkbFBYOHQ5WEtpQURNRFJYT3lQTkNJNzQifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJvcGVuc2hpZnQtbWFjaGluZS1jb25maWctb3BlcmF0b3IiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlY3JldC5uYW1lIjoibm9kZS1ib290c3RyYXBwZXItdG9rZW4iLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoibm9kZS1ib290c3RyYXBwZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiI3ODg2NzEyMy00YTVlLTQ3MTctODgxOS0yNDFhMGE1ZjYyZTciLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6b3BlbnNoaWZ0LW1hY2hpbmUtY29uZmlnLW9wZXJhdG9yOm5vZGUtYm9vdHN0cmFwcGVyIn0.TSHUaDVCMQw6IBLBTjb6LIeGPDaovaVa2v4thV9S1NrddNYM6jjrGWO-9Gigh0Kz0Ra48DhLdMMXvv7tVDJLEI3RJ3UgqdVI967bzjX95U_azCHxJf1eiE5KiAcAirZI7LvWrtqCY5R85bTNryTifS_MZJyGvB_I-7IUVtXqg1Dk_Iid7GwWk1ayLqpOEsrVgOGMgejjgnXeEDWGRVsDaiqe9h4A76N5JmsJeqvJn3jjc3w5mupDDaXLn2lphBbz5UubJFALSGTZH9TvmaxjvFVb9wvuhTHcqv3gurJ6gVdjSuA0FV81IT43wp_FfCA3IK9irIHvs6jEsCu7lp9o9Q

[root@okd-4 kubernetes]# systemctl status kubelet
● kubelet.service - Kubernetes Kubelet
     Loaded: loaded (/etc/systemd/system/kubelet.service; enabled; preset: disabled)
    Drop-In: /etc/systemd/system/kubelet.service.d
             └─01-kubens.conf, 10-mco-default-env.conf, 10-mco-default-madv.conf, 20-logging.conf, 20-nodenet.conf
     Active: active (running) since Mon 2023-09-18 05:32:19 UTC; 37min ago
   Main PID: 1769 (kubelet)
      Tasks: 20 (limit: 19051)
     Memory: 57.6M
        CPU: 59.059s
     CGroup: /system.slice/kubelet.service
             └─1769 /usr/bin/kubelet --config=/etc/kubernetes/kubelet.conf --bootstrap-kubeconfig=/etc/kubernetes/kubeconfig --kubeconfig=/var/lib/kubelet/kubeconfig --container-runti>

[root@okd-4 kubernetes]# cd /etc/systemd/system/kubelet.service.d
[root@okd-4 kubelet.service.d]# ls
01-kubens.conf  10-mco-default-env.conf  10-mco-default-madv.conf  20-logging.conf  20-nodenet.conf

master node 에서

참고 : https://kubernetes.io/ko/docs/tasks/administer-cluster/access-cluster-api/


[root@bastion ~]# kubectl config view -o jsonpath='{"Cluster name\tServer\n"}{range .clusters[*]}{.name}{"\t"}{.cluster.server}{"\n"}{end}'
Cluster name	Server
api-okd4-ktdemo-duckdns-org:6443	https://api.okd4.ktdemo.duckdns.org:6443
okd4	https://api.okd4.ktdemo.duckdns.org:6443

[root@bastion ~]# export CLUSTER_NAME="okd4"

APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name==\"$CLUSTER_NAME\")].cluster.server}")
[root@bastion ~]# APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name==\"$CLUSTER_NAME\")].cluster.server}")
[root@bastion ~]# echo $APISERVER
https://api.okd4.ktdemo.duckdns.org:6443

기본 서비스 어카운트용 토큰을 보관할 시크릿을 생성한다.

kubectl -n default apply -f - <<EOF apiVersion: v1 kind: Secret metadata: name: default-token annotations: kubernetes.io/service-account.name: default type: kubernetes.io/service-account-token EOF

[root@bastion ~]# kubectl -n default apply -f  - <<EOF
 apiVersion: v1
 kind: Secret
 metadata:
   name: default-token
   annotations:
     kubernetes.io/service-account.name: default
 type: kubernetes.io/service-account-token
 EOF
secret/default-token created

[root@bastion ~]# TOKEN=$(kubectl get secret default-token -o jsonpath='{.data.token}' -n default | base64 --decode)

[root@bastion ~]# curl -X GET $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
{
  "kind": "APIVersions",
  "versions": [
    "v1"
  ],
  "serverAddressByClientCIDRs": [
    {
      "clientCIDR": "0.0.0.0/0",
      "serverAddress": "192.168.1.146:6443"
    }
  ]
}
[root@bastion ~]# curl -X GET $APISERVER/api/v1/namespaces/default/pods --header "Authorization: Bearer $TOKEN" --insecure
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "Unauthorized",
  "reason": "Unauthorized",
  "code": 401
}

default-token의 값으로 다시 설정하고 테스트.

[root@bastion ~]# curl -X GET $APISERVER/api/v1/namespaces/default/pods --header "Authorization: Bearer $TOKEN" --insecure
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "pods is forbidden: User \"system:serviceaccount:default:default\" cannot list resource \"pods\" in API group \"\" in the namespace \"default\"",
  "reason": "Forbidden",
  "details": {
    "kind": "pods"
  },
  "code": 403
}

[root@bastion security]# vi pod-list-role.yaml
[root@bastion security]# vi pod-list-rolebinding.yaml
[root@bastion security]# kubectl apply -f pod-list-role.yaml
role.rbac.authorization.k8s.io/pod-list-role created
[root@bastion security]# kubectl apply -f pod-list-rolebinding.yaml
rolebinding.rbac.authorization.k8s.io/pod-list-rolebinding created
[root@bastion security]# curl -X GET $APISERVER/api/v1/namespaces/default/pods --header "Authorization: Bearer $TOKEN" --insecure
{
  "kind": "PodList",
  "apiVersion": "v1",
  "metadata": {
    "resourceVersion": "107346"
  },
  "items": []

kubectl create clusterrolebinding default-cluster-admin --clusterrole cluster-admin --serviceaccount default:default

oc adm policy add-scc-to-user anyuid system:serviceaccount:default:default


https://jangcenter.tistory.com/123 https://velog.io/@ehdrms2034/%EC%BF%A0%EB%B2%84%EB%84%A4%ED%8B%B0%EC%8A%A4-RBAC-%EA%B8%B0%EB%B0%98-ServiceAccount

[k8s] 사용자 전체 권한 확인 - 1

https://passwd.tistory.com/entry/k8s-%ED%98%84%EC%9E%AC-%EC%82%AC%EC%9A%A9%EC%9E%90-%EC%A0%84%EC%B2%B4-%EA%B6%8C%ED%95%9C-%ED%99%95%EC%9D%B8

pod-list-role.yaml

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: pod-list-role
  namespace: default
rules:
- apiGroups: [""]
  verbs: ["get", "list"]
  resources: ["pods"]

pod-list-rolebinding.yaml

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: pod-list-rolebinding
  namespace: default
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: pod-list-role
subjects:
- kind: ServiceAccount
  name: default
  namespace: default

[root@bastion security]# kubectl auth can-i list pods  --as system:serviceaccount:default:default -n default
yes
[root@bastion security]# kubectl auth can-i get pods  --as system:serviceaccount:default:default -n default
yes

[root@okd-1 static-pod-resources]# pwd
/etc/kubernetes/static-pod-resources
[root@okd-1 static-pod-resources]# ls
configmaps  etcd-pod-4            kube-apiserver-last-known-good  kube-apiserver-pod-5  kube-controller-manager-certs  kube-controller-manager-pod-7  kube-scheduler-pod-6
etcd-certs  etcd-pod-5            kube-apiserver-pod-2            kube-apiserver-pod-6  kube-controller-manager-pod-5  kube-scheduler-certs           kube-scheduler-pod-7
etcd-pod-2  kube-apiserver-certs  kube-apiserver-pod-4            kube-apiserver-pod-7  kube-controller-manager-pod-6  kube-scheduler-pod-4           secrets

helm repo add kubescape https://kubescape.github.io/helm-charts/ ; helm repo update ; helm upgrade --install kubescape kubescape/kubescape-operator -n kubescape --create-namespace --set clusterName=kubectl config current-context --set account=3054be31-a882-4c7e-a223-5b79d9e37157 --set server=api.armosec.io

[root@bastion /]# oc new-project kubescape
Now using project "kubescape" on server "https://api.okd4.ktdemo.duckdns.org:6443".

You can add applications to this project with the 'new-app' command. For example, try:

    oc new-app rails-postgresql-example

to build a new example application in Ruby. Or use kubectl to deploy a simple Kubernetes application:

    kubectl create deployment hello-node --image=k8s.gcr.io/e2e-test-images/agnhost:2.33 -- /agnhost serve-hostname

[root@bastion /]# oc adm policy add-scc-to-user anyuid -z default -n kubescape
clusterrole.rbac.authorization.k8s.io/system:openshift:scc:anyuid added: "default"
[root@bastion /]# oc adm policy add-scc-to-user privileged -z default -n kubescape
clusterrole.rbac.authorization.k8s.io/system:openshift:scc:privileged added: "default"

[root@bastion /]# helm upgrade --install kubescape kubescape/kubescape-operator -n kubescape --set clusterName=`kubectl config current-context` --set account=3054be31-a882-4c7e-a223-5b79d9e37157 --set server=api.armosec.io
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/okd4/auth/kubeconfig
Release "kubescape" has been upgraded. Happy Helming!
NAME: kubescape
LAST DEPLOYED: Tue Sep 19 12:37:32 2023
NAMESPACE: kubescape
STATUS: deployed
REVISION: 3
TEST SUITE: None
NOTES:
Thank you for installing kubescape-operator version 1.15.3.

You can see and change the values of your's recurring configurations daily scan in the following link:
https://cloud.armosec.io/settings/assets/clusters/scheduled-scans?cluster=kubescape-api-okd4-ktdemo-duckdns-org-6443-root
> kubectl -n kubescape get cj kubescape-scheduler -o=jsonpath='{.metadata.name}{"\t"}{.spec.schedule}{"\n"}'

You can see and change the values of your's recurring images daily scan in the following link:
https://cloud.armosec.io/settings/assets/images
> kubectl -n kubescape get cj kubevuln-scheduler -o=jsonpath='{.metadata.name}{"\t"}{.spec.schedule}{"\n"}'

See you!!!
[root@bastion /]# kubectl get po -n kubescrap
No resources found in kubescrap namespace.
[root@bastion /]# kubectl get po -n kubescape
NAME                             READY   STATUS    RESTARTS   AGE
gateway-8497d7696f-frmz8         1/1     Running   0          2m25s
nginx                            1/1     Running   0          3m31s
otel-collector-b98c5854f-tzpk4   1/1     Running   0          2m25s

[root@bastion dynamic_provisioning]# oc adm policy add-scc-to-user privileged -z storage -n kubescape
clusterrole.rbac.authorization.k8s.io/system:openshift:scc:privileged added: "storage"

[root@bastion ~]# kubectl run nginx --image=nginx -n default
Warning: would violate PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "nginx" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "nginx" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "nginx" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "nginx" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
pod/nginx created

[root@bastion ~]# kubectl edit namespace default -n default
apiVersion: v1
kind: Namespace
metadata:
  annotations:
    openshift.io/sa.scc.mcs: s0:c5,c0
    openshift.io/sa.scc.supplemental-groups: 1000020000/10000
    openshift.io/sa.scc.uid-range: 1000020000/10000
  creationTimestamp: "2023-09-01T03:07:17Z"
  labels:
    kubernetes.io/metadata.name: default
  name: default
  resourceVersion: "471"
  uid: 5df4c86f-47f9-497b-b172-cae76d79b31b
spec:
  finalizers:
  - kubernetes
status:
  phase: Active
[root@bastion ~]# kubectl edit namespace shclub -n shclub
apiVersion: v1
kind: Namespace
metadata:
  annotations:
    openshift.io/description: ""
    openshift.io/display-name: ""
    openshift.io/node-selector: devops=true
    openshift.io/requester: system:admin
    openshift.io/sa.scc.mcs: s0:c26,c15
    openshift.io/sa.scc.supplemental-groups: 1000680000/10000
    openshift.io/sa.scc.uid-range: 1000680000/10000
  creationTimestamp: "2023-09-01T04:03:58Z"
  labels:
    kubernetes.io/metadata.name: shclub
    pod-security.kubernetes.io/audit: baseline
    pod-security.kubernetes.io/audit-version: v1.24
    pod-security.kubernetes.io/warn: baseline
    pod-security.kubernetes.io/warn-version: v1.24
  name: shclub
  resourceVersion: "367807"
  uid: af28fd79-eb32-4aa6-bcc9-3a368b51271d
spec:
  finalizers:
  - kubernetes
status:
  phase: Active