|
6 | 6 | from commonlib.framework.reporting import skip_param_case, SkipReportData
|
7 | 7 |
|
8 | 8 | cis_1_2_4 = [(
|
9 |
| - 'CIS 1.2.4', |
10 |
| - { |
11 |
| - "set": { |
12 |
| - "--kubelet-https": "false", |
13 |
| - }, |
14 |
| - }, |
15 |
| - '/etc/kubernetes/manifests/kube-apiserver.yaml', |
16 |
| - 'failed' |
17 |
| -), |
18 |
| - ( |
19 |
| - 'CIS 1.2.4', |
20 |
| - { |
21 |
| - "set": { |
22 |
| - "--kubelet-https": "true", |
23 |
| - }, |
24 |
| - }, |
25 |
| - '/etc/kubernetes/manifests/kube-apiserver.yaml', |
26 |
| - 'passed' |
27 |
| -), |
28 |
| - ( |
29 | 9 | 'CIS 1.2.4',
|
30 | 10 | {
|
31 | 11 | "unset": [
|
|
416 | 396 | )]
|
417 | 397 |
|
418 | 398 | cis_1_2_5 = [(
|
419 |
| - 'CIS 1.2.5', |
420 |
| - { |
421 |
| - "set": { |
422 |
| - "--kubelet-client-certificate": "/etc/kubernetes/pki/apiserver-kubelet-client.crt ", |
423 |
| - "--kubelet-client-key": "/etc/kubernetes/pki/apiserver-kubelet-client.key" |
424 |
| - } |
425 |
| - }, |
426 |
| - '/etc/kubernetes/manifests/kube-apiserver.yaml', |
427 |
| - 'passed' |
428 |
| -)] |
| 399 | + 'CIS 1.2.5', |
| 400 | + { |
| 401 | + "set": { |
| 402 | + "--kubelet-client-certificate": "/etc/kubernetes/pki/apiserver-kubelet-client.crt", |
| 403 | + "--kubelet-client-key": "/etc/kubernetes/pki/apiserver-kubelet-client.key" |
| 404 | + } |
| 405 | + }, |
| 406 | + '/etc/kubernetes/manifests/kube-apiserver.yaml', |
| 407 | + 'passed' |
| 408 | + )] |
429 | 409 |
|
430 | 410 | cis_1_2_6 = [(
|
431 | 411 | 'CIS 1.2.6',
|
|
535 | 515 | 'CIS 1.2.10',
|
536 | 516 | {
|
537 | 517 | "set": {
|
538 |
| - "--enable-admission-plugins": "EventRateLimit" |
| 518 | + "--enable-admission-plugins": "EventRateLimit", |
| 519 | + "--admission-control-config-file": "/etc/kubernetes/pki/admission_config.yaml", |
539 | 520 | }
|
540 | 521 | },
|
541 | 522 | '/etc/kubernetes/manifests/kube-apiserver.yaml',
|
542 |
| - 'passed' |
543 |
| -)] |
| 523 | + 'passed', |
| 524 | + )] |
544 | 525 |
|
545 | 526 | cis_1_2_11 = [(
|
546 | 527 | 'CIS 1.2.11',
|
|
595 | 576 | )]
|
596 | 577 |
|
597 | 578 | cis_1_2_13 = [(
|
598 |
| - 'CIS 1.2.13', |
599 |
| - { |
600 |
| - "set": { |
601 |
| - "--enable-admission-plugins": "AlwaysDeny" |
602 |
| - } |
603 |
| - }, |
604 |
| - '/etc/kubernetes/manifests/kube-apiserver.yaml', |
605 |
| - 'failed' |
606 |
| -), |
| 579 | + 'CIS 1.2.13', |
| 580 | + { |
| 581 | + "unset": [ |
| 582 | + "--enable-admission-plugins" |
| 583 | + ] |
| 584 | + }, |
| 585 | + '/etc/kubernetes/manifests/kube-apiserver.yaml', |
| 586 | + 'failed' |
| 587 | + ), |
| 588 | + ( |
| 589 | + 'CIS 1.2.13', |
| 590 | + { |
| 591 | + "set": { |
| 592 | + "--enable-admission-plugins": "AlwaysPullImages" |
| 593 | + } |
| 594 | + }, |
| 595 | + '/etc/kubernetes/manifests/kube-apiserver.yaml', |
| 596 | + 'failed' |
| 597 | + ), |
607 | 598 | (
|
608 | 599 | 'CIS 1.2.13',
|
609 | 600 | {
|
|
697 | 688 | },
|
698 | 689 | '/etc/kubernetes/manifests/kube-apiserver.yaml',
|
699 | 690 | 'passed'
|
700 |
| -), |
701 |
| - ( |
702 |
| - 'CIS 1.2.17', |
703 |
| - { |
704 |
| - "set": { |
705 |
| - "--secure-port": "260492" |
706 |
| - } |
707 |
| - }, |
708 |
| - '/etc/kubernetes/manifests/kube-apiserver.yaml', |
709 |
| - 'failed' |
710 | 691 | ),
|
711 | 692 | (
|
712 | 693 | 'CIS 1.2.17',
|
|
855 | 836 | )]
|
856 | 837 |
|
857 | 838 | cis_1_2_23 = [(
|
858 |
| - 'CIS 1.2.23', |
859 |
| - { |
860 |
| - "set": { |
861 |
| - "--request-timeout": "-1s" |
862 |
| - } |
863 |
| - }, |
864 |
| - '/etc/kubernetes/manifests/kube-apiserver.yaml', |
865 |
| - 'failed' |
| 839 | + 'CIS 1.2.23', |
| 840 | + { |
| 841 | + "set": { |
| 842 | + "--request-timeout": "59s" |
| 843 | + } |
| 844 | + }, |
| 845 | + '/etc/kubernetes/manifests/kube-apiserver.yaml', |
| 846 | + 'failed' |
866 | 847 | ),
|
867 | 848 | (
|
868 | 849 | 'CIS 1.2.23',
|
|
974 | 955 | )]
|
975 | 956 |
|
976 | 957 | cis_1_2_32 = [(
|
977 |
| - 'CIS 1_2_32', |
978 |
| - { |
979 |
| - "set": { |
980 |
| - "--tls-cipher-suites": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_DUMMY" |
981 |
| - } |
982 |
| - }, |
983 |
| - '/etc/kubernetes/manifests/kube-apiserver.yaml', |
984 |
| - 'failed' |
985 |
| -), |
986 |
| - ( |
987 |
| - 'CIS 1_2_32', |
| 958 | + 'CIS 1.2.32', |
988 | 959 | {
|
989 | 960 | "set": {
|
990 | 961 | "--tls-cipher-suites": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
|
991 | 962 | }
|
992 | 963 | },
|
993 | 964 | '/etc/kubernetes/manifests/kube-apiserver.yaml',
|
994 | 965 | 'passed'
|
995 |
| -), |
| 966 | + ), |
996 | 967 | (
|
997 |
| - 'CIS 1_2_32', |
| 968 | + 'CIS 1.2.32', |
998 | 969 | {
|
999 | 970 | "set": {
|
1000 | 971 | "--tls-cipher-suites":
|
1001 |
| - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" |
| 972 | + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" |
1002 | 973 | }
|
1003 | 974 | },
|
1004 | 975 | '/etc/kubernetes/manifests/kube-apiserver.yaml',
|
1005 | 976 | 'passed'
|
1006 |
| -)] |
| 977 | + ), |
| 978 | + ( |
| 979 | + 'CIS 1.2.32', |
| 980 | + { |
| 981 | + "set": { |
| 982 | + "--tls-cipher-suites": |
| 983 | + "TLS_ECDHE_RSA_WITH_RC4_128_SHA,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" |
| 984 | + } |
| 985 | + }, |
| 986 | + '/etc/kubernetes/manifests/kube-apiserver.yaml', |
| 987 | + 'failed' |
| 988 | + )] |
1007 | 989 |
|
1008 | 990 | cis_4_2_1 = [(
|
1009 | 991 | 'CIS 4.2.1',
|
|
1301 | 1283 |
|
1302 | 1284 | api_server_rules = [
|
1303 | 1285 | *cis_1_2_2,
|
1304 |
| - *skip_param_case(skip_list=[*cis_1_2_3, |
1305 |
| - *cis_1_2_4, |
1306 |
| - *cis_1_2_5 |
1307 |
| - ], |
| 1286 | + *skip_param_case(skip_list=[*cis_1_2_3], |
1308 | 1287 | data_to_report=SkipReportData(
|
1309 |
| - skip_reason="This case fails and breaks cluster") |
1310 |
| - ), |
| 1288 | + url_title="security-team: #4975", |
| 1289 | + url_link="https://github.com/elastic/security-team/issues/4975", |
| 1290 | + skip_reason="Known issue: rule not implemented" |
| 1291 | + )), |
| 1292 | + *cis_1_2_4, |
| 1293 | + *cis_1_2_5, |
1311 | 1294 | *cis_1_2_6,
|
1312 | 1295 | *cis_1_2_7,
|
1313 | 1296 | *cis_1_2_8,
|
1314 |
| - *skip_param_case(skip_list=[*cis_1_2_9, |
1315 |
| - *cis_1_2_10 |
1316 |
| - ], |
| 1297 | + *cis_1_2_9[:1], |
| 1298 | + *skip_param_case(skip_list=[*cis_1_2_9[1:], *cis_1_2_10], |
1317 | 1299 | data_to_report=SkipReportData(
|
1318 |
| - skip_reason="This case fails and breaks cluster") |
1319 |
| - ), |
| 1300 | + url_title="security-team: #5128", |
| 1301 | + url_link="https://github.com/elastic/security-team/issues/5128", |
| 1302 | + skip_reason="Known issue: connection errors" |
| 1303 | + )), |
1320 | 1304 | *cis_1_2_11,
|
1321 | 1305 | *cis_1_2_12,
|
1322 | 1306 | *cis_1_2_13,
|
1323 | 1307 | *cis_1_2_14,
|
1324 | 1308 | *cis_1_2_15,
|
1325 | 1309 | *cis_1_2_16,
|
1326 |
| - *skip_param_case(skip_list=[*cis_1_2_17], |
1327 |
| - data_to_report=SkipReportData( |
1328 |
| - skip_reason="This case fails and breaks cluster") |
1329 |
| - ), |
| 1310 | + *cis_1_2_17, |
1330 | 1311 | *cis_1_2_18,
|
1331 | 1312 | *cis_1_2_19,
|
1332 | 1313 | *cis_1_2_20,
|
1333 | 1314 | *cis_1_2_21,
|
1334 | 1315 | *cis_1_2_22,
|
1335 |
| - *skip_param_case(skip_list=[*cis_1_2_23], |
1336 |
| - data_to_report=SkipReportData( |
1337 |
| - skip_reason="This case fails and breaks cluster") |
1338 |
| - ), |
| 1316 | + *cis_1_2_23, |
1339 | 1317 | *cis_1_2_24,
|
1340 | 1318 | *cis_1_2_25,
|
1341 | 1319 | *cis_1_2_26,
|
1342 | 1320 | *cis_1_2_27,
|
1343 | 1321 | *cis_1_2_28,
|
1344 | 1322 | *cis_1_2_29,
|
1345 |
| - *skip_param_case(skip_list=[*cis_1_2_32], |
1346 |
| - data_to_report=SkipReportData( |
1347 |
| - skip_reason="This case fails and breaks cluster") |
1348 |
| - ) |
| 1323 | + *cis_1_2_32, |
1349 | 1324 | ]
|
1350 | 1325 |
|
1351 | 1326 | controller_manager_rules = [
|
|
0 commit comments