This file is indexed.

/usr/share/scap-security-guide/ssg-debian8-xccdf.xml is in ssg-debian 0.1.31-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
<Benchmark xmlns="http://checklists.nist.gov/xccdf/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="DEBIAN-8" resolved="1" xml:lang="en-US" style="SCAP_1.1">
  <status date="2017-08-11">draft</status>
  <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Guide to the Secure Configuration of Debian 8</title>
  <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">This guide presents a catalog of security-relevant
configuration settings for Debian 8. It is a rendering of
content structured in the eXtensible Configuration Checklist Description Format (XCCDF)
in order to support security automation.  The SCAP content is
is available in the <html:code xmlns:html="http://www.w3.org/1999/xhtml">scap-security-guide</html:code> package which is developed at
<html:a xmlns:html="http://www.w3.org/1999/xhtml" href="https://www.open-scap.org/security-policies/scap-security-guide">https://www.open-scap.org/security-policies/scap-security-guide</html:a>.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
Providing system administrators with such guidance informs them how to securely
configure systems under their control in a variety of network roles. Policy
makers and baseline creators can use this catalog of settings, with its
associated references to higher-level security control catalogs, in order to
assist them in security baseline creation. This guide is a <html:i xmlns:html="http://www.w3.org/1999/xhtml">catalog, not a
checklist,</html:i> and satisfaction of every item is not likely to be possible or
sensible in many operational scenarios. However, the XCCDF format enables
granular selection and adjustment of settings, and their association with OVAL
and OCIL content provides an automated checking capability. Transformations of
this document, and its associated automated checking content, are capable of
providing baselines that meet a diverse set of policy objectives. Some example
XCCDF <html:i xmlns:html="http://www.w3.org/1999/xhtml">Profiles</html:i>, which are selections of items that form checklists and
can be used as baselines, are available with this guide. They can be
processed, in an automated fashion, with tools that support the Security
Content Automation Protocol (SCAP). The DISA STIG for Debian 8,
which provides required settings for US Department of Defense systems, is
one example of a baseline created from this guidance.
</description>
  <notice xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US" id="terms_of_use">Do not attempt to implement any of the settings in
this guide without first testing them in a non-operational environment. The
creators of this guidance assume no responsibility whatsoever for its use by
other parties, and makes no guarantees, expressed or implied, about its
quality, reliability, or any other characteristic.</notice>
  <front-matter xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The SCAP Security Guide Project<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
<html:a xmlns:html="http://www.w3.org/1999/xhtml" href="https://www.open-scap.org/security-policies/scap-security-guide">https://www.open-scap.org/security-policies/scap-security-guide</html:a></front-matter>
  <rear-matter xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Red Hat and Red Hat Enterprise Linux are either registered
trademarks or trademarks of Red Hat, Inc. in the United States and other
countries. All other names are registered trademarks or trademarks of their
respective companies.</rear-matter>
  <platform idref="cpe:/o:debianproject:debian:8"/>
  <version update="https://github.com/OpenSCAP/scap-security-guide/releases/latest">0.1.31</version>
  <metadata xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <dc:publisher xmlns:dc="http://purl.org/dc/elements/1.1/">SCAP Security Guide Project</dc:publisher>
    <dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SCAP Security Guide Project</dc:creator>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Gabe Alford &lt;redhatrises@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Christopher Anderson &lt;cba@fedoraproject.org&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Chuck Atkins &lt;chuck.atkins@kitware.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Molly Jo Bault &lt;Molly.Jo.Bault@ballardtech.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Joseph Bisch &lt;joseph.bisch@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Jeffrey Blank &lt;blank@eclipse.ncsc.mil&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Blake Burkhart &lt;blake.burkhart@us.af.mil&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Patrick Callahan &lt;pmc@patrickcallahan.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Carboni &lt;ncarboni@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Frank Caviggia &lt;fcaviggi@ra.iad.redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Christensen &lt;echriste@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Caleb Cooper &lt;coopercd@ornl.gov&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Maura Dailey &lt;maura@eclipse.ncsc.mil&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Klaas Demter &lt;demter@atix.de&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Jean-Baptiste Donnette &lt;jean-baptiste.donnette@epita.fr&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">drax &lt;applezip@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Greg Elin &lt;gregelin@gitmachines.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Andrew Gilmore &lt;agilmore2@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Joshua Glemza &lt;jglemza@nasa.gov&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Steve Grubb &lt;sgrubb@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Trey Henefield &lt;thenefield@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Price II &lt;robin@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Jeremiah Jahn &lt;jeremiah@goodinassociates.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Stephan Joerrens &lt;Stephan.Joerrens@fiduciagad.de&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Yuli Khodorkovskiy &lt;ykhodorkovskiy@tresys.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Kordell &lt;luke.t.kordell@lmco.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">kspargur &lt;kspargur@kspargur.csb&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Fen Labalme &lt;fen@civicactions.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Jan Lieskovsky &lt;jlieskov@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">&#352;imon Luka&#353;&#237;k &lt;slukasik@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Jamie Lorwey Martin &lt;jlmartin@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Michael McConachie &lt;michael@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Rodney Mercer &lt;rmercer@harris.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Brian Millett &lt;bmillett@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">mmosel &lt;mmosel@kde.example.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Zbynek Moravec &lt;zmoravec@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Kazuo Moriwaka &lt;moriwaka@users.noreply.github.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Michael Moseley &lt;michael@eclipse.ncsc.mil&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Joe Nall &lt;joe@nall.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Michele Newman &lt;mnewman@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Kaustubh Padegaonkar &lt;theTuxRacer@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Michael Palmiotto &lt;mpalmiotto@tresys.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">pcactr &lt;paul.c.arnold4.ctr@mail.mil&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Kenneth Peeples &lt;kennethwpeeples@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Frank Lin PIAT &lt;fpiat@klabs.be&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Martin Preisler &lt;mpreisle@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">T.O. Radzy Radzykewycz &lt;radzy@windriver.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Rick Renshaw &lt;Richard_Renshaw@xtoenergy.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Chris Reynolds &lt;c.reynolds82@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Pat Riehecky &lt;riehecky@fnal.gov&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Joshua Roys &lt;roysjosh@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">rrenshaw &lt;bofh69@yahoo.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Ray Shaw (Cont ARL/CISD) rvshaw &lt;rvshaw@esme.arl.army.mil&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Willy Santos &lt;wsantos@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Gautam Satish &lt;gautams@hpe.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Watson Sato &lt;wsato@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Satoru SATOH &lt;satoru.satoh@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Spencer Shimko &lt;sshimko@tresys.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Francisco Slavin &lt;fslavin@tresys.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">David Smith &lt;dsmith@eclipse.ncsc.mil&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Kevin Spargur &lt;kspargur@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Kenneth Stailey &lt;kstailey.lists@gmail.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Leland Steinke &lt;leland.j.steinke.ctr@mail.mil&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Philippe Thierry &lt;phil@reseau-libre.net&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Paul Tittle &lt;ptittle@cmf.nrl.navy.mil&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Jeb Trayer &lt;jeb.d.trayer@uscg.mil&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Shawn Wells &lt;shawn@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Rob Wilmoth &lt;rwilmoth@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Lucas Yamanishi &lt;lucas.yamanishi@onyxpoint.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Kevin Zimmerman &lt;kevin.zimmerman@kitware.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Jan &#268;ern&#253; &lt;jcerny@redhat.com&gt;</dc:contributor>
    <dc:contributor xmlns:dc="http://purl.org/dc/elements/1.1/">Michal &#352;ruba&#345; &lt;msrubar@redhat.com&gt;</dc:contributor>
    <dc:source xmlns:dc="http://purl.org/dc/elements/1.1/">https://github.com/OpenSCAP/scap-security-guide/releases/latest</dc:source>
  </metadata>
  <model system="urn:xccdf:scoring:default"/>
  <Profile id="common">
    <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Common Profile for General-Purpose Debian Systems</title>
    <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">This profile contains items common to general-purpose Debian 8 installations.</description>
    <select idref="partition_for_tmp" selected="true"/>
    <select idref="partition_for_var" selected="true"/>
    <select idref="partition_for_var_log" selected="true"/>
    <select idref="partition_for_var_log_audit" selected="true"/>
    <select idref="partition_for_home" selected="true"/>
    <select idref="package_auditd_installed" selected="true"/>
    <select idref="package_cron_installed" selected="true"/>
    <select idref="package_ntp_installed" selected="true"/>
    <select idref="package_rsyslog_installed" selected="true"/>
    <select idref="package_telnetd_removed" selected="true"/>
    <select idref="package_inetutils-telnetd_removed" selected="true"/>
    <select idref="package_telnetd-ssl_removed" selected="true"/>
    <select idref="package_nis_removed" selected="true"/>
    <select idref="package_ntpdate_removed" selected="true"/>
    <select idref="service_auditd_enabled" selected="true"/>
    <select idref="service_cron_enabled" selected="true"/>
    <select idref="service_ntpd_enabled" selected="true"/>
    <select idref="service_rsyslog_enabled" selected="true"/>
    <select idref="sshd_set_idle_timeout" selected="true"/>
    <select idref="sshd_disable_root_login" selected="true"/>
    <select idref="sshd_disable_empty_passwords" selected="true"/>
    <select idref="sshd_allow_only_protocol2" selected="true"/>
    <select idref="sshd_set_keepalive" selected="true"/>
    <select idref="rsyslog_files_ownership" selected="true"/>
    <select idref="rsyslog_files_groupownership" selected="true"/>
    <select idref="rsyslog_files_permissions" selected="true"/>
    <select idref="rsyslog_remote_loghost" selected="false"/>
    <select idref="ensure_logrotate_activated" selected="true"/>
    <select idref="file_permissions_systemmap" selected="true"/>
    <select idref="file_permissions_etc_shadow" selected="true"/>
    <select idref="file_permissions_etc_gshadow" selected="true"/>
    <select idref="file_permissions_etc_passwd" selected="true"/>
    <select idref="file_permissions_etc_group" selected="true"/>
    <select idref="sysctl_fs_protected_symlinks" selected="true"/>
    <select idref="sysctl_fs_protected_hardlinks" selected="true"/>
    <select idref="sysctl_fs_suid_dumpable" selected="true"/>
    <select idref="sysctl_kernel_randomize_va_space" selected="true"/>
    <select idref="remediation_functions" selected="false"/>
    <select idref="intro" selected="false"/>
    <select idref="general-principles" selected="false"/>
    <select idref="principle-encrypt-transmitted-data" selected="false"/>
    <select idref="principle-minimize-software" selected="false"/>
    <select idref="principle-separate-servers" selected="false"/>
    <select idref="principle-use-security-tools" selected="false"/>
    <select idref="principle-least-privilege" selected="false"/>
    <select idref="how-to-use" selected="false"/>
    <select idref="intro-read-sections-completely" selected="false"/>
    <select idref="intro-test-non-production" selected="false"/>
    <select idref="intro-root-shell-assumed" selected="false"/>
    <select idref="intro-formatting-conventions" selected="false"/>
    <select idref="intro-reboot-required" selected="false"/>
    <select idref="software" selected="false"/>
    <select idref="accounts" selected="false"/>
    <select idref="accounts-restrictions" selected="false"/>
    <select idref="rsyslog_sending_messages" selected="false"/>
    <select idref="rsyslog_accepting_remote_messages" selected="false"/>
    <refine-value idref="sshd_idle_timeout_value" selector="5_minutes"/>
  </Profile>
  <Profile id="anssi_np_nt28_minimal">
    <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Profile for ANSSI DAT-NT28 Minimal Level</title>
    <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">This profile contains items to be applied systematically.</description>
    <select idref="package_telnetd_removed" selected="true"/>
    <select idref="package_inetutils-telnetd_removed" selected="true"/>
    <select idref="package_telnetd-ssl_removed" selected="true"/>
    <select idref="package_nis_removed" selected="true"/>
    <select idref="file_permissions_etc_shadow" selected="true"/>
    <select idref="file_permissions_etc_gshadow" selected="true"/>
    <select idref="file_permissions_etc_passwd" selected="true"/>
    <select idref="file_permissions_etc_group" selected="true"/>
    <select idref="remediation_functions" selected="false"/>
    <select idref="intro" selected="false"/>
    <select idref="general-principles" selected="false"/>
    <select idref="principle-encrypt-transmitted-data" selected="false"/>
    <select idref="principle-minimize-software" selected="false"/>
    <select idref="principle-separate-servers" selected="false"/>
    <select idref="principle-use-security-tools" selected="false"/>
    <select idref="principle-least-privilege" selected="false"/>
    <select idref="how-to-use" selected="false"/>
    <select idref="intro-read-sections-completely" selected="false"/>
    <select idref="intro-test-non-production" selected="false"/>
    <select idref="intro-root-shell-assumed" selected="false"/>
    <select idref="intro-formatting-conventions" selected="false"/>
    <select idref="intro-reboot-required" selected="false"/>
    <select idref="software" selected="false"/>
    <select idref="permission_important_state_files" selected="false"/>
    <select idref="restriction" selected="false"/>
    <select idref="coredumps" selected="false"/>
    <select idref="enable_execshield_settings" selected="false"/>
    <select idref="fs-part" selected="false"/>
    <select idref="installation-storage-partitioning" selected="false"/>
    <select idref="fs-restrict" selected="false"/>
    <select idref="accounts" selected="false"/>
    <select idref="accounts-restrictions" selected="false"/>
    <select idref="logging" selected="false"/>
    <select idref="ensure_rsyslog_log_file_configuration" selected="false"/>
    <select idref="rsyslog_sending_messages" selected="false"/>
    <select idref="rsyslog_accepting_remote_messages" selected="false"/>
    <select idref="log_rotation" selected="false"/>
    <select idref="basics" selected="false"/>
    <select idref="ssh" selected="false"/>
    <select idref="ssh_server" selected="false"/>
  </Profile>
  <Profile id="anssi_np_nt28_average">
    <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US" override="true">Profile for ANSSI DAT-NT28 Average (Intermediate) Level</title>
    <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US" override="true">This profile contains items for GNU/Linux installations already protected by multiple higher level security stacks.</description>
    <select idref="package_telnetd_removed" selected="true"/>
    <select idref="package_inetutils-telnetd_removed" selected="true"/>
    <select idref="package_telnetd-ssl_removed" selected="true"/>
    <select idref="package_nis_removed" selected="true"/>
    <select idref="file_permissions_etc_shadow" selected="true"/>
    <select idref="file_permissions_etc_gshadow" selected="true"/>
    <select idref="file_permissions_etc_passwd" selected="true"/>
    <select idref="file_permissions_etc_group" selected="true"/>
    <select idref="partition_for_tmp" selected="true"/>
    <select idref="partition_for_var" selected="true"/>
    <select idref="partition_for_var_log" selected="true"/>
    <select idref="partition_for_var_log_audit" selected="true"/>
    <select idref="partition_for_home" selected="true"/>
    <select idref="package_ntp_installed" selected="true"/>
    <select idref="package_ntpdate_removed" selected="true"/>
    <select idref="package_rsyslog_installed" selected="true"/>
    <select idref="service_rsyslog_enabled" selected="true"/>
    <select idref="sshd_set_idle_timeout" selected="true"/>
    <select idref="sshd_disable_root_login" selected="true"/>
    <select idref="sshd_disable_empty_passwords" selected="true"/>
    <select idref="sshd_allow_only_protocol2" selected="true"/>
    <select idref="sshd_set_keepalive" selected="true"/>
    <select idref="rsyslog_files_ownership" selected="true"/>
    <select idref="rsyslog_files_groupownership" selected="true"/>
    <select idref="rsyslog_files_permissions" selected="true"/>
    <select idref="rsyslog_remote_loghost" selected="false"/>
    <select idref="ensure_logrotate_activated" selected="true"/>
    <select idref="file_permissions_systemmap" selected="true"/>
    <select idref="sysctl_fs_protected_symlinks" selected="true"/>
    <select idref="sysctl_fs_protected_hardlinks" selected="true"/>
    <select idref="sysctl_fs_suid_dumpable" selected="true"/>
    <select idref="sysctl_kernel_randomize_va_space" selected="true"/>
    <select idref="remediation_functions" selected="false"/>
    <select idref="intro" selected="false"/>
    <select idref="general-principles" selected="false"/>
    <select idref="principle-encrypt-transmitted-data" selected="false"/>
    <select idref="principle-minimize-software" selected="false"/>
    <select idref="principle-separate-servers" selected="false"/>
    <select idref="principle-use-security-tools" selected="false"/>
    <select idref="principle-least-privilege" selected="false"/>
    <select idref="how-to-use" selected="false"/>
    <select idref="intro-read-sections-completely" selected="false"/>
    <select idref="intro-test-non-production" selected="false"/>
    <select idref="intro-root-shell-assumed" selected="false"/>
    <select idref="intro-formatting-conventions" selected="false"/>
    <select idref="intro-reboot-required" selected="false"/>
    <select idref="software" selected="false"/>
    <select idref="accounts" selected="false"/>
    <select idref="accounts-restrictions" selected="false"/>
    <select idref="rsyslog_sending_messages" selected="false"/>
    <select idref="rsyslog_accepting_remote_messages" selected="false"/>
    <refine-value idref="sshd_idle_timeout_value" selector="5_minutes"/>
  </Profile>
  <Profile id="anssi_np_nt28_restrictive">
    <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US" override="true">Profile for ANSSI DAT-NT28 Restrictive Level</title>
    <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US" override="true">This profile contains items for GNU/Linux installations exposed to unauthenticated flows or multiple sources.</description>
    <select idref="package_telnetd_removed" selected="true"/>
    <select idref="package_inetutils-telnetd_removed" selected="true"/>
    <select idref="package_telnetd-ssl_removed" selected="true"/>
    <select idref="package_nis_removed" selected="true"/>
    <select idref="file_permissions_etc_shadow" selected="true"/>
    <select idref="file_permissions_etc_gshadow" selected="true"/>
    <select idref="file_permissions_etc_passwd" selected="true"/>
    <select idref="file_permissions_etc_group" selected="true"/>
    <select idref="package_ntp_installed" selected="true"/>
    <select idref="package_ntpdate_removed" selected="true"/>
    <select idref="package_rsyslog_installed" selected="true"/>
    <select idref="service_rsyslog_enabled" selected="true"/>
    <select idref="sshd_set_idle_timeout" selected="true"/>
    <select idref="sshd_disable_root_login" selected="true"/>
    <select idref="sshd_disable_empty_passwords" selected="true"/>
    <select idref="sshd_allow_only_protocol2" selected="true"/>
    <select idref="sshd_set_keepalive" selected="true"/>
    <select idref="rsyslog_files_ownership" selected="true"/>
    <select idref="rsyslog_files_groupownership" selected="true"/>
    <select idref="rsyslog_files_permissions" selected="true"/>
    <select idref="rsyslog_remote_loghost" selected="false"/>
    <select idref="ensure_logrotate_activated" selected="true"/>
    <select idref="file_permissions_systemmap" selected="true"/>
    <select idref="sysctl_fs_protected_symlinks" selected="true"/>
    <select idref="sysctl_fs_protected_hardlinks" selected="true"/>
    <select idref="sysctl_fs_suid_dumpable" selected="true"/>
    <select idref="sysctl_kernel_randomize_va_space" selected="true"/>
    <select idref="partition_for_tmp" selected="true"/>
    <select idref="partition_for_var" selected="true"/>
    <select idref="partition_for_var_log" selected="true"/>
    <select idref="partition_for_var_log_audit" selected="true"/>
    <select idref="partition_for_home" selected="true"/>
    <select idref="package_auditd_installed" selected="true"/>
    <select idref="package_cron_installed" selected="true"/>
    <select idref="service_auditd_enabled" selected="true"/>
    <select idref="service_ntpd_enabled" selected="true"/>
    <select idref="remediation_functions" selected="false"/>
    <select idref="intro" selected="false"/>
    <select idref="general-principles" selected="false"/>
    <select idref="principle-encrypt-transmitted-data" selected="false"/>
    <select idref="principle-minimize-software" selected="false"/>
    <select idref="principle-separate-servers" selected="false"/>
    <select idref="principle-use-security-tools" selected="false"/>
    <select idref="principle-least-privilege" selected="false"/>
    <select idref="how-to-use" selected="false"/>
    <select idref="intro-read-sections-completely" selected="false"/>
    <select idref="intro-test-non-production" selected="false"/>
    <select idref="intro-root-shell-assumed" selected="false"/>
    <select idref="intro-formatting-conventions" selected="false"/>
    <select idref="intro-reboot-required" selected="false"/>
    <select idref="software" selected="false"/>
    <select idref="accounts" selected="false"/>
    <select idref="accounts-restrictions" selected="false"/>
    <select idref="rsyslog_sending_messages" selected="false"/>
    <select idref="rsyslog_accepting_remote_messages" selected="false"/>
    <refine-value idref="sshd_idle_timeout_value" selector="5_minutes"/>
  </Profile>
  <Profile id="anssi_np_nt28_high">
    <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US" override="true">Profile for ANSSI DAT-NT28 High (Enforced) Level</title>
    <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US" override="true">This profile contains items for GNU/Linux installations storing sensitive informations that can be accessible from unauthenticated or uncontroled networks.</description>
    <select idref="package_telnetd_removed" selected="true"/>
    <select idref="package_inetutils-telnetd_removed" selected="true"/>
    <select idref="package_telnetd-ssl_removed" selected="true"/>
    <select idref="package_nis_removed" selected="true"/>
    <select idref="file_permissions_etc_shadow" selected="true"/>
    <select idref="file_permissions_etc_gshadow" selected="true"/>
    <select idref="file_permissions_etc_passwd" selected="true"/>
    <select idref="file_permissions_etc_group" selected="true"/>
    <select idref="package_ntp_installed" selected="true"/>
    <select idref="package_ntpdate_removed" selected="true"/>
    <select idref="package_rsyslog_installed" selected="true"/>
    <select idref="service_rsyslog_enabled" selected="true"/>
    <select idref="sshd_set_idle_timeout" selected="true"/>
    <select idref="sshd_disable_root_login" selected="true"/>
    <select idref="sshd_disable_empty_passwords" selected="true"/>
    <select idref="sshd_allow_only_protocol2" selected="true"/>
    <select idref="sshd_set_keepalive" selected="true"/>
    <select idref="rsyslog_files_ownership" selected="true"/>
    <select idref="rsyslog_files_groupownership" selected="true"/>
    <select idref="rsyslog_files_permissions" selected="true"/>
    <select idref="rsyslog_remote_loghost" selected="false"/>
    <select idref="ensure_logrotate_activated" selected="true"/>
    <select idref="file_permissions_systemmap" selected="true"/>
    <select idref="sysctl_fs_protected_symlinks" selected="true"/>
    <select idref="sysctl_fs_protected_hardlinks" selected="true"/>
    <select idref="sysctl_fs_suid_dumpable" selected="true"/>
    <select idref="sysctl_kernel_randomize_va_space" selected="true"/>
    <select idref="partition_for_tmp" selected="true"/>
    <select idref="partition_for_var" selected="true"/>
    <select idref="partition_for_var_log" selected="true"/>
    <select idref="partition_for_var_log_audit" selected="true"/>
    <select idref="partition_for_home" selected="true"/>
    <select idref="package_auditd_installed" selected="true"/>
    <select idref="package_cron_installed" selected="true"/>
    <select idref="service_auditd_enabled" selected="true"/>
    <select idref="service_ntpd_enabled" selected="true"/>
    <select idref="remediation_functions" selected="false"/>
    <select idref="intro" selected="false"/>
    <select idref="general-principles" selected="false"/>
    <select idref="principle-encrypt-transmitted-data" selected="false"/>
    <select idref="principle-minimize-software" selected="false"/>
    <select idref="principle-separate-servers" selected="false"/>
    <select idref="principle-use-security-tools" selected="false"/>
    <select idref="principle-least-privilege" selected="false"/>
    <select idref="how-to-use" selected="false"/>
    <select idref="intro-read-sections-completely" selected="false"/>
    <select idref="intro-test-non-production" selected="false"/>
    <select idref="intro-root-shell-assumed" selected="false"/>
    <select idref="intro-formatting-conventions" selected="false"/>
    <select idref="intro-reboot-required" selected="false"/>
    <select idref="software" selected="false"/>
    <select idref="accounts" selected="false"/>
    <select idref="accounts-restrictions" selected="false"/>
    <select idref="rsyslog_sending_messages" selected="false"/>
    <select idref="rsyslog_accepting_remote_messages" selected="false"/>
    <refine-value idref="sshd_idle_timeout_value" selector="5_minutes"/>
  </Profile>
  <Group id="remediation_functions">
    <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation functions used by the SCAP Security Guide Project</title>
    <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">XCCDF form of the various remediation functions as used by
remediation scripts from the SCAP Security Guide Project</description>
    <Value id="function_fix_audit_syscall_rule" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function to fix syscall audit rule for given system call</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Function to fix syscall audit rule for given system call. It is
based on example audit syscall rule definitions as outlined in
/usr/share/doc/audit-2.3.7/stig.rules file provided with the audit package. It
will combine multiple system calls belonging to the same syscall group into one
audit rule (rather than to create audit rule per different system call) to
avoid audit infrastructure performance penalty in the case of
'one-audit-rule-definition-per-one-system-call'. See:

	https://www.redhat.com/archives/linux-audit/2014-November/msg00009.html

for further details.

Expects five arguments (each of them is required) in the form of:
  * audit tool                          tool used to load audit rules,
                                        either 'auditctl', or 'augenrules
  * audit rules' pattern                audit rule skeleton for same syscall
  * syscall group                       greatest common string this rule shares
                                        with other rules from the same group
  * architecture                        architecture this rule is intended for
  * full form of new rule to add        expected full form of audit rule as to
                                        be added into audit.rules file

Note: The 2-th up to 4-th arguments are used to determine how many existing
audit rules will be inspected for resemblance with the new audit rule
(5-th argument) the function is going to add. The rule's similarity check
is performed to optimize audit.rules definition (merge syscalls of the same
group into one rule) to avoid the "single-syscall-per-audit-rule" performance
penalty.

Example call:

  PATTERN="-a always,exit -F arch=$ARCH -S .* -F auid&gt;=500 -F auid!=4294967295 -k delete"
  # Use escaped BRE regex to specify rule group
  GROUP="\(rmdir\|unlink\|rename\)"
  FULL_RULE="-a always,exit -F arch=$ARCH -S rmdir -S unlink -S unlinkat -S rename -S renameat -F auid&gt;=500 -F auid!=4294967295 -k delete"
  fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
</description>
      <value>
function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] &amp;&amp; [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset $IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset $IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch &amp; key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" &lt;&lt;&lt; "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule =&gt; existing rule can be deleted
                                # Thus delete the rule from audit.rules &amp; our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' =&gt; group='chown'
                                # since 'lchown' &amp; 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array &lt;&lt;&lt; "$rule_syscalls"
                                # Reset IFS back to default
                                unset $IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" &lt;&lt;&lt; "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" &gt;&gt; "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture &amp; key =&gt; don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch &amp; key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" &gt;&gt; "$audit_file"
        fi
done

}
</value>
    </Value>
    <Value id="function_fix_audit_watch_rule" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function to fix audit file system object watch rule for given path</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Function to fix audit file system object watch rule for given path:
  * if rule exists, also verifies the -w bits match the requirements
  * if rule doesn't exist yet, appends expected rule form to $files_to_inspect
    audit rules file, depending on the tool which was used to load audit rules

Expects four arguments (each of them is required) in the form of:
  * audit tool                          tool used to load audit rules,
                                        either 'auditctl', or 'augenrules'
  * path                                value of -w audit rule's argument
  * required access bits                value of -p audit rule's argument
  * key                                 value of -k audit rule's argument

Example call:

  fix_audit_watch_rule "auditctl" "/etc/localtime" "wa" "audit_time_rules"
</description>
      <value>
function fix_audit_watch_rule {

# Load function arguments into local variables
local tool="$1"
local path="$2"
local required_access_bits="$3"
local key="$4"

# Check sanity of the input
if [ $# -ne "4" ]
then
        echo "Usage: fix_audit_watch_rule 'tool' 'path' 'bits' 'key'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
#
# -----------------------------------------------------------------------------------------
# Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#       auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#       augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#       augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
declare -a files_to_inspect

# Check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] &amp;&amp; [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If the audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# into the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules')
# If the audit is 'augenrules', then check if rule is already defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to list of files for inspection.
# If rule isn't defined, add '/etc/audit/rules.d/$key.rules' to list of files for inspection.
elif [ "$tool" == 'augenrules' ]
then
        # Case when particular audit rule is already defined in some of /etc/audit/rules.d/*.rules file
        # Get pair -- filepath : matching_row into @matches array
        IFS=$'\n' matches=($(grep -P "[\s]*-w[\s]+$path" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset $IFS
        # For each of the matched entries
        for match in "${matches[@]}"
        do
                # Extract filepath from the match
                rulesd_audit_file=$(echo $match | cut -f1 -d ':')
                # Append that path into list of files for inspection
                files_to_inspect=("${files_to_inspect[@]}" "$rulesd_audit_file")
        done
        # Case when particular audit rule isn't defined yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                # Append '/etc/audit/rules.d/$key.rules' into list of files for inspection
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                # If the $key.rules file doesn't exist yet, create it with correct permissions
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

# Finally perform the inspection and possible subsequent audit rule
# correction for each of the files previously identified for inspection
for audit_rules_file in "${files_to_inspect[@]}"
do

        # Check if audit watch file system object rule for given path already present
        if grep -q -P -- "[\s]*-w[\s]+$path" "$audit_rules_file"
        then
                # Rule is found =&gt; verify yet if existing rule definition contains
                # all of the required access type bits

                # Escape slashes in path for use in sed pattern below
                local esc_path=${path//$'/'/$'\/'}
                # Define BRE whitespace class shortcut
                local sp="[[:space:]]"
                # Extract current permission access types (e.g. -p [r|w|x|a] values) from audit rule
                current_access_bits=$(sed -ne "s/$sp*-w$sp\+$esc_path$sp\+-p$sp\+\([rxwa]\{1,4\}\).*/\1/p" "$audit_rules_file")
                # Split required access bits string into characters array
                # (to check bit's presence for one bit at a time)
                for access_bit in $(echo "$required_access_bits" | grep -o .)
                do
                        # For each from the required access bits (e.g. 'w', 'a') check
                        # if they are already present in current access bits for rule.
                        # If not, append that bit at the end
                        if ! grep -q "$access_bit" &lt;&lt;&lt; "$current_access_bits"
                        then
                                # Concatenate the existing mask with the missing bit
                                current_access_bits="$current_access_bits$access_bit"
                        fi
                done
                # Propagate the updated rule's access bits (original + the required
                # ones) back into the /etc/audit/audit.rules file for that rule
                sed -i "s/\($sp*-w$sp\+$esc_path$sp\+-p$sp\+\)\([rxwa]\{1,4\}\)\(.*\)/\1$current_access_bits\3/" "$audit_rules_file"
        else
                # Rule isn't present yet. Append it at the end of $audit_rules_file file
                # with proper key

                echo "-w $path -p $required_access_bits -k $key" &gt;&gt; "$audit_rules_file"
        fi
done
}
</value>
    </Value>
    <Value id="function_package_command" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function to to install or uninstall packages on RHEL and Fedora systems</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Function to install or uninstall packages on RHEL and Fedora systems.

Example Call(s):

  package_command install aide
  package_command remove telnet-server
</description>
      <value>
function package_command {

# Load function arguments into local variables
local package_operation=$1
local package=$2

# Check sanity of the input
if [ $# -ne "2" ]
then
  echo "Usage: package_command 'install/uninstall' 'rpm_package_name"
  echo "Aborting."
  exit 1
fi

# If dnf is installed, use dnf; otherwise, use yum
if [ -f "/usr/bin/dnf" ] ; then
  install_util="/usr/bin/dnf"
else
  install_util="/usr/bin/yum"
fi

if [ "$package_operation" != 'remove' ] ; then
  # If the rpm is not installed, install the rpm
  if ! /bin/rpm -q --quiet $package; then
    $install_util -y $package_operation $package
  fi
else
  # If the rpm is installed, uninstall the rpm
  if /bin/rpm -q --quiet $package; then
    $install_util -y $package_operation $package
  fi
fi

}
</value>
    </Value>
    <Value id="function_service_command" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function to enable/disable and start/stop services on RHEL
and Fedora systems</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Function to enable/disable and start/stop services on RHEL and
Fedora systems.

Example Call(s):

  service_command enable bluetooth
  service_command disable bluetooth.service

  Using xinetd:
  service_command disable rsh.socket xinetd=rsh
</description>
      <value>
function service_command {

# Load function arguments into local variables
local service_state=$1
local service=$2
local xinetd=$(echo $3 | cut -d'=' -f2)

# Check sanity of the input
if [ $# -lt "2" ]
then
  echo "Usage: service_command 'enable/disable' 'service_name.service'"
  echo
  echo "To enable or disable xinetd services add \'xinetd=service_name\'"
  echo "as the last argument"
  echo "Aborting."
  exit 1
fi

# If systemctl is installed, use systemctl command; otherwise, use the service/chkconfig commands
if [ -f "/usr/bin/systemctl" ] ; then
  service_util="/usr/bin/systemctl"
else
  service_util="/sbin/service"
  chkconfig_util="/sbin/chkconfig"
fi

# If disable is not specified in arg1, set variables to enable services.
# Otherwise, variables are to be set to disable services.
if [ "$service_state" != 'disable' ] ; then
  service_state="enable"
  service_operation="start"
  chkconfig_state="on"
else
  service_state="disable"
  service_operation="stop"
  chkconfig_state="off"
fi

# If chkconfig_util is not empty, use chkconfig/service commands.
if ! [ "x$chkconfig_util" = x ] ; then
  $service_util $service $service_operation
  $chkconfig_util --level 0123456 $service $chkconfig_state
else
  $service_util $service_operation $service
  $service_util $service_state $service
fi

# Test if local variable xinetd is empty using non-bashism.
# If empty, then xinetd is not being used.
if ! [ "x$xinetd" = x ] ; then
  grep -qi disable /etc/xinetd.d/$xinetd &amp;&amp; \

  if ! [ "$service_operation" != 'disable' ] ; then
    sed -i "s/disable.*/disable         = no/gI" /etc/xinetd.d/$xinetd
  else
    sed -i "s/disable.*/disable         = yes/gI" /etc/xinetd.d/$xinetd
  fi
fi

}
</value>
    </Value>
    <Value id="function_perform_audit_rules_privileged_commands_remediation" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function to perform remediation for 'audit_rules_privileged_commands' rule</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Function to perform remediation for 'audit_rules_privileged_commands' rule

Expects two arguments:

  audit_tool            tool used to load audit rules
                        One of 'auditctl' or 'augenrules'

  min_auid              Minimum original ID the user logged in with
                        '500' for RHEL-6 and before, '1000' for RHEL-7 and after.

Example Call(s):

  perform_audit_rules_privileged_commands_remediation "auditctl" "500"
  perform_audit_rules_privileged_commands_remediation "augenrules" "1000"
</description>
      <value>
function perform_audit_rules_privileged_commands_remediation {
#
# Load function arguments into local variables
local tool="$1"
local min_auid="$2"

# Check sanity of the input
if [ $# -ne "2" ]
then
        echo "Usage: perform_audit_rules_privileged_commands_remediation 'auditctl | augenrules' '500 | 1000'"
        echo "Aborting."
        exit 1
fi

declare -a files_to_inspect=()

# Check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] &amp;&amp; [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If the audit tool is 'auditctl', then:
# * add '/etc/audit/audit.rules'to the list of files to be inspected,
# * specify '/etc/audit/audit.rules' as the output audit file, where
#   missing rules should be inserted
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("/etc/audit/audit.rules")
        output_audit_file="/etc/audit/audit.rules"
#
# If the audit tool is 'augenrules', then:
# * add '/etc/audit/rules.d/*.rules' to the list of files to be inspected
#   (split by newline),
# * specify /etc/audit/rules.d/privileged.rules' as the output file, where
#   missing rules should be inserted
elif [ "$tool" == 'augenrules' ]
then
        IFS=$'\n' files_to_inspect=($(find /etc/audit/rules.d -maxdepth 1 -type f -name *.rules -print))
        output_audit_file="/etc/audit/rules.d/privileged.rules"
fi

# Obtain the list of SUID/SGID binaries on the particular system (split by newline)
# into privileged_binaries array
IFS=$'\n' privileged_binaries=($(find / -xdev -type f -perm -4000 -o -type f -perm -2000 2&gt;/dev/null))

# Keep list of SUID/SGID binaries that have been already handled within some previous iteration
declare -a sbinaries_to_skip=()

# For each found sbinary in privileged_binaries list
for sbinary in "${privileged_binaries[@]}"
do

        # Replace possible slash '/' character in sbinary definition so we could use it in sed expressions below
        sbinary_esc=${sbinary//$'/'/$'\/'}
        # Check if this sbinary wasn't already handled in some of the previous iterations
        # Return match only if whole sbinary definition matched (not in the case just prefix matched!!!)
        if [[ $(sed -ne "/${sbinary_esc}$/p" &lt;&lt;&lt; ${sbinaries_to_skip[@]}) ]]
        then
                # If so, don't process it second time &amp; go to process next sbinary
                continue
        fi

        # Reset the counter of inspected files when starting to check
        # presence of existing audit rule for new sbinary
        local count_of_inspected_files=0

        # For each audit rules file from the list of files to be inspected
        for afile in "${files_to_inspect[@]}"
        do

                # Search current audit rules file's content for match. Match criteria:
                # * existing rule is for the same SUID/SGID binary we are currently processing (but
                #   can contain multiple -F path= elements covering multiple SUID/SGID binaries)
                # * existing rule contains all arguments from expected rule form (though can contain
                #   them in arbitrary order)

                base_search=$(sed -e "/-a always,exit/!d" -e "/-F path=${sbinary_esc}$/!d"   \
                                  -e "/-F path=[^[:space:]]\+/!d" -e "/-F perm=.*/!d"       \
                                  -e "/-F auid&gt;=${min_auid}/!d" -e "/-F auid!=4294967295/!d"  \
                                  -e "/-k privileged/!d" $afile)

                # Increase the count of inspected files for this sbinary
                count_of_inspected_files=$((count_of_inspected_files + 1))

                # Define expected rule form for this binary
                expected_rule="-a always,exit -F path=${sbinary} -F perm=x -F auid&gt;=${min_auid} -F auid!=4294967295 -k privileged"

                # Require execute access type to be set for existing audit rule
                exec_access='x'

                # Search current audit rules file's content for presence of rule pattern for this sbinary
                if [[ $base_search ]]
                then

                        # Current audit rules file already contains rule for this binary =&gt;
                        # Store the exact form of found rule for this binary for further processing
                        concrete_rule=$base_search

                        # Select all other SUID/SGID binaries possibly also present in the found rule
                        IFS=$'\n' handled_sbinaries=($(grep -o -e "-F path=[^[:space:]]\+" &lt;&lt;&lt; $concrete_rule))
                        IFS=$' ' handled_sbinaries=(${handled_sbinaries[@]//-F path=/})

                        # Merge the list of such SUID/SGID binaries found in this iteration with global list ignoring duplicates
                        sbinaries_to_skip=($(for i in "${sbinaries_to_skip[@]}" "${handled_sbinaries[@]}"; do echo $i; done | sort -du))

                        # Separate concrete_rule into three sections using hash '#'
                        # sign as a delimiter around rule's permission section borders
                        concrete_rule=$(echo $concrete_rule | sed -n "s/\(.*\)\+\(-F perm=[rwax]\+\)\+/\1#\2#/p")

                        # Split concrete_rule into head, perm, and tail sections using hash '#' delimiter
                        IFS=$'#' read rule_head rule_perm rule_tail &lt;&lt;&lt;  "$concrete_rule"

                        # Extract already present exact access type [r|w|x|a] from rule's permission section
                        access_type=${rule_perm//-F perm=/}

                        # Verify current permission access type(s) for rule contain 'x' (execute) permission
                        if ! grep -q "$exec_access" &lt;&lt;&lt; "$access_type"
                        then

                                # If not, append the 'x' (execute) permission to the existing access type bits
                                access_type="$access_type$exec_access"
                                # Reconstruct the permissions section for the rule
                                new_rule_perm="-F perm=$access_type"
                                # Update existing rule in current audit rules file with the new permission section
                                sed -i "s#${rule_head}\(.*\)${rule_tail}#${rule_head}${new_rule_perm}${rule_tail}#" $afile

                        fi

                # If the required audit rule for particular sbinary wasn't found yet, insert it under following conditions:
                #
                # * in the "auditctl" mode of operation insert particular rule each time
                #   (because in this mode there's only one file -- /etc/audit/audit.rules to be inspected for presence of this rule),
                #
                # * in the "augenrules" mode of operation insert particular rule only once and only in case we have already
                #   searched all of the files from /etc/audit/rules.d/*.rules location (since that audit rule can be defined
                #   in any of those files and if not, we want it to be inserted only once into /etc/audit/rules.d/privileged.rules file)
                #
                elif [ "$tool" == "auditctl" ] || [[ "$tool" == "augenrules" &amp;&amp; $count_of_inspected_files -eq "${#files_to_inspect[@]}" ]]
                then

                        # Current audit rules file's content doesn't contain expected rule for this
                        # SUID/SGID binary yet =&gt; append it
                        echo $expected_rule &gt;&gt; $output_audit_file
                fi

        done

done

}
</value>
    </Value>
    <Value id="function_populate" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function to populate environment variables needed for unit testing</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The populate function isn't directly used by SSG at the moment but it can
ba used for testing purposes (to verify proper work of the remediation script directly
from the shell).</description>
      <value>
function populate {
# Code to populate environment variables needed (for unit testing)
if [ -z "${!1}" ]; then
	echo "$1 is not defined. Exiting."
	exit
fi
}
</value>
    </Value>
    <Value id="function_rhel6_perform_audit_adjtimex_settimeofday_stime_remediation" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function for the 'adjtimex', 'settimeofday', and 'stime'
audit system calls on Red Hat Enterprise Linux 6</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Perform the remediation for the 'adjtimex', 'settimeofday', and 'stime' audit
# system calls on Red Hat Enterprise Linux 6 OS</description>
      <value>
function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
# 
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] &amp;&amp; [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset $IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset $IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch &amp; key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" &lt;&lt;&lt; "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule =&gt; existing rule can be deleted
                                # Thus delete the rule from audit.rules &amp; our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' =&gt; group='chown'
                                # since 'lchown' &amp; 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array &lt;&lt;&lt; "$rule_syscalls"
                                # Reset IFS back to default
                                unset $IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" &lt;&lt;&lt; "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" &gt;&gt; "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture &amp; key =&gt; don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch &amp; key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" &gt;&gt; "$audit_file"
        fi
done

}

function rhel6_perform_audit_adjtimex_settimeofday_stime_remediation {

# Perform the remediation for the 'adjtimex', 'settimeofday', and 'stime' audit
# system calls on Red Hat Enterprise Linux 6 OS
#
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] &amp;&amp; RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
        PATTERN="-a always,exit -F arch=${ARCH} -S .* -k *"
        # Create expected audit group and audit rule form for particular system call &amp; architecture
        if [ ${ARCH} = "b32" ]
        then
                # stime system call is known at 32-bit arch (see e.g "$ ausyscall i386 stime" 's output)
                # so append it to the list of time group system calls to be audited
                GROUP="\(adjtimex\|settimeofday\|stime\)"
                FULL_RULE="-a always,exit -F arch=${ARCH} -S adjtimex -S settimeofday -S stime -k audit_time_rules"
        elif [ ${ARCH} = "b64" ]
        then
                # stime system call isn't known at 64-bit arch (see "$ ausyscall x86_64 stime" 's output)
                # therefore don't add it to the list of time group system calls to be audited
                GROUP="\(adjtimex\|settimeofday\)"
                FULL_RULE="-a always,exit -F arch=${ARCH} -S adjtimex -S settimeofday -k audit_time_rules"
        fi
        # Perform the remediation itself
        fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done

}
</value>
    </Value>
    <Value id="function_rhel7_fedora_perform_audit_adjtimex_settimeofday_stime_remediation" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function for the 'adjtimex', 'settimeofday', and 'stime'
audit system calls on Red Hat Enterprise Linux 7 or Fedora</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Perform the remediation for the 'adjtimex', 'settimeofday', and
'stime' audit system calls on Red Hat Enterprise Linux 7 or Fedora OSes</description>
      <value>
function fix_audit_syscall_rule {

# Load function arguments into local variables
local tool="$1"
local pattern="$2"
local group="$3"
local arch="$4"
local full_rule="$5"

# Check sanity of the input
if [ $# -ne "5" ]
then
        echo "Usage: fix_audit_syscall_rule 'tool' 'pattern' 'group' 'arch' 'full rule'"
        echo "Aborting."
        exit 1
fi

# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows:
# 
# -----------------------------------------------------------------------------------------
#  Tool used to load audit rules | Rule already defined  |  Audit rules file to inspect    |
# -----------------------------------------------------------------------------------------
#        auditctl                |     Doesn't matter    |  /etc/audit/audit.rules         |
# -----------------------------------------------------------------------------------------
#        augenrules              |          Yes          |  /etc/audit/rules.d/*.rules     |
#        augenrules              |          No           |  /etc/audit/rules.d/$key.rules  |
# -----------------------------------------------------------------------------------------
#
declare -a files_to_inspect

# First check sanity of the specified audit tool
if [ "$tool" != 'auditctl' ] &amp;&amp; [ "$tool" != 'augenrules' ]
then
        echo "Unknown audit rules loading tool: $1. Aborting."
        echo "Use either 'auditctl' or 'augenrules'!"
        exit 1
# If audit tool is 'auditctl', then add '/etc/audit/audit.rules'
# file to the list of files to be inspected
elif [ "$tool" == 'auditctl' ]
then
        files_to_inspect=("${files_to_inspect[@]}" '/etc/audit/audit.rules' )
# If audit tool is 'augenrules', then check if the audit rule is defined
# If rule is defined, add '/etc/audit/rules.d/*.rules' to the list for inspection
# If rule isn't defined yet, add '/etc/audit/rules.d/$key.rules' to the list for inspection
elif [ "$tool" == 'augenrules' ]
then
        # Extract audit $key from audit rule so we can use it later
        key=$(expr "$full_rule" : '.*-k[[:space:]]\([^[:space:]]\+\)')
        # Check if particular audit rule is already defined
        IFS=$'\n' matches=($(sed -s -n -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d;F" /etc/audit/rules.d/*.rules))
        # Reset IFS back to default
        unset $IFS
        for match in "${matches[@]}"
        do
                files_to_inspect=("${files_to_inspect[@]}" "${match}")
        done
        # Case when particular rule isn't defined in /etc/audit/rules.d/*.rules yet
        if [ ${#files_to_inspect[@]} -eq "0" ]
        then
                files_to_inspect="/etc/audit/rules.d/$key.rules"
                if [ ! -e "$files_to_inspect" ]
                then
                        touch "$files_to_inspect"
                        chmod 0640 "$files_to_inspect"
                fi
        fi
fi

#
# Indicator that we want to append $full_rule into $audit_file by default
local append_expected_rule=0

for audit_file in "${files_to_inspect[@]}"
do

        # Filter existing $audit_file rules' definitions to select those that:
        # * follow the rule pattern, and
        # * meet the hardware architecture requirement, and
        # * are current syscall group specific
        IFS=$'\n' existing_rules=($(sed -e "/${pattern}/!d" -e "/${arch}/!d" -e "/${group}/!d"  "$audit_file"))
        # Reset IFS back to default
        unset $IFS

        # Process rules found case-by-case
        for rule in "${existing_rules[@]}"
        do
                # Found rule is for same arch &amp; key, but differs (e.g. in count of -S arguments)
                if [ "${rule}" != "${full_rule}" ]
                then
                        # If so, isolate just '(-S \w)+' substring of that rule
                        rule_syscalls=$(echo $rule | grep -o -P '(-S \w+ )+')
                        # Check if list of '-S syscall' arguments of that rule is subset
                        # of '-S syscall' list of expected $full_rule
                        if grep -q -- "$rule_syscalls" &lt;&lt;&lt; "$full_rule"
                        then
                                # Rule is covered (i.e. the list of -S syscalls for this rule is
                                # subset of -S syscalls of $full_rule =&gt; existing rule can be deleted
                                # Thus delete the rule from audit.rules &amp; our array
                                sed -i -e "/$rule/d" "$audit_file"
                                existing_rules=("${existing_rules[@]//$rule/}")
                        else
                                # Rule isn't covered by $full_rule - it besides -S syscall arguments
                                # for this group contains also -S syscall arguments for other syscall
                                # group. Example: '-S lchown -S fchmod -S fchownat' =&gt; group='chown'
                                # since 'lchown' &amp; 'fchownat' share 'chown' substring
                                # Therefore:
                                # * 1) delete the original rule from audit.rules
                                # (original '-S lchown -S fchmod -S fchownat' rule would be deleted)
                                # * 2) delete the -S syscall arguments for this syscall group, but
                                # keep those not belonging to this syscall group
                                # (original '-S lchown -S fchmod -S fchownat' would become '-S fchmod'
                                # * 3) append the modified (filtered) rule again into audit.rules
                                # if the same rule not already present
                                #
                                # 1) Delete the original rule
                                sed -i -e "/$rule/d" "$audit_file"
                                # 2) Delete syscalls for this group, but keep those from other groups
                                # Convert current rule syscall's string into array splitting by '-S' delimiter
                                IFS=$'-S' read -a rule_syscalls_as_array &lt;&lt;&lt; "$rule_syscalls"
                                # Reset IFS back to default
                                unset $IFS
                                # Declare new empty string to hold '-S syscall' arguments from other groups
                                new_syscalls_for_rule=''
                                # Walk through existing '-S syscall' arguments
                                for syscall_arg in "${rule_syscalls_as_array[@]}"
                                do
                                        # Skip empty $syscall_arg values
                                        if [ "$syscall_arg" == '' ]
                                        then
                                                continue
                                        fi
                                        # If the '-S syscall' doesn't belong to current group add it to the new list
                                        # (together with adding '-S' delimiter back for each of such item found)
                                        if grep -q -v -- "$group" &lt;&lt;&lt; "$syscall_arg"
                                        then
                                                new_syscalls_for_rule="$new_syscalls_for_rule -S $syscall_arg"
                                        fi
                                done
                                # Replace original '-S syscall' list with the new one for this rule
                                updated_rule=${rule//$rule_syscalls/$new_syscalls_for_rule}
                                # Squeeze repeated whitespace characters in rule definition (if any) into one
                                updated_rule=$(echo "$updated_rule" | tr -s '[:space:]')
                                # 3) Append the modified / filtered rule again into audit.rules
                                #    (but only in case it's not present yet to prevent duplicate definitions)
                                if ! grep -q -- "$updated_rule" "$audit_file"
                                then
                                        echo "$updated_rule" &gt;&gt; "$audit_file"
                                fi
                        fi
                else
                        # $audit_file already contains the expected rule form for this
                        # architecture &amp; key =&gt; don't insert it second time
                        append_expected_rule=1
                fi
        done

        # We deleted all rules that were subset of the expected one for this arch &amp; key.
        # Also isolated rules containing system calls not from this system calls group.
        # Now append the expected rule if it's not present in $audit_file yet
        if [[ ${append_expected_rule} -eq "0" ]]
        then
                echo "$full_rule" &gt;&gt; "$audit_file"
        fi
done

}

function rhel7_fedora_perform_audit_adjtimex_settimeofday_stime_remediation {

# Perform the remediation for the 'adjtimex', 'settimeofday', and 'stime' audit
# system calls on Red Hat Enterprise Linux 7 or Fedora OSes
#
# Retrieve hardware architecture of the underlying system
[ $(getconf LONG_BIT) = "32" ] &amp;&amp; RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do

        PATTERN="-a always,exit -F arch=${ARCH} -S .* -k *"
        # Create expected audit group and audit rule form for particular system call &amp; architecture
        if [ ${ARCH} = "b32" ]
        then
                # stime system call is known at 32-bit arch (see e.g "$ ausyscall i386 stime" 's output)
                # so append it to the list of time group system calls to be audited
                GROUP="\(adjtimex\|settimeofday\|stime\)"
                FULL_RULE="-a always,exit -F arch=${ARCH} -S adjtimex -S settimeofday -S stime -k audit_time_rules"
        elif [ ${ARCH} = "b64" ]
        then
                # stime system call isn't known at 64-bit arch (see "$ ausyscall x86_64 stime" 's output)
                # therefore don't add it to the list of time group system calls to be audited
                GROUP="\(adjtimex\|settimeofday\)"
                FULL_RULE="-a always,exit -F arch=${ARCH} -S adjtimex -S settimeofday -k audit_time_rules"
        fi
        # Perform the remediation for both possible tools: 'auditctl' and 'augenrules'
        fix_audit_syscall_rule "auditctl" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
        fix_audit_syscall_rule "augenrules" "$PATTERN" "$GROUP" "$ARCH" "$FULL_RULE"
done

}
</value>
    </Value>
    <Value id="function_replace_or_append" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function to replace configuration setting in config file or
add the configuration setting if it does not exist yet</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Function to replace configuration setting in config file or add
the configuration setting if it does not exist.

Expects four arguments:

  config_file:		Configuration file that will be modified
  key:			Configuration option to change
  value:		Value of the configuration option to change
  cce:			The CCE identifier or '$CCENUM' if no CCE identifier exists

Optional arguments:

  format:		Optional argument to specify the format of how key/value should be
			modified/appended in the configuration file. The default is key = value.

Example Call(s):

  With default format of 'key = value':
  replace_or_append '/etc/sysctl.conf' '^kernel.randomize_va_space' '2' '$CCENUM'

  With custom key/value format:
  replace_or_append '/etc/sysconfig/selinux' '^SELINUX=' 'disabled' '$CCENUM' '%s=%s'

  With a variable:
  replace_or_append '/etc/sysconfig/selinux' '^SELINUX=' $var_selinux_state '$CCENUM' '%s=%s'
</description>
      <value>
function replace_or_append {
  local config_file=$1
  local key=$2
  local value=$3
  local cce=$4
  local format=$5

  # Check sanity of the input
  if [ $# -lt "3" ]
  then
        echo "Usage: replace_or_append 'config_file_location' 'key_to_search' 'new_value'"
        echo
        echo "If symlinks need to be taken into account, add yes/no to the last argument"
        echo "to allow to 'follow_symlinks'."
        echo "Aborting."
        exit 1
  fi

  # Test if the config_file is a symbolic link. If so, use --follow-symlinks with sed.
  # Otherwise, regular sed command will do.
  if test -L $config_file; then
    sed_command="sed -i --follow-symlinks"
  else
    sed_command="sed -i"
  fi

  # Test that the cce arg is not empty or does not equal $CCENUM.
  # If $CCENUM exists, it means that there is no CCE assigned.
  if ! [ "x$cce" = x ] &amp;&amp; [ "$cce" != '$CCENUM' ]; then
    cce="CCE-${cce}"
  else
    cce="CCE"
  fi

  # Strip any search characters in the key arg so that the key can be replaced without
  # adding any search characters to the config file.
  stripped_key=$(sed "s/[\^=\$,;+]*//g" &lt;&lt;&lt; $key)

  # If there is no print format specified in the last arg, use the default format.
  if ! [ "x$format" = x ] ; then
    printf -v formatted_output "$format" $stripped_key $value
  else
    formatted_output="$stripped_key = $value"
  fi

  # If the key exists, change it. Otherwise, add it to the config_file.
  if `grep -qi $key $config_file` ; then
    $sed_command "s/$key.*/$formatted_output/g" $config_file
  else
    echo -ne "\n# Per $cce: Set $formatted_output in $config_file" &gt;&gt; $config_file
    echo -ne "\n$formatted_output" &gt;&gt; $config_file
  fi

}
</value>
    </Value>
    <Value id="function_firefox_js_setting" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function to replace configuration setting(s) in the Firefox
preferences JavaScript file or add the preference if it does not exist yet</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Function to replace configuration setting(s) in the Firefox
preferences JavaScript file or add the preference if it does not exist.

Expects three arguments:

  config_file:          Configuration file that will be modified
  key:                  Configuration option to change
  value:                Value of the configuration option to change


Example Call(s):

  Without string or variable:
  firefox_js_setting "stig_settings.js" "general.config.obscure_value" "0"

  With string:
  firefox_js_setting "stig_settings.js" "general.config.filename" "\"stig.cfg\""

  With a string variable:
  firefox_js_setting "stig_settings.js" "general.config.filename" "\"$var_config_file_name\""
</description>
      <value>
function firefox_js_setting {
  local firefox_js=$1
  local key=$2
  local value=$3
  local firefox_dirs="/usr/lib/firefox /usr/lib64/firefox /usr/local/lib/firefox /usr/local/lib64/firefox"
  local firefox_pref="/defaults/pref"
  local firefox_preferences="/defaults/preferences"

  # Check sanity of input
  if [ $# -lt "3" ]
  then
        echo "Usage: firefox_js_setting 'config_javascript_file' 'key_to_search' 'new_value'"
        echo
        echo "Aborting."
        exit 1
  fi

  # Check the possible Firefox install directories
  for firefox_dir in ${firefox_dirs}; do
    # If the Firefox directory exists, then Firefox is installed
    if [ -d "${firefox_dir}" ]; then
      # Different versions of Firefox have different preferences directories, check for them and set the right one
      if [ -d "${firefox_dir}/${firefox_pref}" ] ; then
        local firefox_pref_dir="${firefox_dir}/${firefox_pref}"
      elif [ -d "${firefox_dir}/${firefox_preferences}" ] ; then
        local firefox_pref_dir="${firefox_dir}/${firefox_preferences}"
      else
        mkdir -m 755 -p "${firefox_dir}/${firefox_preferences}"
        local firefox_pref_dir="${firefox_dir}/${firefox_preferences}"
      fi

      # Make sure the Firefox .js file exists and has the appropriate permissions
      if ! [ -f "${firefox_pref_dir}/${firefox_js}" ] ; then
        touch "${firefox_pref_dir}/${firefox_js}"
        chmod 644 "${firefox_pref_dir}/${firefox_js}"
      fi

      # If the key exists, change it. Otherwise, add it to the config_file.
      if `grep -q "^pref(\"${key}\", " "${firefox_pref_dir}/${firefox_js}"` ; then
        sed -i "s/pref(\"${key}\".*/pref(\"${key}\", ${value});/g" "${firefox_pref_dir}/${firefox_js}"
      else
        echo "pref(\"${key}\", ${value});" &gt;&gt; "${firefox_pref_dir}/${firefox_js}"
      fi
    fi
  done

}
</value>
    </Value>
    <Value id="function_firefox_cfg_setting" hidden="true" prohibitChanges="true" operator="equals" type="string">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Remediation function to replace configuration setting(s) in the Firefox
preferences configuration (.cfg) file or add the preference if it does not exist yet</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Function to replace configuration setting(s) in the Firefox
preferences configuration (.cfg) file or add the preference if it does not exist.

Expects three arguments:

  config_file:          Configuration file that will be modified
  key:                  Configuration option to change
  value:                Value of the configuration option to change


Example Call(s):

  Without string or variable:
  firefox_cfg_setting "stig.cfg" "extensions.update.enabled" "false"

  With string:
  firefox_cfg_setting "stig.cfg" "security.default_personal_cert" "\"Ask Every Time\""

  With a string variable:
  firefox_cfg_setting "stig.cfg" "browser.startup.homepage\" "\"${var_default_home_page}\""
</description>
      <value>
function firefox_cfg_setting {
  local firefox_cfg=$1
  local key=$2
  local value=$3
  local firefox_dirs="/usr/lib/firefox /usr/lib64/firefox /usr/local/lib/firefox /usr/local/lib64/firefox"

  # Check sanity of input
  if [ $# -lt "3" ]
  then
        echo "Usage: firefox_cfg_setting 'config_cfg_file' 'key_to_search' 'new_value'"
        echo
        echo "Aborting."
        exit 1
  fi

  # Check the possible Firefox install directories
  for firefox_dir in ${firefox_dirs}; do
    # If the Firefox directory exists, then Firefox is installed
    if [ -d "${firefox_dir}" ]; then
      # Make sure the Firefox .cfg file exists and has the appropriate permissions
      if ! [ -f "${firefox_dir}/${firefox_cfg}" ] ; then
        touch "${firefox_dir}/${firefox_cfg}"
        chmod 644 "${firefox_dir}/${firefox_cfg}"
      fi

      # If the key exists, change it. Otherwise, add it to the config_file.
      if `grep -q "^lockPref(\"${key}\", " "${firefox_dir}/${firefox_cfg}"` ; then
        sed -i "s/lockPref(\"${key}\".*/lockPref(\"${key}\", ${value});/g" "${firefox_dir}/${firefox_cfg}"
      else
        echo "lockPref(\"${key}\", ${value});" &gt;&gt; "${firefox_dir}/${firefox_cfg}"
      fi
    fi
  done
}
</value>
    </Value>
  </Group>
  <Group id="intro">
    <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Introduction</title>
    <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The purpose of this guidance is to provide security configuration
recommendations and baselines for the Debian 8 operating
system. Recommended settings for the basic operating system are provided,
as well as for many network services that the system can provide to other systems.
The guide is intended for system administrators. Readers are assumed to
possess basic system administration skills for Unix-like systems, as well
as some familiarity with the product's documentation and administration
conventions. Some instructions within this guide are complex.
All directions should be followed completely and with understanding of
their effects in order to avoid serious adverse effects on the system
and its security.
</description>
    <Group id="general-principles">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">General Principles</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The following general principles motivate much of the advice in this
guide and should also influence any configuration decisions that are
not explicitly covered.
</description>
      <Group id="principle-encrypt-transmitted-data">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Encrypt Transmitted Data Whenever Possible</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Data transmitted over a network, whether wired or wireless, is susceptible
to passive monitoring. Whenever practical solutions for encrypting
such data exist, they should be applied. Even if data is expected to
be transmitted only over a local network, it should still be encrypted.
Encrypting authentication data, such as passwords, is particularly
important. Networks of Debian 8 machines can and should be configured
so that no unencrypted authentication data is ever transmitted between
machines.
</description>
      </Group>
      <Group id="principle-minimize-software">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Minimize Software to Minimize Vulnerability</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The simplest way to avoid vulnerabilities in software is to avoid
installing that software. On Debian 8,

the Package Manager (originally
<html:a xmlns:html="http://www.w3.org/1999/xhtml" href="https://www.debian.org/doc/manuals/debian-faq/ch-pkgtools.en.html">apt</html:a>)
allows for careful management of
the set of software packages installed on a system. Installed software
contributes to system vulnerability in several ways. Packages that
include setuid programs may provide local attackers a potential path to
privilege escalation. Packages that include network services may give
this opportunity to network-based attackers. Packages that include
programs which are predictably executed by local users (e.g. after
graphical login) may provide opportunities for trojan horses or other
attack code to be run undetected. The number of software packages
installed on a system can almost always be significantly pruned to include
only the software for which there is an environmental or operational need.
</description>
      </Group>
      <Group id="principle-separate-servers">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Run Different Network Services on Separate Systems</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Whenever possible, a server should be dedicated to serving exactly one
network service. This limits the number of other services that can
be compromised in the event that an attacker is able to successfully
exploit a software flaw in one network service.
</description>
      </Group>
      <Group id="principle-use-security-tools">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Configure Security Tools to Improve System Robustness</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Several tools exist which can be effectively used to improve a system's
resistance to and detection of unknown attacks. These tools can improve
robustness against attack at the cost of relatively little configuration
effort. In particular, this guide recommends and discusses the use of
host-based firewalling, SELinux for protection against
vulnerable services, and a logging and auditing infrastructure for
detection of problems.
</description>
      </Group>
      <Group id="principle-least-privilege">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Least Privilege</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Grant the least privilege necessary for user accounts and software to perform tasks.
For example, <html:code xmlns:html="http://www.w3.org/1999/xhtml">sudo</html:code> can be implemented to limit authorization to super user
accounts on the system only to designated personnel. Another example is to limit
logins on server systems to only those administrators who need to log into them in
order to perform administration tasks. Using SELinux also follows the principle of
least privilege: SELinux policy can confine software to perform only actions on the
system that are specifically allowed. This can be far more restrictive than the
actions permissible by the traditional Unix permissions model.
</description>
      </Group>
    </Group>
    <Group id="how-to-use">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">How to Use This Guide</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Readers should heed the following points when using the guide.
</description>
      <Group id="intro-read-sections-completely">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Read Sections Completely and in Order</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Each section may build on information and recommendations discussed in
prior sections. Each section should be read and understood completely;
instructions should never be blindly applied. Relevant discussion may
occur after instructions for an action. 
</description>
      </Group>
      <Group id="intro-test-non-production">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Test in Non-Production Environment</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
This guidance should always be tested in a non-production environment
before deployment. This test environment should simulate the setup in
which the system will be deployed as closely as possible.
</description>
      </Group>
      <Group id="intro-root-shell-assumed">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Root Shell Environment Assumed</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Most of the actions listed in this document are written with the
assumption that they will be executed by the root user running the
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/bin/bash</html:code> shell. Commands preceded with a hash mark (#)
assume that the administrator will execute the commands as root, i.e.
apply the command via <html:code xmlns:html="http://www.w3.org/1999/xhtml">sudo</html:code> whenever possible, or use
<html:code xmlns:html="http://www.w3.org/1999/xhtml">su</html:code> to gain root privileges if <html:code xmlns:html="http://www.w3.org/1999/xhtml">sudo</html:code> cannot be
used. Commands which can be executed as a non-root user are are preceded
by a dollar sign ($) prompt.
</description>
      </Group>
      <Group id="intro-formatting-conventions">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Formatting Conventions</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Commands intended for shell execution, as well as configuration file text,
are featured in a <html:code xmlns:html="http://www.w3.org/1999/xhtml">monospace font</html:code>. <html:i xmlns:html="http://www.w3.org/1999/xhtml">Italics</html:i> are used
to indicate instances where the system administrator must substitute
the appropriate information into a command or configuration file.
</description>
      </Group>
      <Group id="intro-reboot-required">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Reboot Required</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
A system reboot is implicitly required after some actions in order to
complete the reconfiguration of the system. In many cases, the changes
will not take effect until a reboot is performed. In order to ensure
that changes are applied properly and to test functionality, always
reboot the system after applying a set of recommendations from this guide.
</description>
      </Group>
    </Group>
  </Group>
  <Group id="system">
    <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">System Settings</title>
    <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Contains rules that check correct system settings.</description>
    <Group id="software">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Installing and Maintaining Software</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The following sections contain information on
security-relevant choices during the initial operating system
installation process and the setup of software
updates.</description>
    </Group>
    <Group id="permissions">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">File Permissions and Masks</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Traditional Unix security relies heavily on file and
directory permissions to prevent unauthorized users from reading or
modifying files to which they should not have access. 
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
Several of the commands in this section search filesystems
for files or directories with certain characteristics, and are
intended to be run on every local partition on a given system.
When the variable <html:i xmlns:html="http://www.w3.org/1999/xhtml">PART</html:i> appears in one of the commands below,
it means that the command is intended to be run repeatedly, with the
name of each local partition substituted for <html:i xmlns:html="http://www.w3.org/1999/xhtml">PART</html:i> in turn.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
The following command prints a list of all xfs partitions on the local
system, which is the default filesystem for Red Hat Enterprise Linux
7 installations:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ mount -t xfs | awk '{print $3}'</html:pre>
For any systems that use a different
local filesystem type, modify this command as appropriate.
</description>
      <Group id="files">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Verify Permissions on Important Files and
Directories</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Permissions for many files on a system must be set
restrictively to ensure sensitive information is properly protected.
This section discusses important
permission restrictions which can be verified
to ensure that no harmful discrepancies have
arisen.</description>
        <Group id="permission_important_state_files">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Verify permissions on files containing sensitive informations about the system</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Various files contains sensitive informations that can leads to specific weaknesses or
give structural informations for local exploits.</description>
          <Rule id="file_permissions_systemmap" selected="false" severity="low">
            <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Verify that local System.map file (if exists) is readable only by root</title>
            <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Files containing sensitive informations should be protected by restrictive
  permissions. Most of the time, there is no need that these files need to be read by any non-root user
    
    To properly set the permissions of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/boot/System.map-*</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chmod 0600 /boot/System.map-*</html:pre>
    
    To properly set the owner of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/boot/System.map-*</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chown root /boot/System.map-* </html:pre>
  </description>
            <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R13)</reference>
            <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">System.map</html:code> file contains information about kernel symbols and
  can give some hints to generate local exploitation.
  </rationale>
            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
              <check-content-ref name="oval:ssg-file_permissions_systemmap:def:1" href="ssg-debian8-oval.xml"/>
            </check>
            <check system="http://scap.nist.gov/schema/ocil/2">
              <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-file_permissions_systemmap_ocil:questionnaire:1"/>
            </check>
          </Rule>
        </Group>
        <Group id="permissions_important_account_files">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Verify Permissions on Files with Local Account Information and Credentials</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The default restrictive permissions for files which act as
important security databases such as <html:code xmlns:html="http://www.w3.org/1999/xhtml">passwd</html:code>, <html:code xmlns:html="http://www.w3.org/1999/xhtml">shadow</html:code>,
<html:code xmlns:html="http://www.w3.org/1999/xhtml">group</html:code>, and <html:code xmlns:html="http://www.w3.org/1999/xhtml">gshadow</html:code> files must be maintained.  Many utilities
need read access to the <html:code xmlns:html="http://www.w3.org/1999/xhtml">passwd</html:code> file in order to function properly, but
read access to the <html:code xmlns:html="http://www.w3.org/1999/xhtml">shadow</html:code> file allows malicious attacks against system
passwords, and should never be enabled.</description>
          <Rule id="file_permissions_etc_shadow" selected="false" severity="medium">
            <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Verify Permissions and ownership on shadow File</title>
            <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
              
    To properly set the permissions of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/shadow</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chmod 0640 /etc/shadow</html:pre>
              
    To properly set the owner of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/shadow</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chown root /etc/shadow </html:pre>
              
    To properly set the group owner of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/shadow</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chgrp shadow /etc/shadow </html:pre>
            </description>
            <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-6</reference>
            <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx"/>
            <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-8.7.c</reference>
            <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R36)</reference>
            <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/shadow</html:code> file contains the list of local
system accounts and stores password hashes. Protection of this file is
critical for system security. Failure to give ownership of this file
to root provides the designated owner with access to sensitive information
which could weaken the system security posture.</rationale>
            <fix system="urn:xccdf:fix:script:sh" id="file_permissions_etc_shadow" complexity="low" disruption="low" reboot="false" strategy="configure">chmod 0640 /etc/shadow
</fix>
            <fix system="urn:xccdf:fix:script:ansible" id="file_permissions_etc_shadow" complexity="low" disruption="low" reboot="false" strategy="configure">- name: Ensure permission 0640 on /etc/shadow
  file:
    path="{{item}}"
    mode=0640
  with_items:
    - /etc/shadow
</fix>
            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
              <check-content-ref name="oval:ssg-file_permissions_etc_shadow:def:1" href="ssg-debian8-oval.xml"/>
            </check>
            <check system="http://scap.nist.gov/schema/ocil/2">
              <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-file_permissions_etc_shadow_ocil:questionnaire:1"/>
            </check>
          </Rule>
          <Rule id="file_permissions_etc_gshadow" selected="false" severity="medium">
            <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Verify Permissions and ownership on gshadow File</title>
            <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
              
    To properly set the permissions of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/gshadow</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chmod 0640 /etc/gshadow</html:pre>
              
    To properly set the owner of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/gshadow</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chown root /etc/gshadow </html:pre>
              
    To properly set the group owner of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/gshadow</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chgrp shadow /etc/gshadow </html:pre>
            </description>
            <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-6</reference>
            <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx"/>
            <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R36)</reference>
            <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/shadow</html:code> file contains group password hashes. Protection of this file
is critical for system security.</rationale>
            <fix system="urn:xccdf:fix:script:sh" id="file_permissions_etc_gshadow" complexity="low" disruption="low" reboot="false" strategy="configure">chmod 0640 /etc/gshadow
</fix>
            <fix system="urn:xccdf:fix:script:ansible" id="file_permissions_etc_gshadow" complexity="low" disruption="low" reboot="false" strategy="configure">- name: Ensure permission 0640 on /etc/gshadow
  file:
    path="{{item}}"
    mode=0640
  with_items:
    - /etc/gshadow
</fix>
            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
              <check-content-ref name="oval:ssg-file_permissions_etc_gshadow:def:1" href="ssg-debian8-oval.xml"/>
            </check>
            <check system="http://scap.nist.gov/schema/ocil/2">
              <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-file_permissions_etc_gshadow_ocil:questionnaire:1"/>
            </check>
          </Rule>
          <Rule id="file_permissions_etc_passwd" selected="false" severity="medium">
            <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Verify Permissions and ownership on passwd File</title>
            <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
              
    To properly set the permissions of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/passwd</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chmod 0644 /etc/passwd</html:pre>
              
    To properly set the owner of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/passwd</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chown root /etc/passwd </html:pre>
              
    To properly set the group owner of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/passwd</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chgrp root /etc/passwd </html:pre>
            </description>
            <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-6</reference>
            <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx"/>
            <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/shadow</html:code> file contains information about the users that are configured on
the system. Protection of this file is critical for system security.</rationale>
            <fix system="urn:xccdf:fix:script:sh" id="file_permissions_etc_passwd" complexity="low" disruption="low" reboot="false" strategy="configure">chmod 0644 /etc/passwd
</fix>
            <fix system="urn:xccdf:fix:script:ansible" id="file_permissions_etc_passwd" complexity="low" disruption="low" reboot="false" strategy="configure">- name: Ensure permission 0644 on /etc/passwd
  file:
    path="{{item}}"
    mode=0644
  with_items:
    - /etc/passwd
</fix>
            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
              <check-content-ref name="oval:ssg-file_permissions_etc_passwd:def:1" href="ssg-debian8-oval.xml"/>
            </check>
            <check system="http://scap.nist.gov/schema/ocil/2">
              <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-file_permissions_etc_passwd_ocil:questionnaire:1"/>
            </check>
          </Rule>
          <Rule id="file_permissions_etc_group" selected="false" severity="medium">
            <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Verify Permissions and ownership on group File</title>
            <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
              
    To properly set the permissions of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/passwd</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chmod 0644 /etc/passwd</html:pre>
              
    To properly set the owner of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/passwd</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chown root /etc/passwd </html:pre>
              
    To properly set the group owner of <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/passwd</html:code>, run the command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo chgrp root /etc/passwd </html:pre>
            </description>
            <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-6</reference>
            <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx"/>
            <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/shadow</html:code> file contains information about the groups that are configured on
the system. Protection of this file is critical for system security.</rationale>
            <fix system="urn:xccdf:fix:script:sh" id="file_permissions_etc_group" complexity="low" disruption="low" reboot="false" strategy="configure">chmod 0644 /etc/group
</fix>
            <fix system="urn:xccdf:fix:script:ansible" id="file_permissions_etc_group" complexity="low" disruption="low" reboot="false" strategy="configure">- name: Ensure permission 0644 on /etc/group
  file:
    path="{{item}}"
    mode=0644
  with_items:
    - /etc/group
</fix>
            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
              <check-content-ref name="oval:ssg-file_permissions_etc_group:def:1" href="ssg-debian8-oval.xml"/>
            </check>
            <check system="http://scap.nist.gov/schema/ocil/2">
              <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-file_permissions_etc_group_ocil:questionnaire:1"/>
            </check>
          </Rule>
        </Group>
      </Group>
      <Group id="restriction">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Restrict Programs from Dangerous Execution Patterns</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The recommendations in this section are designed to
ensure that the system's features to protect against potentially
dangerous program execution are activated.
These protections are applied at the system initialization or
kernel level, and defend against certain types of badly-configured
or compromised programs.</description>
        <Group id="coredumps">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Disable Core Dumps</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">A core dump file is the memory image of an executable
program when it was terminated by the operating system due to
errant behavior. In most cases, only software developers
legitimately need to access these files. The core dump files may
also contain sensitive information, or unnecessarily occupy large
amounts of disk space.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
Once a hard limit is set in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/security/limits.conf</html:code>, a
user cannot increase that limit within his or her own session. If access
to core dumps is required, consider restricting them to only
certain users or groups. See the <html:code xmlns:html="http://www.w3.org/1999/xhtml">limits.conf</html:code> man page for more
information.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
The core dumps of setuid programs are further protected. The
<html:code xmlns:html="http://www.w3.org/1999/xhtml">sysctl</html:code> variable <html:code xmlns:html="http://www.w3.org/1999/xhtml">fs.suid_dumpable</html:code> controls whether
the kernel allows core dumps from these programs at all. The default
value of 0 is recommended.</description>
          <Rule id="sysctl_fs_suid_dumpable" selected="false" severity="low">
            <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Disable Core Dumps for SUID programs</title>
            <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
              
    To set the runtime status of the <html:code xmlns:html="http://www.w3.org/1999/xhtml">fs.suid_dumpable</html:code> kernel parameter,
    run the following command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo sysctl -w fs.suid_dumpable=0</html:pre>
    If this is not the system's default value, add the following line to <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/sysctl.conf</html:code>:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">fs.suid_dumpable = 0</html:pre>
            </description>
            <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SI-11</reference>
            <reference href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf">1.6.1</reference>
            <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R23)</reference>
            <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The core dump of a setuid program is more likely to contain
wve data, as the program itself runs with greater privileges than the
user who initiated execution of the program.  Disabling the ability for any
setuid program to write a core file decreases the risk of unauthorized access
of such data.</rationale>
            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
              <check-content-ref name="oval:ssg-sysctl_fs_suid_dumpable:def:1" href="ssg-debian8-oval.xml"/>
            </check>
            <check system="http://scap.nist.gov/schema/ocil/2">
              <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-sysctl_fs_suid_dumpable_ocil:questionnaire:1"/>
            </check>
          </Rule>
        </Group>
        <Group id="enable_execshield_settings">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Enable ExecShield</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">ExecShield describes kernel features that provide
protection against exploitation of memory corruption errors such as buffer
overflows. These features include random placement of the stack and other
memory regions, prevention of execution in memory that should only hold data,
and special handling of text buffers. These protections are enabled by default
on 32-bit systems and controlled through <html:code xmlns:html="http://www.w3.org/1999/xhtml">sysctl</html:code> variables 
<html:code xmlns:html="http://www.w3.org/1999/xhtml">kernel.exec-shield</html:code> and <html:code xmlns:html="http://www.w3.org/1999/xhtml">kernel.randomize_va_space</html:code>. On the latest
64-bit systems, <html:code xmlns:html="http://www.w3.org/1999/xhtml">kernel.exec-shield</html:code> cannot be enabled or disabled with 
<html:code xmlns:html="http://www.w3.org/1999/xhtml">sysctl</html:code>.
</description>
          <Rule id="sysctl_kernel_randomize_va_space" selected="false" severity="medium">
            <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Enable Randomized Layout of Virtual Address Space</title>
            <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
              
    To set the runtime status of the <html:code xmlns:html="http://www.w3.org/1999/xhtml">kernel.randomize_va_space</html:code> kernel parameter,
    run the following command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo sysctl -w kernel.randomize_va_space=2</html:pre>
    If this is not the system's default value, add the following line to <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/sysctl.conf</html:code>:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">kernel.randomize_va_space = 2</html:pre>
            </description>
            <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SC-30(2)</reference>
            <reference href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf">1.6.1</reference>
            <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R23)</reference>
            <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US"> Address space layout randomization (ASLR) makes it more difficult
for an attacker to predict the location of attack code they have introduced
into a process's address space during an attempt at exploitation.  Additionally, ASLR 
makes it more difficult for an attacker to know the location of existing code
in order to re-purpose it using return oriented programming (ROP) techniques.
</rationale>
            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
              <check-content-ref name="oval:ssg-sysctl_kernel_randomize_va_space:def:1" href="ssg-debian8-oval.xml"/>
            </check>
            <check system="http://scap.nist.gov/schema/ocil/2">
              <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-sysctl_kernel_randomize_va_space_ocil:questionnaire:1"/>
            </check>
          </Rule>
          <Rule id="sysctl_kernel_kptr_restrict" selected="false" severity="low">
            <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Restrict exposed kernel pointers addresses access</title>
            <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
              
    To set the runtime status of the <html:code xmlns:html="http://www.w3.org/1999/xhtml">kernel.kptr_restrict</html:code> kernel parameter,
    run the following command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo sysctl -w kernel.kptr_restrict=1</html:pre>
    If this is not the system's default value, add the following line to <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/sysctl.conf</html:code>:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">kernel.kptr_restrict = 1</html:pre>
            </description>
            <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R23)</reference>
            <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Exposing kernel pointers (through procfs or <html:code xmlns:html="http://www.w3.org/1999/xhtml">seq_printf()</html:code>) exposes
kernel writeable structures that can contain functions pointers. If a write vulnereability occurs
in the kernel allowing a write access to any of this structure, the kernel can be compromise. This
option disallow any program withtout the CAP_SYSLOG capability from getting the kernel pointers addresses,
replacing them with 0.
</rationale>
            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
              <check-content-ref name="oval:ssg-sysctl_kernel_kptr_restrict:def:1" href="ssg-debian8-oval.xml"/>
            </check>
            <check system="http://scap.nist.gov/schema/ocil/2">
              <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-sysctl_kernel_kptr_restrict_ocil:questionnaire:1"/>
            </check>
          </Rule>
        </Group>
      </Group>
    </Group>
    <Group id="fs-part">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Hardening the filesystem</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Hardening the filesystem and its usage is an efficient way to ensure an efficient separation of services,
data and configurations while ensuring a more precise management of filesystem level access rights, enabling deactivation
of some specific rights at the filesystem level. Moreover, the Linux Virtual file system support various hardening mechanisms
that can be set using sysctl.</description>
      <Group id="installation-storage-partitioning">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Partitioning</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
  Separating various locations of the file systems in different partitions allows a more restrictive
  segregation, distinctly from one location to another. Moreover, some native restrictions can be made by
partitioning, such as no hard link between different filesystems, and reduce the corruption impact to the
affected filesystem instead of the entire system. The last gain is to allow a differenciated usage of storage
media, depending on the operational needs (speed, resilience, etc.).
</description>
        <reference href="http://www.pathname.com/fhs/">Filesystem Hierarchy Standard</reference>
        <Rule id="partition_for_tmp" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure /tmp Located On Separate Partition</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The <html:code xmlns:html="http://www.w3.org/1999/xhtml">/tmp</html:code> directory is a world-writable directory used
for temporary file storage. Ensure it has its own partition or
logical volume at installation time, or migrate it using LVM (when non-ephemeral is needed) or use tmpfs if possible.
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SC-32</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R12)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The <html:code xmlns:html="http://www.w3.org/1999/xhtml">/tmp</html:code> partition is used as temporary storage by many programs.
Placing <html:code xmlns:html="http://www.w3.org/1999/xhtml">/tmp</html:code> in its own partition enables the setting of more
restrictive mount options, which can help protect programs which use it.
</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-partition_for_tmp:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-partition_for_tmp_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="partition_for_var" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure /var Located On Separate Partition</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var</html:code> directory is used by daemons and other system
services to store frequently-changing data. Ensure that <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var</html:code> has its own partition
or logical volume at installation time, or migrate it using LVM.
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SC-32</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R12)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Ensuring that <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var</html:code> is mounted on its own partition enables the
setting of more restrictive mount options. This helps protect
system services such as daemons or other programs which use it.
It is not uncommon for the <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var</html:code> directory to contain
world-writable directories installed by other software packages.
</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-partition_for_var:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-partition_for_var_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="partition_for_var_log" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure /var/log Located On Separate Partition</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
System logs are stored in the <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var/log</html:code> directory.
Ensure that it has its own partition or logical
volume at installation time, or migrate it using LVM.
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-9</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SC-32</reference>
          <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx"/>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R12)</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R47)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Placing <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var/log</html:code> in its own partition
enables better separation between log files
and other files in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var/</html:code>.
</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-partition_for_var_log:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-partition_for_var_log_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="partition_for_var_log_audit" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure /var/log/audit Located On Separate Partition</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Audit logs are stored in the <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var/log/audit</html:code> directory.  Ensure that it
has its own partition or logical volume at installation time, or migrate it
later using LVM. Make absolutely certain that it is large enough to store all
audit logs that will be created by the auditing daemon.
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-4</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-9</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SC-32</reference>
          <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx"/>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Placing <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var/log/audit</html:code> in its own partition
enables better separation between audit files
and other files, and helps ensure that
auditing cannot be halted due to the partition running out
of space.
</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-partition_for_var_log_audit:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-partition_for_var_log_audit_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="partition_for_home" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure /home Located On Separate Partition</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
If user home directories will be stored locally, create a separate partition
for <html:code xmlns:html="http://www.w3.org/1999/xhtml">/home</html:code> at installation time (or migrate it later using LVM). If
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/home</html:code> will be mounted from another system such as an NFS server, then
creating a separate partition is not necessary at installation time, and the
mountpoint can instead be configured later.
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SC-32</reference>
          <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1208</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R12)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Ensuring that <html:code xmlns:html="http://www.w3.org/1999/xhtml">/home</html:code> is mounted on its own partition enables the
setting of more restrictive mount options, and also helps ensure that
users cannot trivially fill partitions used for log or audit data storage.
</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-partition_for_home:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-partition_for_home_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="partition_for_srv" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure /srv Located On Separate Partition</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
If a file server (FTP, TFTP...) is hosted locally, create a separate partition
for <html:code xmlns:html="http://www.w3.org/1999/xhtml">/srv</html:code> at installation time (or migrate it later using LVM). If
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/srv</html:code> will be mounted from another system such as an NFS server, then
creating a separate partition is not necessary at installation time, and the
mountpoint can instead be configured later.
</description>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R12)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Srv deserves files for local network file server such as FTP. Ensuring
that <html:code xmlns:html="http://www.w3.org/1999/xhtml">/srv</html:code> is mounted on its own partition enables the setting of
more restrictive mount options, and also helps ensure that
users cannot trivially fill partitions used for log or audit data storage.
</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-partition_for_srv:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-partition_for_srv_ocil:questionnaire:1"/>
          </check>
        </Rule>
      </Group>
      <Group id="fs-restrict">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">filesystem rights management</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Adding filesystem specific hardening seriously limits various exploitation vectors based on
  filesystem invalid usage, such as invalid file types in invalid places (devices or setuid root files in external
media, executable file in insecure filesystems, etc.). Some of these hardening require an efficient system
partitioning.</description>
        <Rule id="sysctl_fs_protected_symlinks" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Disallow creating symlinks to a file you not own</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
            
    To set the runtime status of the <html:code xmlns:html="http://www.w3.org/1999/xhtml">fs.protected_symlinks</html:code> kernel parameter,
    run the following command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo sysctl -w fs.protected_symlinks=1</html:pre>
    If this is not the system's default value, add the following line to <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/sysctl.conf</html:code>:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">fs.protected_symlinks = 1</html:pre>
          </description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SI-11</reference>
          <reference href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf">1.6.1</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R23)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Disallowing such symlink mitigate vulnerabilities based on insecure file system
accessed by privilegied programs, avoiding an exploitation vector exploiting unsafe use of
<html:code xmlns:html="http://www.w3.org/1999/xhtml">open()</html:code> or <html:code xmlns:html="http://www.w3.org/1999/xhtml">creat()</html:code>.</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-sysctl_fs_protected_symlinks:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-sysctl_fs_protected_symlinks_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="sysctl_fs_protected_hardlinks" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Disallow creating symlinks to a file you not own</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
            
    To set the runtime status of the <html:code xmlns:html="http://www.w3.org/1999/xhtml">fs.protected_hardlinks</html:code> kernel parameter,
    run the following command:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">$ sudo sysctl -w fs.protected_hardlinks=1</html:pre>
    If this is not the system's default value, add the following line to <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/sysctl.conf</html:code>:
    <html:pre xmlns:html="http://www.w3.org/1999/xhtml" xml:space="preserve">fs.protected_hardlinks = 1</html:pre>
          </description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SI-11</reference>
          <reference href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf">1.6.1</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R23)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Disallowing such hardlink mitigate vulnerabilities based on insecure file system
accessed by privilegied programs, avoiding an exploitation vector exploiting unsafe use of
<html:code xmlns:html="http://www.w3.org/1999/xhtml">open()</html:code> or <html:code xmlns:html="http://www.w3.org/1999/xhtml">creat()</html:code>.</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-sysctl_fs_protected_hardlinks:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-sysctl_fs_protected_hardlinks_ocil:questionnaire:1"/>
          </check>
        </Rule>
      </Group>
    </Group>
    <Group id="accounts">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Account and Access Control</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">In traditional Unix security, if an attacker gains
shell access to a certain login account, they can perform any action
or access any file to which that account has access. Therefore,
making it more difficult for unauthorized people to gain shell
access to accounts, particularly to privileged accounts, is a
necessary part of securing a system. This section introduces
mechanisms for restricting access to accounts under
Debian 8.</description>
      <Group id="accounts-restrictions">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Protect Accounts by Restricting Password-Based Login</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Conventionally, Unix shell accounts are accessed by
providing a username and password to a login program, which tests
these values for correctness using the <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/passwd</html:code> and
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/shadow</html:code> files. Password-based login is vulnerable to
guessing of weak passwords, and to sniffing and man-in-the-middle
attacks against passwords entered over a network or at an insecure
console. Therefore, mechanisms for accessing accounts by entering
usernames and passwords should be restricted to those which are
operationally necessary.</description>
      </Group>
    </Group>
    <Group id="logging">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Configure Syslog</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The syslog service has been the default Unix logging mechanism for
many years. It has a number of downsides, including inconsistent log format,
lack of authentication for received messages, and lack of authentication,
encryption, or reliable transport for messages sent over a network. However,
due to its long history, syslog is a de facto standard which is supported by
almost all Unix applications.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
In Debian Jessie, rsyslog has replaced syslog as the syslog daemon of choice,
and it includes some additional security features such as reliable,
connection-oriented (i.e. TCP) transmission of logs, the option to log to
database formats, and the encryption of log data en route to
a central logging server. This section discusses how to configure rsyslog for
best effect, and how to use tools provided with the system to maintain and
monitor logs.</description>
      <Rule id="package_rsyslog_installed" selected="false" severity="medium">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure rsyslog is Installed</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Rsyslog is installed by default. 

        The <html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> package can be installed with the following command:
        <html:pre xmlns:html="http://www.w3.org/1999/xhtml"># apt-get install rsyslog</html:pre>
</description>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-9(2)</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1311</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1312</reference>
        <reference href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf">5.1.1</reference>
        <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R46)</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The rsyslog package provides the rsyslog daemon, which provides
system logging services.
</rationale>
        <fix system="urn:xccdf:fix:script:sh" id="package_rsyslog_installed" complexity="low" disruption="low" reboot="false" strategy="disable"># Include source function library.

apt-get install rsyslog
</fix>
        <fix system="urn:xccdf:fix:script:ansible" id="package_rsyslog_installed" complexity="low" disruption="low" reboot="false" strategy="enable">- name: Ensure rsyslog is installed
  package:
    name="{{item}}"
    state=present
  with_items:
    - rsyslog
</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-package_rsyslog_installed:def:1" href="ssg-debian8-oval.xml"/>
        </check>
        <check system="http://scap.nist.gov/schema/ocil/2">
          <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-package_rsyslog_installed_ocil:questionnaire:1"/>
        </check>
      </Rule>
      <Rule id="service_rsyslog_enabled" selected="false" severity="medium">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Enable rsyslog Service</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> service provides syslog-style logging by default on Debian 8.

        The <html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> service can be enabled with the following command:
        <html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ sudo chkconfig --level 2345 rsyslog on</html:pre>
</description>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-4(1)</reference>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-12</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1311</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1312</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1557</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1851</reference>
        <reference href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf">5.1.2</reference>
        <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R46)</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> service must be running in order to provide
logging services, which are essential to system administration.
</rationale>
        <fix system="urn:xccdf:fix:script:ansible" id="service_rsyslog_enabled" complexity="low" disruption="low" reboot="false" strategy="enable">- name: Enable service rsyslog
  service:
    name="{{item}}"
    enabled="yes"
    state="started"
  with_items:
    - rsyslog

</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-service_rsyslog_enabled:def:1" href="ssg-debian8-oval.xml"/>
        </check>
        <check system="http://scap.nist.gov/schema/ocil/2">
          <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-service_rsyslog_enabled_ocil:questionnaire:1"/>
        </check>
      </Rule>
      <Group id="ensure_rsyslog_log_file_configuration">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure Proper Configuration of Log Files</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The file <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code> controls where log message are written.
These are controlled by lines called <html:i xmlns:html="http://www.w3.org/1999/xhtml">rules</html:i>, which consist of a
<html:i xmlns:html="http://www.w3.org/1999/xhtml">selector</html:i> and an <html:i xmlns:html="http://www.w3.org/1999/xhtml">action</html:i>.
These rules are often customized depending on the role of the system, the
requirements of the environment, and whatever may enable
the administrator to most effectively make use of log data.
The default rules in Debian 8 are:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">auth,authpriv.*			/var/log/auth.log
*.*;auth,authpriv.none          -/var/log/syslog
daemon.*                        -/var/log/daemon.log
kern.*                          -/var/log/kern.log
lpr.*                           -/var/log/lpr.log
mail.*                          -/var/log/mail.log
user.*                          -/var/log/user.log
mail.info                       -/var/log/mail.info
mail.warn                       -/var/log/mail.warn
mail.err                        /var/log/mail.err
news.crit                       /var/log/news/news.crit
news.err                        /var/log/news/news.err
news.notice                     -/var/log/news/news.notice
</html:pre>
See the man page <html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog.conf(5)</html:code> for more information.
<html:i xmlns:html="http://www.w3.org/1999/xhtml">Note that the <html:code>rsyslog</html:code> daemon is configured to use traditional timestamping
to be understood by any log processing program. For high precision timestamping,
comment the following line in <html:code>/etc/rsyslog.conf</html:code>:
<html:pre>$ ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat</html:pre>
</html:i>
</description>
        <Value id="file_owner_logfiles_value" operator="equals" type="string">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">User who owns log files</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Specify user owner of all logfiles specified in
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code>.</description>
          <value selector="root">root</value>
        </Value>
        <Value id="file_groupowner_logfiles_value" operator="equals" type="string">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">group who owns log files</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Specify group owner of all logfiles specified in
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf.</html:code></description>
          <value selector="adm">adm</value>
        </Value>
        <Rule id="rsyslog_files_ownership" selected="false" severity="medium">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure Log Files Are Owned By Appropriate User</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The owner of all log files written by
<html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> should be root.
These log files are determined by the second part of each Rule line in
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code> and typically all appear in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var/log</html:code>.
For each log file <html:i xmlns:html="http://www.w3.org/1999/xhtml">LOGFILE</html:i> referenced in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code>,
run the following command to inspect the file's owner:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ ls -l <html:i>LOGFILE</html:i></html:pre>
If the owner is not <html:code xmlns:html="http://www.w3.org/1999/xhtml">root</html:code>, run the following command to
correct this:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ sudo chown root <html:i>LOGFILE</html:i></html:pre>
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-6</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SI-11</reference>
          <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1314</reference>
          <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-10.5.1</reference>
          <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-10.5.2</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R46)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The log files generated by rsyslog contain valuable information regarding system
configuration, user authentication, and other such information. Log files should be
protected from unauthorized access.</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-rsyslog_files_ownership:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-rsyslog_files_ownership_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="rsyslog_files_groupownership" selected="false" severity="medium">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure Log Files Are Owned By Appropriate Group</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The group-owner of all log files written by
<html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> should be root.
These log files are determined by the second part of each Rule line in
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code> and typically all appear in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var/log</html:code>.
For each log file <html:i xmlns:html="http://www.w3.org/1999/xhtml">LOGFILE</html:i> referenced in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code>,
run the following command to inspect the file's group owner:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ ls -l <html:i>LOGFILE</html:i></html:pre>
If the owner is not <html:code xmlns:html="http://www.w3.org/1999/xhtml">adm</html:code>, run the following command to
correct this:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ sudo chgrp adm <html:i>LOGFILE</html:i></html:pre>
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-6</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SI-11</reference>
          <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1314</reference>
          <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-10.5.1</reference>
          <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-10.5.2</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R46)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The log files generated by rsyslog contain valuable information regarding system
configuration, user authentication, and other such information. Log files should be
protected from unauthorized access.</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-rsyslog_files_groupownership:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-rsyslog_files_groupownership_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="rsyslog_files_permissions" selected="false" severity="medium">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure System Log Files Have Correct Permissions</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The file permissions for all log files written by
<html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> should be set to 640, or more restrictive.
These log files are determined by the second part of each Rule line in
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code> and typically all appear in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/var/log</html:code>. 
For each log file <html:i xmlns:html="http://www.w3.org/1999/xhtml">LOGFILE</html:i> referenced in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code>,
run the following command to inspect the file's permissions:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ ls -l <html:i>LOGFILE</html:i></html:pre>
If the permissions are not 640 or more restrictive,
run the following command to correct this:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ sudo chmod 0640 <html:i>LOGFILE</html:i></html:pre>
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SI-11</reference>
          <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1314</reference>
          <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-10.5.1</reference>
          <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-10.5.2</reference>
          <reference href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf">5.1.4</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R36)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Log files can contain valuable information regarding system
configuration. If the system log files are not protected unauthorized
users could change the logged data, eliminating their forensic value.
</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-rsyslog_files_permissions:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-rsyslog_files_permissions_ocil:questionnaire:1"/>
          </check>
        </Rule>
      </Group>
      <Group id="rsyslog_sending_messages">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Rsyslog Logs Sent To Remote Host</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
If system logs are to be useful in detecting malicious
activities, it is necessary to send logs to a remote server. An
intruder who has compromised the root account on a machine may
delete the log entries which indicate that the system was attacked
before they are seen by an administrator.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
However, it is recommended that logs be stored on the local
host in addition to being sent to the loghost, especially if
<html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> has been configured to use the UDP protocol to send
messages over a network. UDP does not guarantee reliable delivery,
and moderately busy sites will lose log messages occasionally,
especially in periods of high traffic which may be the result of an
attack. In addition, remote <html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> messages are not
authenticated in any way by default, so it is easy for an attacker to
introduce spurious messages to the central log server. Also, some
problems cause loss of network connectivity, which will prevent the
sending of messages to the central server. For all of these reasons, it is
better to store log messages both centrally and on each host, so
that they can be correlated if necessary.</description>
        <Rule id="rsyslog_remote_loghost" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure Logs Sent To Remote Host</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
To configure rsyslog to send logs to a remote log server,
open <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code> and read and understand the last section of the file,
which describes the multiple directives necessary to activate remote
logging.
Along with these other directives, the system can be configured
to forward its logs to a particular log server by
adding or correcting one of the following lines,
substituting <html:code xmlns:html="http://www.w3.org/1999/xhtml"><html:i>loghost.example.com</html:i></html:code> appropriately.
The choice of protocol depends on the environment of the system; 
although TCP and RELP provide more reliable message delivery, 
they may not be supported in all environments.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
To use UDP for log message delivery:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">*.* @<html:i>loghost.example.com</html:i></html:pre>
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
To use TCP for log message delivery:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">*.* @@<html:i>loghost.example.com</html:i></html:pre>
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
To use RELP for log message delivery:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">*.* :omrelp:<html:i>loghost.example.com</html:i></html:pre>
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-3(2)</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-4(1)</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-9</reference>
          <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1348</reference>
          <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">136</reference>
          <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1851</reference>
          <reference href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf">5.1.5</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">A log server (loghost) receives syslog messages from one or more
systems. This data can be used as an additional log source in the event a
system is compromised and its local logs are suspect. Forwarding log messages
to a remote loghost also provides system administrators with a centralized
place to view the status of multiple hosts within the enterprise.
</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-rsyslog_remote_loghost:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-rsyslog_remote_loghost_ocil:questionnaire:1"/>
          </check>
        </Rule>
      </Group>
      <Group id="rsyslog_accepting_remote_messages">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Configure rsyslogd to Accept Remote Messages If Acting as a Log Server</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
By default, <html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> does not listen over the network
for log messages. If needed, modules can be enabled to allow
the rsyslog daemon to receive messages from other systems and for the system
thus to act as a log server.
If the machine is not a log server, then lines concerning these modules
should remain commented out.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
</description>
        <Rule id="rsyslog_accept_remote_messages_tcp" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Enable rsyslog to Accept Messages via TCP, if Acting As Log Server</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> daemon should not accept remote messages
unless the system acts as a log server.
If the system needs to act as a central log server, add the following lines to
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code> to enable reception of messages over TCP:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ModLoad imtcp
$InputTCPServerRun 514</html:pre>
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-9</reference>
          <reference href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf">5.1.6</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
If the system needs to act as a log server, this ensures that it can receive
messages over a reliable TCP connection.
</rationale>
        </Rule>
        <Rule id="rsyslog_accept_remote_messages_udp" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Enable rsyslog to Accept Messages via UDP, if Acting As Log Server</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">rsyslog</html:code> daemon should not accept remote messages
unless the system acts as a log server.
If the system needs to act as a central log server, add the following lines to
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code> to enable reception of messages over UDP:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ModLoad imudp
$UDPServerRun 514</html:pre>
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-9</reference>
          <reference href="https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf">5.1.6</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Many devices, such as switches, routers, and other Unix-like systems, may only support
the traditional syslog transmission over UDP. If the system must act as a log server,
this enables it to receive their messages as well.
</rationale>
        </Rule>
      </Group>
      <Group id="log_rotation">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure All Logs are Rotated by logrotate</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Edit the file <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/logrotate.d/rsyslog</html:code>. Find the first
line, which should look like this (wrapped for clarity):
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler \
  /var/log/boot.log /var/log/cron {</html:pre>
Edit this line so that it contains a one-space-separated
listing of each log file referenced in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/rsyslog.conf</html:code>.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
All logs in use on a system must be rotated regularly, or the
log files will consume disk space over time, eventually interfering
with system operation. The file <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/logrotate.d/syslog</html:code> is the
configuration file used by the <html:code xmlns:html="http://www.w3.org/1999/xhtml">logrotate</html:code> program to maintain all
log files written by <html:code xmlns:html="http://www.w3.org/1999/xhtml">syslog</html:code>. By default, it rotates logs weekly and
stores four archival copies of each log. These settings can be
modified by editing <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/logrotate.conf</html:code>, but the defaults are
sufficient for purposes of this guide.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
Note that <html:code xmlns:html="http://www.w3.org/1999/xhtml">logrotate</html:code> is run nightly by the cron job
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/cron.daily/logrotate</html:code>. If particularly active logs need to be
rotated more often than once a day, some other mechanism must be
used.</description>
        <Rule id="ensure_logrotate_activated" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Ensure Logrotate Runs Periodically</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The <html:code xmlns:html="http://www.w3.org/1999/xhtml">logrotate</html:code> utility allows for the automatic rotation of 
log files.  The frequency of rotation is specified in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/logrotate.conf</html:code>, 
which triggers a cron task.  To configure logrotate to run daily, add or correct 
the following line in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/logrotate.conf</html:code>:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml"># rotate log files <html:i>frequency</html:i>
daily</html:pre>
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-9</reference>
          <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">366</reference>
          <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-10.7</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Log files that are not properly rotated run the risk of growing so large
that they fill up the /var/log partition. Valuable logging information could be lost
if the /var/log partition becomes full.</rationale>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-ensure_logrotate_activated:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-ensure_logrotate_activated_ocil:questionnaire:1"/>
          </check>
        </Rule>
      </Group>
    </Group>
  </Group>
  <Group id="services">
    <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Services</title>
    <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The best protection against vulnerable software is running less software. This section describes how to review
the software which Debian 8 installs on a system and disable software which is not needed. It
then enumerates the software packages installed on a default Debian 8 system and provides guidance about which
ones can be safely disabled.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
Debian 8 provides a convenient minimal install option that essentially installs the bare necessities for a functional
system. When building Debian 8 systems, it is highly recommended to select the minimal packages and then build up
the system from there.
</description>
    <Group id="deprecated">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Deprecated services</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Some deprecated software services impact the overall system security due to their behavior (leak of
confidentiality in network exchange, usage as uncontrolled communication channel, risk associated with the service due to its old age, etc.
</description>
      <Rule id="package_telnetd_removed" selected="false" severity="high">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Uninstall the telnet server</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The telnet daemon should be uninstalled.
</description>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-17(8)</reference>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">CM-7</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx"/>
        <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT007(R03)</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
telnet allows clear text communications, and does not protect any data transmission between client and server. Any confidential data can be listened and no integrity checking is made. 
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:sh" id="package_telnetd_removed" complexity="low" disruption="low" reboot="false" strategy="disable"># CAUTION: This remediation script will remove telnetd
#	   from the system, and may remove any packages
#	   that depend on telnetd. Execute this
#	   remediation AFTER testing on a non-production
#	   system!

apt-get remove --purge telnetd
</fix>
        <fix system="urn:xccdf:fix:script:ansible" id="package_telnetd_removed" complexity="low" disruption="low" reboot="false" strategy="disable">- name: Ensure telnetd is removed
  package:
    name="{{item}}"
    state=absent
  with_items:
    - telnetd
</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-package_telnetd_removed:def:1" href="ssg-debian8-oval.xml"/>
        </check>
      </Rule>
      <Rule id="package_inetutils-telnetd_removed" selected="false" severity="high">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Uninstall the inet-based telnet server</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The inet-based telnet daemon should be uninstalled.
</description>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-17(8)</reference>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">CM-7</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx"/>
        <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT007(R03)</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
telnet allows clear text communications, and does not protect any data transmission between client and server. Any confidential data can be listened and no integrity checking is made. 
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:sh" id="package_inetutils-telnetd_removed" complexity="low" disruption="low" reboot="false" strategy="disable"># CAUTION: This remediation script will remove inetutils-telnetd
#	   from the system, and may remove any packages
#	   that depend on inetutils-telnetd. Execute this
#	   remediation AFTER testing on a non-production
#	   system!

apt-get remove --purge inetutils-telnetd
</fix>
        <fix system="urn:xccdf:fix:script:ansible" id="package_inetutils-telnetd_removed" complexity="low" disruption="low" reboot="false" strategy="disable">- name: Ensure inetutils-telnetd is removed
  package:
    name="{{item}}"
    state=absent
  with_items:
    - inetutils-telnetd
</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-package_inetutils-telnetd_removed:def:1" href="ssg-debian8-oval.xml"/>
        </check>
      </Rule>
      <Rule id="package_telnetd-ssl_removed" selected="false" severity="high">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Uninstall the ssl compliant telnet server</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The telnet daemon, even with ssl support, should be uninstalled.
</description>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-17(8)</reference>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">CM-7</reference>
        <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT007(R02)</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
telnet, even with ssl support, should not be installed. When remote shell is required, up-to-date ssh daemon can be used.
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:sh" id="package_telnetd-ssl_removed" complexity="low" disruption="low" reboot="false" strategy="disable"># CAUTION: This remediation script will remove telnetd-ssl
#	   from the system, and may remove any packages
#	   that depend on telnetd-ssl. Execute this
#	   remediation AFTER testing on a non-production
#	   system!

apt-get remove --purge telnetd-ssl
</fix>
        <fix system="urn:xccdf:fix:script:ansible" id="package_telnetd-ssl_removed" complexity="low" disruption="low" reboot="false" strategy="disable">- name: Ensure telnetd-ssl is removed
  package:
    name="{{item}}"
    state=absent
  with_items:
    - telnetd-ssl
</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-package_telnetd-ssl_removed:def:1" href="ssg-debian8-oval.xml"/>
        </check>
      </Rule>
      <Rule id="package_nis_removed" selected="false" severity="low">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Uninstall the nis package</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The support for Yellowpages should not be installed unless it is required.
</description>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
NIS is the historical SUN service for central account management, more and more replaced by LDAP.
NIS does not support efficiently security constraints, ACL, etc. and should not be used.
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:sh" id="package_nis_removed" complexity="low" disruption="low" reboot="false" strategy="disable"># CAUTION: This remediation script will remove nis
#	   from the system, and may remove any packages
#	   that depend on nis. Execute this
#	   remediation AFTER testing on a non-production
#	   system!

apt-get remove --purge nis
</fix>
        <fix system="urn:xccdf:fix:script:ansible" id="package_nis_removed" complexity="low" disruption="low" reboot="false" strategy="disable">- name: Ensure nis is removed
  package:
    name="{{item}}"
    state=absent
  with_items:
    - nis
</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-package_nis_removed:def:1" href="ssg-debian8-oval.xml"/>
        </check>
      </Rule>
      <Rule id="package_ntpdate_removed" selected="false" severity="low">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Uninstall the ntpdate package</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
ntpdate is a historical ntp synchronization client for unixes. It sould be uninstalled.
</description>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
ntpdate is an old not security-compliant ntp client. It should be replaced by modern ntp clients such as ntpd, able to use cryptographic mechanisms integrated in NTP.
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:sh" id="package_ntpdate_removed" complexity="low" disruption="low" reboot="false" strategy="disable"># CAUTION: This remediation script will remove ntpdate
#	   from the system, and may remove any packages
#	   that depend on ntpdate. Execute this
#	   remediation AFTER testing on a non-production
#	   system!

apt-get remove --purge ntpdate
</fix>
        <fix system="urn:xccdf:fix:script:ansible" id="package_ntpdate_removed" complexity="low" disruption="low" reboot="false" strategy="disable">- name: Ensure ntpdate is removed
  package:
    name="{{item}}"
    state=absent
  with_items:
    - ntpdate
</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-package_ntpdate_removed:def:1" href="ssg-debian8-oval.xml"/>
        </check>
      </Rule>
    </Group>
    <Group id="basics">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Generic required services</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Some services need to be deployed in order to ensure basic verifications and reporting on GNU/Linux operating systems.
Each of these service take part in the administrability of the system.
</description>
      <Rule id="package_auditd_installed" selected="false" severity="medium">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">install the auditd service</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The auditd service should be installed.
</description>
        <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R50)</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The auditd service is an access monitoring and accounting daemon, watching system calls to audit any access, in comparision with potential local access control policy such as SELinux policy.
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:sh" id="package_auditd_installed" complexity="low" disruption="low" reboot="false" strategy="disable"># Include source function library.

apt-get install auditd
</fix>
        <fix system="urn:xccdf:fix:script:ansible" id="package_auditd_installed" complexity="low" disruption="low" reboot="false" strategy="enable">- name: Ensure auditd is installed
  package:
    name="{{item}}"
    state=present
  with_items:
    - auditd
</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-package_auditd_installed:def:1" href="ssg-debian8-oval.xml"/>
        </check>
      </Rule>
      <Rule id="service_auditd_enabled" selected="false" severity="medium">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Enable the auditd service</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The auditd service should be enabled.
</description>
        <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R50)</reference>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-17(1)</reference>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-1(b)</reference>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-10</reference>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-12(a)</reference>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-12(c)</reference>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">IR-5</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">347</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">157</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">172</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">880</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1353</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1462</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1487</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1115</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1454</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">067</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">158</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">831</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1190</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1312</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1263</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">130</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">120</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">1589</reference>
        <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-10</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The auditd service is an access monitoring and accounting daemon, watching system calls to audit any access, in comparision with potential local access control policy such as SELinux policy.
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:ansible" id="service_auditd_enabled" complexity="low" disruption="low" reboot="false" strategy="enable">- name: Enable service auditd
  service:
    name="{{item}}"
    enabled="yes"
    state="started"
  with_items:
    - auditd

</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-service_auditd_enabled:def:1" href="ssg-debian8-oval.xml"/>
        </check>
        <check system="http://scap.nist.gov/schema/ocil/2">
          <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-service_auditd_enabled_ocil:questionnaire:1"/>
        </check>
      </Rule>
      <Rule id="package_cron_installed" selected="false" severity="medium">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Install the cron service</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The Cron service should be installed.
</description>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">CM-7</reference>
        <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT28(R50)</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The cron service allow periodic job execution, needed for almost all administrative tasks and services (software update, log rotating, etc.). Access to cron service should be restricted to administrative accounts only.
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:sh" id="package_cron_installed" complexity="low" disruption="low" reboot="false" strategy="disable"># Include source function library.

apt-get install cron
</fix>
        <fix system="urn:xccdf:fix:script:ansible" id="package_cron_installed" complexity="low" disruption="low" reboot="false" strategy="enable">- name: Ensure cron is installed
  package:
    name="{{item}}"
    state=present
  with_items:
    - cron
</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-package_cron_installed:def:1" href="ssg-debian8-oval.xml"/>
        </check>
      </Rule>
      <Rule id="service_cron_enabled" selected="false" severity="medium">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Enable the cron service</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The Cron service should be enabled.
</description>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">CM-7</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The cron service allow periodic job execution, needed for almost all administrative tasks and services (software update, log rotating, etc.). Access to cron service should be restricted to administrative accounts only.
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:ansible" id="service_cron_enabled" complexity="low" disruption="low" reboot="false" strategy="enable">- name: Enable service cron
  service:
    name="{{item}}"
    enabled="yes"
    state="started"
  with_items:
    - cron

</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-service_cron_enabled:def:1" href="ssg-debian8-oval.xml"/>
        </check>
      </Rule>
      <Rule id="package_ntp_installed" selected="false" severity="high">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Install the ntp service</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The ntpd service should be installed.
</description>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-8(1)</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">160</reference>
        <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-10.4</reference>
        <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT012(R03)</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Time synchronization (using NTP) is required by almost all network and administrative tasks (syslog, cryptographic based services (authentication, etc.), etc.). Ntpd is regulary maintained and updated, supporting security features such as RFC 5906.
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:sh" id="package_ntp_installed" complexity="low" disruption="low" reboot="false" strategy="disable"># Include source function library.

apt-get install ntp
</fix>
        <fix system="urn:xccdf:fix:script:ansible" id="package_ntp_installed" complexity="low" disruption="low" reboot="false" strategy="enable">- name: Ensure ntp is installed
  package:
    name="{{item}}"
    state=present
  with_items:
    - ntp
</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-package_ntp_installed:def:1" href="ssg-debian8-oval.xml"/>
        </check>
      </Rule>
      <Rule id="service_ntpd_enabled" selected="false" severity="high">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Enable the ntpd service</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
The ntpd service should be enabled.
</description>
        <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AU-8(1)</reference>
        <reference href="http://iase.disa.mil/stigs/cci/Pages/index.aspx">160</reference>
        <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-10.4</reference>
        <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT012(R03)</reference>
        <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Time synchronization (using NTP) is required by almost all network and administrative tasks (syslog, cryptographic based services (authentication, etc.), etc.). Ntpd is regulary maintained and updated, supporting security features such as RFC 5906.
</rationale>
        <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
        <fix system="urn:xccdf:fix:script:ansible" id="service_ntpd_enabled" complexity="low" disruption="low" reboot="false" strategy="enable">- name: Enable service ntpd
  service:
    name="{{item}}"
    enabled="yes"
    state="started"
  with_items:
    - ntpd

</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-service_ntpd_enabled:def:1" href="ssg-debian8-oval.xml"/>
        </check>
        <check system="http://scap.nist.gov/schema/ocil/2">
          <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-service_ntpd_enabled_ocil:questionnaire:1"/>
        </check>
      </Rule>
    </Group>
    <Group id="ssh">
      <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">SSH Server</title>
      <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The SSH protocol is recommended for remote access (remote login and secure remote file transfer).
SSH provides both confidentiality and integrity for exchanged data but needs to be configured properly in term of:<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
Cryptography usage, according to the current CVEs associated to the various cryptographic modes<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
Authentication and autorization, depending on your needs but requiring some specific initial generic security<html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
consideration in the OpenSSH configuration writing
More detailed information is available from the OpenSSH project's website <html:a xmlns:html="http://www.w3.org/1999/xhtml" href="http://www.openssh.org">http://www.openssh.org</html:a>. The Debian package for
server side implementation is called <html:code xmlns:html="http://www.w3.org/1999/xhtml">openssh-server</html:code>.
</description>
      <Value id="sshd_idle_timeout_value" operator="equals" type="number">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">SSH session Idle time</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Specify duration of allowed idle time.</description>
        <value>300</value>
        <value selector="5_minutes">300</value>
        <value selector="10_minutes">600</value>
        <value selector="15_minutes">900</value>
        <value selector="60_minutes">3600</value>
        <value selector="120_minutes">7200</value>
      </Value>
      <Rule id="service_sshd_disabled" selected="false" severity="low">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Disable SSH Server if possible (unusual cases)</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Most of the time, the SSH server is needed. However, it can be disabled, do so.

        The <html:code xmlns:html="http://www.w3.org/1999/xhtml">ssh</html:code> service can be disabled with the following command:
        <html:pre xmlns:html="http://www.w3.org/1999/xhtml">$ sudo chkconfig ssh off</html:pre>
This is unusual, as SSH is a common method for encrypted and authenticated
remote access.
</description>
        <fix system="urn:xccdf:fix:script:ansible" id="service_sshd_disabled" complexity="low" disruption="low" reboot="false" strategy="disable">- name: Disable service sshd
  service:
    name="{{item}}"
    enabled="no"
    state="stopped"
  with_items:
    - sshd

</fix>
        <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
          <check-content-ref name="oval:ssg-service_sshd_disabled:def:1" href="ssg-debian8-oval.xml"/>
        </check>
      </Rule>
      <Group id="ssh_server">
        <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Configure OpenSSH Server if deployed</title>
        <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">If the system needs to act as an SSH server, then
certain changes should be made to the OpenSSH daemon configuration
file <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</html:code>. The following recommendations can be
applied to this file. See the <html:code xmlns:html="http://www.w3.org/1999/xhtml">sshd_config(5)</html:code> man page for more
detailed information.</description>
        <Rule id="sshd_allow_only_protocol2" selected="false" severity="high">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Allow Only SSH Protocol 2</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Only SSH protocol version 2 connections should be
permitted. The default setting in
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</html:code> is correct, and can be
verified by ensuring that the following
line appears:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">Protocol 2</html:pre>
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-17(7)</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">IA-5(1)(c)</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT007(R1)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
SSH protocol version 1 suffers from design flaws that
result in security vulnerabilities and
should not be used.
</rationale>
          <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-sshd_allow_only_protocol2:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-sshd_allow_only_protocol2_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="sshd_set_idle_timeout" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Set SSH Idle Timeout Interval</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">SSH allows administrators to set an idle timeout interval.
After this interval has passed, the idle user will be automatically logged out.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
To set an idle timeout interval, edit the following line in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</html:code> as
follows:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">ClientAliveInterval <html:b>interval</html:b></html:pre>
The timeout <html:b xmlns:html="http://www.w3.org/1999/xhtml">interval</html:b> is given in seconds. To have a timeout
of 15 minutes, set <html:b xmlns:html="http://www.w3.org/1999/xhtml">interval</html:b> to 900.
<html:br xmlns:html="http://www.w3.org/1999/xhtml"/><html:br xmlns:html="http://www.w3.org/1999/xhtml"/>
If a shorter timeout has already been set for the login
shell, that value will preempt any SSH
setting made here. Keep in mind that some processes may stop SSH
from correctly detecting that the user is idle.
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-2(5)</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SA-8</reference>
          <reference href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-1.pdf">Req-8.1.8</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Causing idle users to be automatically logged out
guards against compromises one system leading trivially
to compromises on another.
</rationale>
          <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-export export-name="oval:ssg-sshd_idle_timeout_value:var:1" value-id="sshd_idle_timeout_value"/>
            <check-content-ref name="oval:ssg-sshd_set_idle_timeout:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-sshd_set_idle_timeout_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="sshd_set_keepalive" selected="false" severity="low">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Set SSH Client Alive Count</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">To ensure the SSH idle timeout occurs precisely when the <html:code xmlns:html="http://www.w3.org/1999/xhtml">ClientAliveCountMax</html:code> is set,
edit <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</html:code> as
follows:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">ClientAliveCountMax 0</html:pre>
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-2(5)</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">SA-8</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
This ensures a user login will be terminated as soon as the <html:code xmlns:html="http://www.w3.org/1999/xhtml">ClientAliveCountMax</html:code>
is reached.
</rationale>
          <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-sshd_set_keepalive:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-sshd_set_keepalive_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="sshd_disable_root_login" selected="false" severity="medium">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Disable SSH Root Login</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">The root user should never be allowed to login to a
system directly over a network.
To disable root login via SSH, add or correct the following line
in <html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</html:code>:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">PermitRootLogin no</html:pre>
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-3</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-6(2)</reference>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">IA-2(1)</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT007(R21)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Permitting direct root login reduces auditable information about who ran
privileged commands on the system
and also allows direct attack attempts on root's password.
</rationale>
          <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-sshd_disable_root_login:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-sshd_disable_root_login_ocil:questionnaire:1"/>
          </check>
        </Rule>
        <Rule id="sshd_disable_empty_passwords" selected="false" severity="high">
          <title xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">Disable SSH Access via Empty Passwords</title>
          <description xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">To explicitly disallow remote login from accounts with
empty passwords, add or correct the following line in
<html:code xmlns:html="http://www.w3.org/1999/xhtml">/etc/ssh/sshd_config</html:code>:
<html:pre xmlns:html="http://www.w3.org/1999/xhtml">PermitEmptyPasswords no</html:pre>
Any accounts with empty passwords should be disabled immediately, and PAM configuration
should prevent users from being able to assign themselves empty passwords.
</description>
          <reference href="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r4.pdf">AC-3</reference>
          <reference href="http://www.ssi.gouv.fr/administration/bonnes-pratiques/">NT007(R17)</reference>
          <rationale xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-US">
Configuring this setting for the SSH daemon provides additional assurance that
remote login via SSH will require a password,
even in the event of misconfiguration elsewhere.
</rationale>
          <ident system="https://nvd.nist.gov/cce/index.cfm">CCE-</ident>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
            <check-content-ref name="oval:ssg-sshd_disable_empty_passwords:def:1" href="ssg-debian8-oval.xml"/>
          </check>
          <check system="http://scap.nist.gov/schema/ocil/2">
            <check-content-ref href="ssg-debian8-ocil.xml" name="ocil:ssg-sshd_disable_empty_passwords_ocil:questionnaire:1"/>
          </check>
        </Rule>
      </Group>
    </Group>
  </Group>
</Benchmark>