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
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
|
.TH FIREJAIL 1 "MONTH YEAR" "VERSION" "firejail man page"
.SH NAME
Firejail \- Linux namespaces sandbox program
.SH SYNOPSIS
Start a sandbox:
.PP
.RS
firejail [OPTIONS] [program and arguments]
.RE
.PP
Start an AppImage program:
.PP
.RS
firejail [OPTIONS] --appimage [appimage-file and arguments]
.RE
.PP
#ifdef HAVE_FILE_TRANSFER
File transfer from an existing sandbox
.PP
.RS
firejail {\-\-ls | \-\-get | \-\-put | \-\-cat} dir_or_filename
.RE
.PP
#endif
#ifdef HAVE_NETWORK
Network traffic shaping for an existing sandbox:
.PP
.RS
firejail \-\-bandwidth={name|pid} bandwidth-command
.RE
.PP
#endif
Monitoring:
.PP
.RS
firejail {\-\-list | \-\-netstats | \-\-top | \-\-tree}
.RE
.PP
Miscellaneous:
.PP
.RS
firejail {\-? | \-\-debug-caps | \-\-debug-errnos | \-\-debug-syscalls | \-\-debug-syscalls32 | \-\-debug-protocols | \-\-help | \-\-version}
.RE
.SH DESCRIPTION
#ifdef HAVE_LTS
This is Firejail long-term support (LTS), an enterprise focused version of the software,
LTS is usually supported for two or three years.
During this time only bugs and the occasional documentation problems are fixed.
The attack surface of the SUID executable was greatly reduced by removing some of the features.
.br
.br
#endif
Firejail is a SUID sandbox program that reduces the risk of security breaches by
restricting the running environment of untrusted applications using Linux
namespaces, seccomp-bpf and Linux capabilities.
It allows a process and all its descendants to have their own private view of the
globally shared kernel resources, such as the network stack, process table, mount table.
Firejail can work in a SELinux or AppArmor environment,
and it is integrated with Linux Control Groups.
.PP
Written in C with virtually no dependencies, the software runs on any Linux computer with a 3.x kernel version
or newer.
It can sandbox any type of processes: servers, graphical applications, and even user login sessions.
.PP
Firejail allows the user to manage application security using security profiles.
Each profile defines a set of permissions for a specific application or group
of applications. The software includes security profiles for a number of more common
Linux programs, such as Mozilla Firefox, Chromium, VLC, Transmission etc.
.PP
Alternative sandbox technologies like snap (https://snapcraft.io/) and flatpak (https://flatpak.org/)
are not supported. Snap and flatpak packages have their own native management tools and will
not work when sandboxed with Firejail.
.SH USAGE
Without any options, the sandbox consists of a filesystem build in a new mount namespace,
and new PID and UTS namespaces. IPC, network and user namespaces can be added using the
command line options. The default Firejail filesystem is based on the host filesystem with the main
system directories mounted read-only. These directories are /etc, /var, /usr, /bin, /sbin, /lib, /lib32,
/libx32 and /lib64. Only /home and /tmp are writable.
.PP
Upon execution Firejail first looks in ~/.config/firejail/ for a profile and if it doesn't find one, it looks in /etc/firejail/.
For profile resolution detail see https://github.com/netblue30/firejail/wiki/Creating-Profiles#locations-and-types.
If an appropriate profile is not found, Firejail will use a default profile.
The default profile is quite restrictive. In case the application doesn't work, use --noprofile option
to disable it. For more information, please see \fBSECURITY PROFILES\fR section below.
.PP
If a program argument is not specified, Firejail starts the user's preferred shell.
Examples:
.PP
$ firejail [OPTIONS] # starting the program specified in $SHELL, usually /bin/bash
.PP
$ firejail [OPTIONS] firefox # starting Mozilla Firefox
.PP
# sudo firejail [OPTIONS] /etc/init.d/nginx start
.SH OPTIONS
.TP
\fB\-\-
Signal the end of options and disables further option processing.
.TP
\fB\-\-allow-debuggers
Allow tools such as strace and gdb inside the sandbox by whitelisting
system calls ptrace and process_vm_readv. This option is only
available when running on Linux kernels 4.8 or newer - a kernel bug in
ptrace system call allows a full bypass of the seccomp filter.
.br
.br
Example:
.br
$ firejail --allow-debuggers --profile=/etc/firejail/firefox.profile strace -f firefox
.TP
\fB\-\-allusers
All directories under /home are visible inside the sandbox. By default, only current user home directory is visible.
.br
.br
Example:
.br
$ firejail --allusers
#ifdef HAVE_APPARMOR
.TP
\fB\-\-apparmor
Enable AppArmor confinement. For more information, please see \fBAPPARMOR\fR section below.
.TP
\fB\-\-apparmor.print=name|pid
Print the AppArmor confinement status for the sandbox identified by name or by PID.
.br
.br
Example:
.br
$ firejail \-\-apparmor.print=browser
.br
5074:netblue:/usr/bin/firejail /usr/bin/firefox-esr
.br
AppArmor: firejail-default enforce
#endif
.TP
\fB\-\-appimage
Sandbox an AppImage (https://appimage.org/) application. If the sandbox is started
as a regular user, nonewprivs and a default capabilities filter are enabled.
private-bin and private-lib are disabled by default when running appimages.
.br
.br
Example:
.br
$ firejail --appimage --profile=krita krita-3.0-x86_64.appimage
.br
$ firejail --appimage --private --profile=krita krita-3.0-x86_64.appimage
.br
#ifdef HAVE_X11
$ firejail --appimage --net=none --x11 --profile=krita krita-3.0-x86_64.appimage
#endif
.TP
#ifdef HAVE_NETWORK
\fB\-\-bandwidth=name|pid
Set bandwidth limits for the sandbox identified by name or PID, see \fBTRAFFIC SHAPING\fR section for more details.
#endif
.TP
\fB\-\-bind=filename1,filename2
Mount-bind filename1 on top of filename2. This option is only available when running as root.
.br
.br
Example:
.br
# firejail \-\-bind=/config/etc/passwd,/etc/passwd
.TP
\fB\-\-blacklist=dirname_or_filename
Blacklist directory or file. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
.br
.br
Example:
.br
$ firejail \-\-blacklist=/sbin \-\-blacklist=/usr/sbin
.br
$ firejail \-\-blacklist=~/.mozilla
.br
$ firejail "\-\-blacklist=/home/username/My Virtual Machines"
.br
$ firejail \-\-blacklist=/home/username/My\\ Virtual\\ Machines
.TP
\fB\-\-build
The command builds a whitelisted profile. The profile is printed on the screen. The program is run in a very relaxed sandbox, with only --caps.drop=all and --nonewprivs. Programs that raise user privileges are not supported.
.br
.br
Example:
.br
$ firejail --build vlc ~/Videos/test.mp4
.TP
\fB\-\-build=profile-file
The command builds a whitelisted profile, and saves it in profile-file. The program is run in a very relaxed sandbox,
with only --caps.drop=all and --nonewprivs. Programs that raise user privileges are not supported.
.br
.br
Example:
.br
$ firejail --build=vlc.profile vlc ~/Videos/test.mp4
.TP
\fB\-c
Login shell compatibility option. This option is use by some login programs when executing
the login shell, such as when firejail is used as a restricted login shell. It currently does
not change the execution of firejail.
.TP
\fB\-\-caps
Linux capabilities is a kernel feature designed to split up the root privilege into a set of distinct privileges.
These privileges can be enabled or disabled independently, thus restricting what a process running
as root can do in the system.
By default root programs run with all capabilities enabled. \-\-caps option disables the following capabilities:
CAP_SYS_MODULE, CAP_SYS_RAWIO,
CAP_SYS_BOOT, CAP_SYS_NICE, CAP_SYS_TTY_CONFIG, CAP_SYSLOG, CAP_MKNOD, CAP_SYS_ADMIN.
The filter is applied to all processes started in the sandbox.
.br
.br
Example:
.br
$ sudo firejail \-\-caps /etc/init.d/nginx start
.TP
\fB\-\-caps.drop=all
Drop all capabilities for the processes running in the sandbox. This option is recommended for running GUI programs
or any other program that doesn't require root privileges. It is a must-have option for sandboxing untrusted programs
installed from unofficial sources - such as games, Java programs, etc.
.br
.br
Example:
.br
$ firejail \-\-caps.drop=all warzone2100
.TP
\fB\-\-caps.drop=capability,capability,capability
Define a custom blacklist Linux capabilities filter.
.br
.br
Example:
.br
$ firejail \-\-caps.drop=net_broadcast,net_admin,net_raw
.TP
\fB\-\-caps.keep=capability,capability,capability
Define a custom whitelist Linux capabilities filter.
.br
.br
Example:
.br
$ sudo firejail \-\-caps.keep=chown,net_bind_service,setgid,\\
setuid /etc/init.d/nginx start
.TP
\fB\-\-caps.print=name|pid
Print the caps filter for the sandbox identified by name or by PID.
.br
.br
Example:
.br
$ firejail \-\-name=mygame \-\-caps.drop=all warzone2100 &
.br
$ firejail \-\-caps.print=mygame
.br
.br
Example:
.br
$ firejail \-\-list
.br
3272:netblue::firejail \-\-private firefox
.br
$ firejail \-\-caps.print=3272
#ifdef HAVE_FILE_TRANSFER
.TP
\fB\-\-cat=name|pid filename
Print content of file from sandbox container, see FILE TRANSFER section for more details.
#endif
.TP
\fB\-\-cgroup=file
Place the sandbox in the specified control group. file is the full path of a tasks or cgroup.procs file.
.br
.br
Example:
.br
# firejail \-\-cgroup=/sys/fs/cgroup/g1/tasks
#ifdef HAVE_CHROOT
.TP
\fB\-\-chroot=dirname
Chroot the sandbox into a root filesystem. Unlike the regular filesystem container,
the system directories are mounted read-write. If the sandbox is started as a
regular user, nonewprivs and a default capabilities filter are enabled.
.br
.br
Example:
.br
$ firejail \-\-chroot=/media/ubuntu warzone2100
.br
.br
For automatic mounting of X11 and PulseAudio sockets set environment variables
FIREJAIL_CHROOT_X11 and FIREJAIL_CHROOT_PULSE.
#endif
.TP
\fB\-\-cpu=cpu-number,cpu-number,cpu-number
Set CPU affinity.
.br
.br
Example:
.br
$ firejail \-\-cpu=0,1 handbrake
.TP
\fB\-\-cpu.print=name|pid
Print the CPU cores in use by the sandbox identified by name or by PID.
.br
.br
Example:
.br
$ firejail \-\-name=mygame \-\-caps.drop=all warzone2100 &
.br
$ firejail \-\-cpu.print=mygame
.br
.br
Example:
.br
$ firejail \-\-list
.br
3272:netblue::firejail \-\-private firefox
.br
$ firejail \-\-cpu.print=3272
#ifdef HAVE_DBUSPROXY
.TP
\fB\-\-dbus-log=file
Specify the location for the DBus log file.
.br
.br
The log file contains events for both the system and session buses if both of
the --dbus-system.log and --dbus-user.log options are specified. If no log file
path is given, logs are written to the standard output instead.
.br
.br
Example:
.br
$ firejail --dbus-system=filter --dbus-system.log \\
.br
--dbus-log=dbus.txt
.TP
\fB\-\-dbus-system=filter|none
Set system DBus sandboxing policy.
.br
.br
The \fBfilter\fR policy enables the system DBus filter. This option requires
installing the xdg-dbus-proxy utility. Permissions for well-known can be
specified with the --dbus-system.talk and --dbus-system.own options.
.br
.br
The \fBnone\fR policy disables access to the system DBus.
.br
.br
Only the regular system DBus UNIX socket is handled by this option. To disable
the abstract sockets (and force applications to use the filtered UNIX socket)
you would need to request a new network namespace using \-\-net command. Another
option is to remove unix from the \-\-protocol set.
.br
.br
Example:
.br
$ firejail \-\-dbus-system=none
.TP
\fB\-\-dbus-system.broadcast=name=[member][@path]
Allows the application to receive broadcast signals from theindicated interface
member at the indicated object path exposed by the indicated bus name on the
system DBus.
The name may have a .* suffix to match all names underneath it, including
itself.
The interface member may have a .* to match all members of an interface, or be * to match all interfaces.
The path may have a /* suffix to indicate all objects underneath it, including
itself.
Omitting the interface member or the object path will match all members and
object paths, respectively.
.br
.br
Example:
.br
$ firejail --dbus-system=filter --dbus-system.broadcast=\\
.br
org.freedesktop.Notifications=\\
.br
org.freedesktop.Notifications.*@/org/freedesktop/Notifications
.TP
\fB\-\-dbus-system.call=name=[member][@path]
Allows the application to call the indicated interface member at the indicated
object path exposed by the indicated bus name on the system DBus.
The name may have a .* suffix to match all names underneath it, including
itself.
The interface member may have a .* to match all members of an interface, or be * to match all interfaces.
The path may have a /* suffix to indicate all objects underneath it, including
itself.
Omitting the interface member or the object path will match all members and
object paths, respectively.
.br
.br
Example:
.br
$ firejail --dbus-system=filter --dbus-system.call=\\
.br
org.freedesktop.Notifications=\\
.br
org.freedesktop.Notifications.*@/org/freedesktop/Notifications
.TP
\fB\-\-dbus-system.log
Turn on DBus logging for the system DBus. This option requires --dbus-system=filter.
.br
Example:
.br
$ firejail --dbus-system=filter --dbus-system.log
.TP
\fB\-\-dbus-system.own=name
Allows the application to own the specified well-known name on the system DBus.
The name may have a .* suffix to match all names underneath it, including itself
(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
not "foobar").
.br
.br
Example:
.br
$ firejail --dbus-system=filter --dbus-system.own=\\
.br
org.gnome.ghex.*
.TP
\fB\-\-dbus-system.see=name
Allows the application to see, but not talk to the specified well-known name on
the system DBus.
The name may have a .* suffix to match all names underneath it, including itself
(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
not "foobar").
.br
.br
Example:
.br
$ firejail --dbus-system=filter --dbus-system.see=\\
.br
org.freedesktop.Notifications
.TP
\fB\-\-dbus-system.talk=name
Allows the application to talk to the specified well-known name on the system DBus.
The name may have a .* suffix to match all names underneath it, including itself
(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
not "foobar").
.br
.br
Example:
.br
$ firejail --dbus-system=filter --dbus-system.talk=\\
.br
org.freedesktop.Notifications
.TP
\fB\-\-dbus-user=filter|none
Set session DBus sandboxing policy.
.br
.br
The \fBfilter\fR policy enables the session DBus filter. This option requires
installing the xdg-dbus-proxy utility. Permissions for well-known names can be
added with the --dbus-user.talk and --dbus-user.own options.
.br
.br
The \fBnone\fR policy disables access to the session DBus.
.br
.br
Only the regular session DBus UNIX socket is handled by this option. To disable
the abstract sockets (and force applications to use the filtered UNIX socket)
you would need to request a new network namespace using \-\-net command. Another
option is to remove unix from the \-\-protocol set.
.br
.br
Example:
.br
$ firejail \-\-dbus-user=none
.TP
\fB\-\-dbus-user.broadcast=name=[member][@path]
Allows the application to receive broadcast signals from theindicated interface
member at the indicated object path exposed by the indicated bus name on the
session DBus.
The name may have a .* suffix to match all names underneath it, including
itself.
The interface member may have a .* to match all members of an interface, or be * to match all interfaces.
The path may have a /* suffix to indicate all objects underneath it, including
itself.
Omitting the interface member or the object path will match all members and
object paths, respectively.
.br
.br
Example:
.br
$ firejail --dbus-user=filter --dbus-user.broadcast=\\
.br
org.freedesktop.Notifications=\\
.br
org.freedesktop.Notifications.*@/org/freedesktop/Notifications
.TP
\fB\-\-dbus-user.call=name=[member][@path]
Allows the application to call the indicated interface member at the indicated
object path exposed by the indicated bus name on the session DBus.
The name may have a .* suffix to match all names underneath it, including
itself.
The interface member may have a .* to match all members of an interface, or be * to match all interfaces.
The path may have a /* suffix to indicate all objects underneath it, including
itself.
Omitting the interface member or the object path will match all members and
object paths, respectively.
.br
.br
Example:
.br
$ firejail --dbus-user=filter --dbus-user.call=\\
.br
org.freedesktop.Notifications=\\
.br
org.freedesktop.Notifications.*@/org/freedesktop/Notifications
.TP
\fB\-\-dbus-user.log
Turn on DBus logging for the session DBus. This option requires --dbus-user=filter.
.br
Example:
.br
$ firejail --dbus-user=filter --dbus-user.log
.TP
\fB\-\-dbus-user.own=name
Allows the application to own the specified well-known name on the session DBus.
The name may have a .* suffix to match all names underneath it, including itself
(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
not "foobar").
.br
.br
Example:
.br
$ firejail --dbus-user=filter --dbus-user.own=org.gnome.ghex.*
.TP
\fB\-\-dbus-user.talk=name
Allows the application to talk to the specified well-known name on the session DBus.
The name may have a .* suffix to match all names underneath it, including itself
(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
not "foobar").
.br
.br
Example:
.br
$ firejail --dbus-user=filter --dbus-user.talk=\\
.br
org.freedesktop.Notifications
.TP
\fB\-\-dbus-user.see=name
Allows the application to see, but not talk to the specified well-known name on
the session DBus.
The name may have a .* suffix to match all names underneath it, including itself
(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
not "foobar").
.br
.br
Example:
.br
$ firejail --dbus-user=filter --dbus-user.see=\\
.br
org.freedesktop.Notifications
#endif
.TP
\fB\-\-debug\fR
Print debug messages.
.br
.br
Example:
.br
$ firejail \-\-debug firefox
.TP
\fB\-\-debug-blacklists\fR
Debug blacklisting.
.br
.br
Example:
.br
$ firejail \-\-debug-blacklists firefox
.TP
\fB\-\-debug-caps
Print all recognized capabilities in the current Firejail software build and exit.
.br
.br
Example:
.br
$ firejail \-\-debug-caps
.TP
\fB\-\-debug-errnos
Print all recognized error numbers in the current Firejail software build and exit.
.br
.br
Example:
.br
$ firejail \-\-debug-errnos
.TP
\fB\-\-debug-private-lib
Debug messages for --private-lib option.
.TP
\fB\-\-debug-protocols
Print all recognized protocols in the current Firejail software build and exit.
.br
.br
Example:
.br
$ firejail \-\-debug-protocols
.TP
\fB\-\-debug-syscalls
Print all recognized system calls in the current Firejail software build and exit.
.br
.br
Example:
.br
$ firejail \-\-debug-syscalls
.TP
\fB\-\-debug-syscalls32
Print all recognized 32 bit system calls in the current Firejail software build and exit.
.br
.TP
\fB\-\-debug-whitelists\fR
Debug whitelisting.
.br
.br
Example:
.br
$ firejail \-\-debug-whitelists firefox
#ifdef HAVE_NETWORK
.TP
\fB\-\-defaultgw=address
Use this address as default gateway in the new network namespace.
.br
.br
Example:
.br
$ firejail \-\-net=eth0 \-\-defaultgw=10.10.20.1 firefox
#endif
.TP
\fB\-\-deterministic-exit-code
Always exit firejail with the first child's exit status. The default behavior is to use the exit status of the final child to exit, which can be nondeterministic.
.br
.TP
\fB\-\-deterministic-shutdown
Always shut down the sandbox after the first child has terminated. The default behavior is to keep the sandbox alive as long as it contains running processes.
.br
.TP
\fB\-\-disable-mnt
Blacklist /mnt, /media, /run/mount and /run/media access.
.br
.br
Example:
.br
$ firejail \-\-disable-mnt firefox
.TP
\fB\-\-dns=address
Set a DNS server for the sandbox. Up to three DNS servers can be defined.
Use this option if you don't trust the DNS setup on your network.
.br
.br
Example:
.br
$ firejail \-\-dns=8.8.8.8 \-\-dns=8.8.4.4 firefox
.br
.br
Note: this feature is not supported on systemd-resolved setups.
.TP
\fB\-\-dns.print=name|pid
Print DNS configuration for a sandbox identified by name or by PID.
.br
.br
Example:
.br
$ firejail \-\-name=mygame \-\-caps.drop=all warzone2100 &
.br
$ firejail \-\-dns.print=mygame
.br
.br
Example:
.br
$ firejail \-\-list
.br
3272:netblue::firejail \-\-private firefox
.br
$ firejail \-\-dns.print=3272
.TP
\fB\-\-env=name=value
Set environment variable in the new sandbox.
.br
.br
Example:
.br
$ firejail \-\-env=LD_LIBRARY_PATH=/opt/test/lib
.TP
\fB\-\-fs.print=name|pid
Print the filesystem log for the sandbox identified by name or by PID.
.br
.br
Example:
.br
$ firejail \-\-name=mygame \-\-caps.drop=all warzone2100 &
.br
$ firejail \-\-fs.print=mygame
.br
.br
Example:
.br
$ firejail \-\-list
.br
3272:netblue::firejail \-\-private firefox
.br
$ firejail \-\-fs.print=3272
#ifdef HAVE_FILE_TRANSFER
.TP
\fB\-\-get=name|pid filename
Get a file from sandbox container, see \fBFILE TRANSFER\fR section for more details.
#endif
.TP
\fB\-?\fR, \fB\-\-help\fR
Print options end exit.
.TP
\fB\-\-hostname=name
Set sandbox hostname.
.br
.br
Example:
.br
$ firejail \-\-hostname=officepc firefox
.TP
\fB\-\-hosts-file=file
Use file as /etc/hosts.
.br
.br
Example:
.br
$ firejail \-\-hosts-file=~/myhosts firefox
.TP
\fB\-\-ids-check
Check file hashes previously generated by \-\-ids-check. See INTRUSION DETECTION SYSTEM section for more details.
.br
.br
Example:
.br
$ firejail \-\-ids-check
.TP
\fB\-\-ids-init
Initialize file hashes. See INTRUSION DETECTION SYSTEM section for more details.
.br
.br
Example:
.br
$ firejail \-\-ids-init
.TP
\fB\-\-ignore=command
Ignore command in profile file.
.br
.br
Example:
.br
$ firejail \-\-ignore=shell --ignore=seccomp firefox
#ifdef HAVE_NETWORK
.br
$ firejail \-\-ignore="net eth0" firefox
#endif
.TP
\fB\-\-\include=file.profile
Include a profile file before the regular profiles are used.
.br
.br
Example:
.br
$ firejail --include=/etc/firejail/disable-devel.inc gedit
#ifdef HAVE_NETWORK
.TP
\fB\-\-interface=interface
Move interface in a new network namespace. Up to four --interface options can be specified.
Note: wlan devices are not supported for this option.
.br
.br
Example:
.br
$ firejail \-\-interface=eth1 \-\-interface=eth0.vlan100
.TP
\fB\-\-ip=address
Assign IP addresses to the last network interface defined by a \-\-net option. A
default gateway is assigned by default.
.br
.br
Example:
.br
$ firejail \-\-net=eth0 \-\-ip=10.10.20.56 firefox
.TP
\fB\-\-ip=none
No IP address and no default gateway are configured for the last interface
defined by a \-\-net option. Use this option
in case you intend to start an external DHCP client in the sandbox.
.br
.br
Example:
.br
$ firejail \-\-net=eth0 \-\-\ip=none
.br
.br
If the corresponding interface doesn't have an IP address configured, this
option is enabled by default.
.TP
\fB\-\-ip=dhcp
Acquire an IP address and default gateway for the last interface defined by a
\-\-net option, as well as set the DNS servers according to the DHCP response.
This option requires the ISC dhclient DHCP client to be installed and will start
it automatically inside the sandbox.
.br
.br
Example:
.br
$ firejail \-\-net=br0 \-\-ip=dhcp
.br
.br
This option should not be used in conjunction with the \-\-dns option if the
DHCP server is set to configure DNS servers for the clients, because the
manually specified DNS servers will be overwritten.
.br
The DHCP client will NOT release the DHCP lease when the sandbox terminates.
If your DHCP server requires leases to be explicitly released, consider running
a DHCP client and releasing the lease manually in conjunction with the
\-\-net=none option.
.TP
\fB\-\-ip6=address
Assign IPv6 addresses to the last network interface defined by a \-\-net option.
.br
.br
Example:
.br
$ firejail \-\-net=eth0 \-\-ip6=2001:0db8:0:f101::1/64 firefox
Note: you don't need this option if you obtain your ip6 address from router via SLAAC (your ip6 address and default route will be configured by kernel automatically).
.TP
\fB\-\-ip6=dhcp
Acquire an IPv6 address and default gateway for the last interface defined by a
\-\-net option, as well as set the DNS servers according to the DHCP response.
This option requires the ISC dhclient DHCP client to be installed and will start
it automatically inside the sandbox.
.br
.br
Example:
.br
$ firejail \-\-net=br0 \-\-ip6=dhcp
.br
.br
This option should not be used in conjunction with the \-\-dns option if the
DHCP server is set to configure DNS servers for the clients, because the
manually specified DNS servers will be overwritten.
.br
The DHCP client will NOT release the DHCP lease when the sandbox terminates.
If your DHCP server requires leases to be explicitly released, consider running
a DHCP client and releasing the lease manually.
.TP
\fB\-\-iprange=address,address
Assign an IP address in the provided range to the last network interface defined by a \-\-net option. A
default gateway is assigned by default.
.br
.br
Example:
.br
$ firejail \-\-net=eth0 \-\-\iprange=192.168.1.100,192.168.1.150
.TP
\fB\-\-ipc-namespace
Enable a new IPC namespace if the sandbox was started as a regular user. IPC namespace is enabled by default
for sandboxes started as root.
.br
.br
Example:
.br
$ firejail \-\-ipc-namespace firefox
#endif
.TP
\fB\-\-join=name|pid
Join the sandbox identified by name or by PID. By default a /bin/bash shell is started after joining the sandbox.
If a program is specified, the program is run in the sandbox. If \-\-join command is issued as a regular user,
all security filters are configured for the new process the same they are configured in the sandbox.
If \-\-join command is issued as root, the security filters, cgroups and cpus configurations are not applied
to the process joining the sandbox.
.br
.br
Example:
.br
$ firejail \-\-name=mygame \-\-caps.drop=all warzone2100 &
.br
$ firejail \-\-join=mygame
.br
.br
Example:
.br
$ firejail \-\-list
.br
3272:netblue::firejail \-\-private firefox
.br
$ firejail \-\-join=3272
.TP
\fB\-\-join-filesystem=name|pid
Join the mount namespace of the sandbox identified by name or PID. By default a /bin/bash shell is started after joining the sandbox.
If a program is specified, the program is run in the sandbox. This command is available only to root user.
Security filters, cgroups and cpus configurations are not applied to the process joining the sandbox.
#ifdef HAVE_NETWORK
.TP
\fB\-\-join-network=name|pid
Join the network namespace of the sandbox identified by name. By default a /bin/bash shell is started after joining the sandbox.
If a program is specified, the program is run in the sandbox. This command is available only to root user.
Security filters, cgroups and cpus configurations are not applied to the process joining the sandbox. Example:
.br
.br
# start firefox
.br
$ firejail --net=eth0 --name=browser firefox &
.br
.br
# change netfilter configuration
.br
$ sudo firejail --join-network=browser bash -c "cat /etc/firejail/nolocal.net | /sbin/iptables-restore"
.br
.br
# verify netfilter configuration
.br
$ sudo firejail --join-network=browser /sbin/iptables -vL
.br
.br
# verify IP addresses
.br
$ sudo firejail --join-network=browser ip addr
.br
Switching to pid 1932, the first child process inside the sandbox
.br
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
.br
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
.br
inet 127.0.0.1/8 scope host lo
.br
valid_lft forever preferred_lft forever
.br
inet6 ::1/128 scope host
.br
valid_lft forever preferred_lft forever
.br
2: eth0-1931: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
.br
link/ether 76:58:14:42:78:e4 brd ff:ff:ff:ff:ff:ff
.br
inet 192.168.1.158/24 brd 192.168.1.255 scope global eth0-1931
.br
valid_lft forever preferred_lft forever
.br
inet6 fe80::7458:14ff:fe42:78e4/64 scope link
.br
valid_lft forever preferred_lft forever
#endif
.TP
\fB\-\-join-or-start=name
Join the sandbox identified by name or start a new one.
Same as "firejail --join=name" if sandbox with specified name exists, otherwise same as "firejail --name=name ..."
.br
Note that in contrary to other join options there is respective profile option.
.TP
\fB\-\-keep-config-pulse
Disable automatic ~/.config/pulse init, for complex setups such as remote
pulse servers or non-standard socket paths.
.br
.br
Example:
.br
$ firejail \-\-keep-config-pulse firefox
.TP
\fB\-\-keep-dev-shm
/dev/shm directory is untouched (even with --private-dev)
.br
.br
Example:
.br
$ firejail --keep-dev-shm --private-dev
.TP
\fB\-\-keep-fd=all
Inherit all open file descriptors to the sandbox. By default only file descriptors 0, 1 and 2 are inherited to the sandbox, and all other file descriptors are closed.
.br
.br
Example:
.br
$ firejail --keep-fd=all
.TP
\fB\-\-keep-fd=file_descriptor
Don't close specified open file descriptors. By default only file descriptors 0, 1 and 2 are inherited to the sandbox, and all other file descriptors are closed.
.br
.br
Example:
.br
$ firejail --keep-fd=3,4,5
.TP
\fB\-\-keep-var-tmp
/var/tmp directory is untouched.
.br
.br
Example:
.br
$ firejail --keep-var-tmp
.TP
\fB\-\-list
List all sandboxes, see \fBMONITORING\fR section for more details.
.br
.br
Example:
.br
$ firejail \-\-list
.br
7015:netblue:browser:firejail firefox
#ifdef HAVE_NETWORK
.br
7056:netblue:torrent:firejail \-\-net=eth0 transmission-gtk
#endif
#ifdef HAVE_USERNS
.br
7064:netblue::firejail \-\-noroot xterm
.br
#endif
#ifdef HAVE_FILE_TRANSFER
.TP
\fB\-\-ls=name|pid dir_or_filename
List files in sandbox container, see \fBFILE TRANSFER\fR section for more details.
#endif
#ifdef HAVE_NETWORK
.TP
\fB\-\-mac=address
Assign MAC addresses to the last network interface defined by a \-\-net option. This option
is not supported for wireless interfaces.
.br
.br
Example:
.br
$ firejail \-\-net=eth0 \-\-mac=00:11:22:33:44:55 firefox
#endif
.TP
\fB\-\-machine-id
Spoof id number in /etc/machine-id file - a new random id is generated inside the sandbox.
Note that this breaks audio support. Enable it when sound is not required.
.br
.br
Example:
.br
$ firejail \-\-machine-id
.TP
\fB\-\-mkdir=dirname
Create a directory in user home. Parent directories are created as needed.
.br
.br
Example:
.br
$ firejail --mkdir=~/work/project
.TP
\fB\-\-mkfile=filename
Create an empty file in user home.
.br
.br
Example:
.br
$ firejail --mkfile=~/work/project/readme
.TP
\fB\-\-memory-deny-write-execute
Install a seccomp filter to block attempts to create memory mappings
that are both writable and executable, to change mappings to be
executable, or to create executable shared memory. The filter examines
the arguments of mmap, mmap2, mprotect, pkey_mprotect, memfd_create
and shmat system calls and returns error EPERM to the process (or
kills it or log the attempt, see \-\-seccomp-error-action below) if necessary.
.br
.br
Note: shmat is not implemented
as a system call on some platforms including i386, and it cannot be
handled by seccomp-bpf.
#ifdef HAVE_NETWORK
.TP
\fB\-\-mtu=number
Assign a MTU value to the last network interface defined by a \-\-net option.
.br
.br
Example:
.br
$ firejail \-\-net=eth0 \-\-mtu=1492
#endif
.TP
\fB\-\-name=name
Set sandbox name. Several options, such as \-\-join and \-\-shutdown, can use
this name to identify a sandbox.
In case the name supplied by the user is already in use by another sandbox, Firejail will assign a
new name as "name-PID", where PID is the process ID of the sandbox. This functionality
can be disabled at run time in /etc/firejail/firejail.config file, by setting "name-change" flag to "no".
.br
.br
Example:
.br
$ firejail \-\-name=browser firefox &
.br
$ firejail \-\-name=browser \-\-private \
firefox \-\-no-remote &
.br
$ firejail --list
.br
1198:netblue:browser:firejail --name=browser firefox
.br
1312:netblue:browser-1312:firejail --name=browser --private firefox --no-remote
.br
#ifdef HAVE_NETWORK
.TP
\fB\-\-net=bridge_interface
Enable a new network namespace and connect it to this bridge interface.
Unless specified with option \-\-ip and \-\-defaultgw, an IP address and a default gateway will be assigned
automatically to the sandbox. The IP address is verified using ARP before assignment. The address
configured as default gateway is the bridge device IP address. Up to four \-\-net
options can be specified.
.br
.br
Example:
.br
$ sudo brctl addbr br0
.br
$ sudo ifconfig br0 10.10.20.1/24
.br
$ sudo brctl addbr br1
.br
$ sudo ifconfig br1 10.10.30.1/24
.br
$ firejail \-\-net=br0 \-\-net=br1
.TP
\fB\-\-net=ethernet_interface|wireless_interface
Enable a new network namespace and connect it
to this ethernet interface using the standard Linux macvlan|ipvlan
driver. Unless specified with option \-\-ip and \-\-defaultgw, an
IP address and a default gateway will be assigned automatically
to the sandbox. The IP address is verified using ARP before
assignment. The address configured as default gateway is the
default gateway of the host. Up to four \-\-net options can be specified.
Support for ipvlan driver was introduced in Linux kernel 3.19.
.br
.br
Example:
.br
$ firejail \-\-net=eth0 \-\-ip=192.168.1.80 \-\-dns=8.8.8.8 firefox
.br
$ firejail \-\-net=wlan0 firefox
#endif
.TP
\fB\-\-net=none
Enable a new, unconnected network namespace. The only interface
available in the new namespace is a new loopback interface (lo).
Use this option to deny
network access to programs that don't really need network access.
.br
.br
Example:
.br
$ firejail \-\-net=none vlc
.br
.br
Note: \-\-net=none can crash the application on some platforms.
In these cases, it can be replaced with \-\-protocol=unix.
#ifdef HAVE_NETWORK
.TP
\fB\-\-net=tap_interface
Enable a new network namespace and connect it
to this ethernet tap interface using the standard Linux macvlan
driver. If the tap interface is not configured, the sandbox
will not try to configure the interface inside the sandbox.
Please use \-\-ip, \-\-netmask and \-\-defaultgw to specify the configuration.
.br
.br
Example:
.br
$ firejail \-\-net=tap0 \-\-ip=10.10.20.80 \-\-netmask=255.255.255.0 \-\-defaultgw=10.10.20.1 firefox
.TP
\fB\-\-net.print=name|pid
If a new network namespace is enabled, print network interface configuration for the sandbox specified by name or PID. Example:
.br
.br
$ firejail --net.print=browser
.br
Switching to pid 1853, the first child process inside the sandbox
.br
Interface MAC IP Mask Status
.br
lo 127.0.0.1 255.0.0.0 UP
.br
eth0-1852 5e:fb:8e:27:29:26 192.168.1.186 255.255.255.0 UP
.br
.TP
\fB\-\-netfilter
Enable a default firewall if a new network namespace is created inside the sandbox.
This option has no effect for sandboxes using the system network namespace.
.br
.br
The default firewall is optimized for regular desktop applications. No incoming
connections are accepted:
.br
.br
*filter
.br
:INPUT DROP [0:0]
.br
:FORWARD DROP [0:0]
.br
:OUTPUT ACCEPT [0:0]
.br
\-A INPUT \-i lo \-j ACCEPT
.br
\-A INPUT \-m state \-\-state RELATED,ESTABLISHED \-j ACCEPT
.br
# allow ping
.br
\-A INPUT \-p icmp \-\-icmp-type destination-unreachable \-j ACCEPT
.br
\-A INPUT \-p icmp \-\-icmp-type time-exceeded \-j ACCEPT
.br
\-A INPUT \-p icmp \-\-icmp-type echo-request \-j ACCEPT
.br
# drop STUN (WebRTC) requests
.br
-A OUTPUT -p udp --dport 3478 -j DROP
.br
-A OUTPUT -p udp --dport 3479 -j DROP
.br
-A OUTPUT -p tcp --dport 3478 -j DROP
.br
-A OUTPUT -p tcp --dport 3479 -j DROP
.br
COMMIT
.br
.br
Example:
.br
$ firejail \-\-net=eth0 \-\-netfilter firefox
.TP
\fB\-\-netfilter=filename
Enable the firewall specified by filename if a new network namespace is created inside the sandbox.
This option has no effect for sandboxes using the system network namespace.
.br
.br
Please use the regular iptables-save/iptables-restore format for the filter file. The following
examples are available in /etc/firejail directory:
.br
.br
.B webserver.net
is a webserver firewall that allows access only to TCP ports 80 and 443.
Example:
.br
.br
$ firejail --netfilter=/etc/firejail/webserver.net --net=eth0 \\
.br
/etc/init.d/apache2 start
.br
.br
.B nolocal.net/nolocal6.net
is a desktop client firewall that disable access to local network. Example:
.br
.br
$ firejail --netfilter=/etc/firejail/nolocal.net \\
.br
--net=eth0 firefox
.TP
\fB\-\-netfilter=filename,arg1,arg2,arg3 ...
This is the template version of the previous command. $ARG1, $ARG2, $ARG3 ... in the firewall script
are replaced with arg1, arg2, arg3 ... passed on the command line. Up to 16 arguments are supported.
Example:
.br
.br
$ firejail --net=eth0 --ip=192.168.1.105 \\
.br
--netfilter=/etc/firejail/tcpserver.net,5001 server-program
.br
.TP
\fB\-\-netfilter.print=name|pid
Print the firewall installed in the sandbox specified by name or PID. Example:
.br
.br
$ firejail --name=browser --net=eth0 --netfilter firefox &
.br
$ firejail --netfilter.print=browser
.TP
\fB\-\-netfilter6=filename
Enable the IPv6 firewall specified by filename if a new network namespace is created inside the sandbox.
This option has no effect for sandboxes using the system network namespace.
Please use the regular iptables-save/iptables-restore format for the filter file.
.TP
\fB\-\-netfilter6.print=name|pid
Print the IPv6 firewall installed in the sandbox specified by name or PID. Example:
.br
.br
$ firejail --name=browser --net=eth0 --netfilter firefox &
.br
$ firejail --netfilter6.print=browser
.TP
\fB\-\-netlock
Several type of programs (email clients, multiplayer games etc.) talk to a very small
number of IP addresses. But the best example is tor browser. It only talks to a guard node,
and there are two or three more on standby in case the main one fails.
During startup, the browser contacts all of them, after that it keeps talking to the main
one... for weeks!
Use the network locking feature to build and deploy a custom network firewall in your sandbox.
The firewall allows only the traffic to the IP addresses detected during the program
startup. Traffic to any other address is quietly dropped. By default the network monitoring
time is one minute.
A network namespace (\-\-net=eth0) is required for this feature to work. Example:
.br
.br
$ firejail --net=eth0 --netlock \\
.br
--private=~/tor-browser_en-US ./start-tor-browser.desktop
.br
.br
.TP
\fB\-\-netmask=address
Use this option when you want to assign an IP address in a new namespace and
the parent interface specified by --net is not configured. An IP address and
a default gateway address also have to be added. By default the new namespace
interface comes without IP address and default gateway configured. Example:
.br
.br
$ sudo /sbin/brctl addbr br0
.br
$ sudo /sbin/ifconfig br0 up
.br
$ firejail --ip=10.10.20.67 --netmask=255.255.255.0 --defaultgw=10.10.20.1
.TP
\fB\-\-netns=name
Run the program in a named, persistent network namespace. These can
be created and configured using "ip netns".
.TP
\fB\-\-netstats
Monitor network namespace statistics, see \fBMONITORING\fR section for more details.
.br
.br
Example:
.br
.br
$ firejail \-\-netstats
.br
PID User RX(KB/s) TX(KB/s) Command
.br
1294 netblue 53.355 1.473 firejail \-\-net=eth0 firefox
.br
7383 netblue 9.045 0.112 firejail \-\-net=eth0 transmission
.TP
\fB\-\-nettrace[=name|pid]
Monitor TCP and UDP traffic coming into the sandbox specified by name or pid. Only networked sandboxes
created with \-\-net are supported.
.br
.br
Without a name/pid, Firejail will monitor the main system network namespace.
.br
.br
$ firejail --nettrace=browser
.br
.br
95 KB/s geoip 457, IP database 4436
.br
52 KB/s *********** 64.222.84.207:443 United States
.br
33 KB/s ******* 89.147.74.105:63930 Hungary
.br
0 B/s 45.90.28.0:443 NextDNS
.br
0 B/s 94.70.122.176:52309(UDP) Greece
.br
339 B/s 104.26.7.35:443 Cloudflare
.br
.br
If /usr/bin/geoiplookup is installed (geoip-bin package in Debian),
the country the IP address originates from is added to the trace.
We also use the static IP map in /etc/firejail/hostnames
to print the domain names for some of the more common websites and cloud platforms.
No external services are contacted for reverse IP lookup.
#endif
.TP
\fB\-\-nice=value
Set nice value for all processes running inside the sandbox.
Only root may specify a negative value.
.br
.br
Example:
.br
$ firejail --nice=2 firefox
.TP
\fB\-\-no3d
Disable 3D hardware acceleration.
.br
.br
Example:
.br
$ firejail --no3d firefox
.TP
\fB\-\-noautopulse \fR(deprecated)
See --keep-config-pulse.
.TP
\fB\-\-noblacklist=dirname_or_filename
Disable blacklist for this directory or file.
.br
.br
Example:
.br
$ firejail
.br
$ nc dict.org 2628
.br
bash: /bin/nc: Permission denied
.br
$ exit
.br
.br
$ firejail --noblacklist=/bin/nc
.br
$ nc dict.org 2628
.br
220 pan.alephnull.com dictd 1.12.1/rf on Linux 3.14-1-amd64
.br
.TP
\fB\-\-nodbus \fR(deprecated)
#ifdef HAVE_DBUSPROXY
Disable D-Bus access (both system and session buses). Equivalent to --dbus-system=none --dbus-user=none.
.br
.br
Example:
.br
$ firejail \-\-nodbus \-\-net=none
#endif
.TP
\fB\-\-nodvd
Disable DVD and audio CD devices.
.br
.br
Example:
.br
$ firejail \-\-nodvd
.TP
\fB\-\-noinput
Disable input devices.
.br
.br
Example:
.br
$ firejail \-\-noinput
.TP
\fB\-\-noexec=dirname_or_filename
Remount directory or file noexec, nodev and nosuid. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
.br
.br
Example:
.br
$ firejail \-\-noexec=/tmp
.br
.br
/etc and /var are noexec by default if the sandbox was started as a regular user.
.TP
\fB\-\-nogroups
Disable supplementary groups. Without this option, supplementary groups are enabled for the user starting the
sandbox. For root user supplementary groups are always disabled.
.br
.br
Note: By default all regular user groups are removed with the exception of the current user. This can be changed
using \-\-allusers command option.
.br
.br
Example:
.br
$ id
.br
uid=1000(netblue) gid=1000(netblue) groups=1000(netblue),24(cdrom),25(floppy),27(sudo),29(audio)
.br
$ firejail \-\-nogroups
.br
Parent pid 8704, child pid 8705
.br
Child process initialized
.br
$ id
.br
uid=1000(netblue) gid=1000(netblue) groups=1000(netblue)
.br
$
.TP
\fB\-\-nonewprivs
Sets the NO_NEW_PRIVS prctl. This ensures that child processes
cannot acquire new privileges using execve(2); in particular,
this means that calling a suid binary (or one with file capabilities)
does not result in an increase of privilege. This option
is enabled by default if seccomp filter is activated.
.TP
\fB\-\-noprinters
Disable printers.
.TP
\fB\-\-noprofile
Do not use a security profile.
.br
.br
Example:
.br
$ firejail
.br
Reading profile /etc/firejail/default.profile
.br
Parent pid 8553, child pid 8554
.br
Child process initialized
.br
[...]
.br
.br
$ firejail \-\-noprofile
.br
Parent pid 8553, child pid 8554
.br
Child process initialized
.br
[...]
#ifdef HAVE_USERNS
.TP
\fB\-\-noroot
Install a user namespace with a single user - the current user.
root user does not exist in the new namespace. This option
requires a Linux kernel version 3.8 or newer. The option
is not supported for \-\-chroot and \-\-overlay configurations,
or for sandboxes started as root.
.br
.br
Example:
.br
$ firejail \-\-noroot
.br
Parent pid 8553, child pid 8554
.br
Child process initialized
.br
$ ping google.com
.br
ping: icmp open socket: Operation not permitted
.br
$
#endif
.TP
\fB\-\-nosound
Disable sound system.
.br
.br
Example:
.br
$ firejail \-\-nosound firefox
.TP
\fB\-\-notv
Disable DVB (Digital Video Broadcasting) TV devices.
.br
.br
Example:
.br
$ firejail \-\-notv vlc
.TP
\fB\-\-nou2f
Disable U2F devices.
.br
.br
Example:
.br
$ firejail \-\-nou2f
.TP
\fB\-\-novideo
Disable video devices.
.br
.TP
\fB\-\-nowhitelist=dirname_or_filename
Disable whitelist for this directory or file.
#ifdef HAVE_OUTPUT
.TP
\fB\-\-output=logfile
stdout logging and log rotation. Copy stdout to logfile, and keep the size of the file under 500KB using log
rotation. Five files with prefixes .1 to .5 are used in rotation.
.br
.br
Example:
.br
$ firejail \-\-output=sandboxlog /bin/bash
.br
[...]
.br
$ ls -l sandboxlog*
.br
-rw-r--r-- 1 netblue netblue 333890 Jun 2 07:48 sandboxlog
.br
-rw-r--r-- 1 netblue netblue 511488 Jun 2 07:48 sandboxlog.1
.br
-rw-r--r-- 1 netblue netblue 511488 Jun 2 07:48 sandboxlog.2
.br
-rw-r--r-- 1 netblue netblue 511488 Jun 2 07:48 sandboxlog.3
.br
-rw-r--r-- 1 netblue netblue 511488 Jun 2 07:48 sandboxlog.4
.br
-rw-r--r-- 1 netblue netblue 511488 Jun 2 07:48 sandboxlog.5
.TP
\fB\-\-output-stderr=logfile
Similar to \-\-output, but stderr is also stored.
#endif
#ifdef HAVE_OVERLAYFS
.TP
\fB\-\-overlay
Mount a filesystem overlay on top of the current filesystem. Unlike the regular filesystem container,
the system directories are mounted read-write. All filesystem modifications go into the overlay.
Directories /run, /tmp and /dev are not covered by the overlay. The overlay is stored in $HOME/.firejail/<PID> directory.
If the sandbox is started as a regular user, nonewprivs and a default capabilities filter are enabled.
.br
.br
OverlayFS support is required in Linux kernel for this option to work.
OverlayFS was officially introduced in Linux kernel version 3.18.
This option is not available on Grsecurity systems.
.br
.br
Example:
.br
$ firejail \-\-overlay firefox
.TP
\fB\-\-overlay-clean
Clean all overlays stored in $HOME/.firejail directory.
.br
.br
Example:
.br
$ firejail \-\-overlay-clean
.TP
\fB\-\-overlay-named=name
Mount a filesystem overlay on top of the current filesystem. Unlike the regular filesystem container,
the system directories are mounted read-write. All filesystem modifications go into the overlay.
Directories /run, /tmp and /dev are not covered by the overlay. The overlay is stored in $HOME/.firejail/<NAME> directory.
The created overlay can be reused between multiple sessions.
If the sandbox is started as a regular user, nonewprivs and a default capabilities filter are enabled.
.br
.br
OverlayFS support is required in Linux kernel for this option to work.
OverlayFS was officially introduced in Linux kernel version 3.18.
This option is not available on Grsecurity systems.
.br
.br
Example:
.br
$ firejail \-\-overlay-named=jail1 firefox
.TP
\fB\-\-overlay-tmpfs
Mount a filesystem overlay on top of the current filesystem. All filesystem modifications
are discarded when the sandbox is closed. Directories /run, /tmp and /dev are not covered by the overlay.
If the sandbox is started as a regular user, nonewprivs and a default capabilities filter are enabled.
.br
.br
OverlayFS support is required in Linux kernel for this option to work.
OverlayFS was officially introduced in Linux kernel version 3.18.
This option is not available on Grsecurity systems.
.br
.br
Example:
.br
$ firejail \-\-overlay-tmpfs firefox
#endif
.TP
\fB\-\-private
Mount new /root and /home/user directories in temporary
filesystems. All modifications are discarded when the sandbox is
closed.
.br
.br
Example:
.br
$ firejail \-\-private firefox
.TP
\fB\-\-private=directory
Use directory as user home.
--private and --private=directory cannot be used together.
.br
.br
Example:
.br
$ firejail \-\-private=/home/netblue/firefox-home firefox
.TP
\fB\-\-private-bin=file,file
Build a new /bin in a temporary filesystem, and copy the programs in the list.
The files in the list must be expressed as relative to the /bin,
/sbin, /usr/bin, /usr/sbin, or /usr/local/bin directories.
If no listed files are found, /bin directory will be empty.
The same directory is also bind-mounted over /sbin, /usr/bin, /usr/sbin and /usr/local/bin.
All modifications are discarded when the sandbox is closed.
Multiple private-bin commands are allowed and they accumulate.
File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
.br
.br
Example:
.br
$ firejail \-\-private-bin=bash,sed,ls,cat
.br
Parent pid 20841, child pid 20842
.br
Child process initialized
.br
$ ls /bin
.br
bash cat ls sed
.TP
\fB\-\-private-cache
Mount an empty temporary filesystem on top of the .cache directory in user home. All
modifications are discarded when the sandbox is closed.
.br
.br
Example:
.br
$ firejail \-\-private-cache openbox
.TP
\fB\-\-private-cwd
Set working directory inside jail to the home directory, and failing that, the root directory.
Does not impact working directory of profile include paths.
.br
.br
Example:
.br
$ pwd
.br
/tmp
.br
$ firejail \-\-private-cwd
.br
$ pwd
.br
/home/user
.br
.TP
\fB\-\-private-cwd=directory
Set working directory inside the jail.
Full directory path is required. Symbolic links are not allowed.
Does not impact working directory of profile include paths.
.br
.br
Example:
.br
$ pwd
.br
/tmp
.br
$ firejail \-\-private-cwd=/opt
.br
$ pwd
.br
/opt
.br
.TP
\fB\-\-private-dev
Create a new /dev directory. Only disc, dri, dvb, hidraw, null, full, zero, tty, pts, ptmx, random, snd, urandom, video, log, shm and usb devices are available.
Use the options --no3d, --nodvd, --nosound, --notv, --nou2f and --novideo for additional restrictions.
.br
.br
Example:
.br
$ firejail \-\-private-dev
.br
Parent pid 9887, child pid 9888
.br
Child process initialized
.br
$ ls /dev
.br
cdrom cdrw dri dvd dvdrw full log null ptmx pts random shm snd sr0 tty urandom zero
.br
$
.TP
\fB\-\-private-etc=file,directory
Build a new /etc in a temporary
filesystem, and copy the files and directories in the list.
The files and directories in the list must be expressed as relative to
the /etc directory (e.g., /etc/foo must be expressed as foo).
If no listed file is found, /etc directory will be empty.
All modifications are discarded when the sandbox is closed.
Multiple private-etc commands are allowed and they accumulate.
.br
.br
Example:
.br
$ firejail --private-etc=group,hostname,localtime, \\
.br
nsswitch.conf,passwd,resolv.conf
#ifdef HAVE_PRIVATE_HOME
.TP
\fB\-\-private-home=file,directory
Build a new user home in a temporary
filesystem, and copy the files and directories in the list in the
new home.
The files and directories in the list must be expressed as relative to
the current user's home directory.
All modifications are discarded when the sandbox is
closed.
.br
.br
Example:
.br
$ firejail \-\-private-home=.mozilla firefox
#endif
.TP
\fB\-\-private-lib=file,directory
This feature is currently under heavy development. Only amd64 platforms are supported at this moment.
The files and directories in the list must be expressed as relative to
the /lib directory.
The idea is to build a new /lib in a temporary filesystem,
with only the library files necessary to run the application.
It could be as simple as:
.br
.br
$ firejail --private-lib galculator
.br
.br
but it gets complicated really fast:
.br
.br
$ firejail --private-lib=x86_64-linux-gnu/xed,x86_64-linux-gnu/gdk-pixbuf-2.0,libenchant.so.1,librsvg-2.so.2 xed
.br
.br
The feature is integrated with \-\-private-bin:
.br
.br
$ firejail --private-lib --private-bin=bash,ls,ps
.br
$ ls /lib
.br
ld-linux-x86-64.so.2 libgpg-error.so.0 libprocps.so.6 libsystemd.so.0
.br
libc.so.6 liblz4.so.1 libpthread.so.0 libtinfo.so.5
.br
libdl.so.2 liblzma.so.5 librt.so.1 x86_64-linux-gnu
.br
libgcrypt.so.20 libpcre.so.3 libselinux.so.1
.br
$ ps
.br
PID TTY TIME CMD
.br
1 pts/0 00:00:00 firejail
.br
45 pts/0 00:00:00 bash
.br
48 pts/0 00:00:00 ps
.br
$
.br
.TP
\fB\-\-private-opt=file,directory
Build a new /opt in a temporary
filesystem, and copy the files and directories in the list.
The files and directories in the list must be expressed as relative to
the /opt directory, and must not contain the / character
(e.g., /opt/foo must be expressed as foo, but /opt/foo/bar --
expressed as foo/bar -- is disallowed).
If no listed file is found, /opt directory will be empty.
All modifications are discarded when the sandbox is closed.
.br
.br
Example:
.br
$ firejail --private-opt=firefox /opt/firefox/firefox
.TP
\fB\-\-private-srv=file,directory
Build a new /srv in a temporary
filesystem, and copy the files and directories in the list.
The files and directories in the list must be expressed as relative to
the /srv directory, and must not contain the / character
(e.g., /srv/foo must be expressed as foo, but /srv/foo/bar --
expressed as srv/bar -- is disallowed).
If no listed file is found, /srv directory will be empty.
All modifications are discarded when the sandbox is closed.
.br
.br
Example:
.br
# firejail --private-srv=www /etc/init.d/apache2 start
.TP
\fB\-\-private-tmp
Mount an empty temporary filesystem on top of /tmp directory whitelisting X11 and PulseAudio sockets.
.br
.br
Example:
.br
$ firejail \-\-private-tmp
.br
$ ls -al /tmp
.br
drwxrwxrwt 4 nobody nogroup 80 Apr 30 11:46 .
.br
drwxr-xr-x 30 nobody nogroup 4096 Apr 26 22:18 ..
.br
drwx------ 2 nobody nogroup 4096 Apr 30 10:52 pulse-PKdhtXMmr18n
.br
drwxrwxrwt 2 nobody nogroup 4096 Apr 30 10:52 .X11-unix
.br
.TP
\fB\-\-profile=filename_or_profilename
Load a custom security profile from filename. For filename use an absolute path or a path relative to the current path.
For more information, see \fBSECURITY PROFILES\fR section below.
.br
.br
Example:
.br
$ firejail \-\-profile=myprofile
.TP
\fB\-\-profile.print=name|pid
Print the name of the profile file for the sandbox identified by name or or PID.
.br
.br
Example:
.br
$ firejail \-\-profile.print=browser
.br
/etc/firejail/firefox.profile
.br
.TP
\fB\-\-protocol=protocol,protocol,protocol
Enable protocol filter. The filter is based on seccomp and checks the first argument to socket system call.
Recognized values: unix, inet, inet6, netlink, packet, and bluetooth. This option is not supported for i386 architecture.
.br
.br
Example:
.br
$ firejail \-\-protocol=unix,inet,inet6 firefox
.TP
\fB\-\-protocol.print=name|pid
Print the protocol filter for the sandbox identified by name or PID.
.br
.br
Example:
.br
$ firejail \-\-name=mybrowser firefox &
.br
$ firejail \-\-protocol.print=mybrowser
.br
unix,inet,inet6,netlink
.br
.br
Example:
.br
$ firejail \-\-list
.br
3272:netblue::firejail \-\-private firefox
.br
$ firejail \-\-protocol.print=3272
.br
unix,inet,inet6,netlink
#ifdef HAVE_FILE_TRANSFER
.TP
\fB\-\-put=name|pid src-filename dest-filename
Put a file in sandbox container, see \fBFILE TRANSFER\fR section for more details.
#endif
.TP
\fB\-\-quiet
Turn off Firejail's output.
.br
.br
The same effect can be obtained by setting an environment variable FIREJAIL_QUIET to yes.
.TP
\fB\-\-read-only=dirname_or_filename
Set directory or file read-only. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
.br
.br
Example:
.br
$ firejail \-\-read-only=~/.mozilla firefox
.br
.TP
\fB\-\-read-write=dirname_or_filename
Set directory or file read-write. Only files or directories belonging to the current user are allowed for
this operation. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
Example:
.br
.br
$ mkdir ~/test
.br
$ touch ~/test/a
.br
$ firejail --read-only=~/test --read-write=~/test/a
.TP
\fB\-\-rlimit-as=number
Set the maximum size of the process's virtual memory (address space) in bytes.
Use k(ilobyte), m(egabyte) or g(igabyte) for size suffix (base 1024).
.TP
\fB\-\-rlimit-cpu=number
Set the maximum limit, in seconds, for the amount of CPU time each
sandboxed process can consume. When the limit is reached, the processes are killed.
The CPU limit is a limit on CPU seconds rather than elapsed time. CPU seconds is basically how many seconds
the CPU has been in use and does not necessarily directly relate to the elapsed time. Linux kernel keeps
track of CPU seconds for each process independently.
.TP
\fB\-\-rlimit-fsize=number
Set the maximum file size that can be created by a process.
Use k(ilobyte), m(egabyte) or g(igabyte) for size suffix (base 1024).
.TP
\fB\-\-rlimit-nofile=number
Set the maximum number of files that can be opened by a process.
.TP
\fB\-\-rlimit-nproc=number
Set the maximum number of processes that can be created for the real user ID of the calling process.
.TP
\fB\-\-rlimit-sigpending=number
Set the maximum number of pending signals for a process.
.TP
\fB\-\-rmenv=name
Remove environment variable in the new sandbox.
.br
.br
Example:
.br
$ firejail \-\-rmenv=DBUS_SESSION_BUS_ADDRESS
#ifdef HAVE_NETWORK
.TP
\fB\-\-scan
ARP-scan all the networks from inside a network namespace.
This makes it possible to detect macvlan kernel device drivers running on the current host.
.br
.br
Example:
.br
$ firejail \-\-net=eth0 \-\-scan
#endif
.TP
\fB\-\-seccomp
Enable seccomp filter and blacklist the syscalls in the default list,
which is @default-nodebuggers unless \-\-allow-debuggers is specified,
then it is @default.
.br
To help creating useful seccomp filters more easily, the following
system call groups are defined: @aio, @basic-io, @chown, @clock,
@cpu-emulation, @debug, @default, @default-nodebuggers, @default-keep,
@file-system, @io-event, @ipc, @keyring, @memlock, @module, @mount,
@network-io, @obsolete, @privileged, @process, @raw-io, @reboot,
@resources, @setuid, @swap, @sync, @system-service and @timer.
More information about groups can be found in /usr/share/doc/firejail/syscalls.txt
.br
.br
The default list can be customized, see \-\-seccomp= for a description.
It can be customized also globally in /etc/firejail/firejail.config file.
.br
.br
System architecture is strictly imposed only if flag
\-\-seccomp.block-secondary is used. The filter is applied at run time
only if the correct architecture was detected. For the case of I386
and AMD64 both 32-bit and 64-bit filters are installed.
.br
.br
Firejail will print seccomp violations to the audit log if the kernel was compiled with audit support (CONFIG_AUDIT flag).
.br
.br
Example:
.br
$ firejail \-\-seccomp
.TP
\fB\-\-seccomp=syscall,@group,!syscall2
Enable seccomp filter, blacklist the default list and the syscalls or syscall groups
specified by the command, but don't blacklist "syscall2". On a 64 bit
architecture, an additional filter for 32 bit system calls can be
installed with \-\-seccomp.32.
.br
.br
Example:
.br
$ firejail \-\-seccomp=utime,utimensat,utimes firefox
.br
$ firejail \-\-seccomp=@clock,mkdir,unlinkat transmission-gtk
.br
$ firejail '\-\-seccomp=@ipc,!pipe,!pipe2' audacious
.br
.br
Syscalls can be specified by their number if prefix $ is added,
so for example $165 would be equal to mount on i386.
.br
.br
Instead of dropping the syscall by returning EPERM, another error
number can be returned using \fBsyscall:errno\fR syntax. This can be
also changed globally with \-\-seccomp-error-action or
in /etc/firejail/firejail.config file. The process can also be killed
by using \fBsyscall:kill\fR syntax, or the attempt may be logged with
\fBsyscall:log\fR.
.br
.br
Example:
.br
$ firejail \-\-seccomp=unlinkat:ENOENT,utimensat,utimes
.br
Parent pid 10662, child pid 10663
.br
Child process initialized
.br
$ touch testfile
.br
$ ls testfile
.br
testfile
.br
$ rm testfile
.br
rm: cannot remove `testfile': No such file or directory
.br
.br
If the blocked system calls would also block Firejail from operating,
they are handled by adding a preloaded library which performs seccomp
system calls later. However, this is incompatible with 32 bit seccomp
filters.
.br
.br
Example:
.br
$ firejail \-\-noprofile \-\-shell=none \-\-seccomp=execve sh
.br
Parent pid 32751, child pid 32752
.br
Post-exec seccomp protector enabled
.br
list in: execve, check list: @default-keep prelist: (null), postlist: execve
.br
Child process initialized in 46.44 ms
.br
$ ls
.br
Operation not permitted
.TP
\fB\-\-seccomp.block-secondary
Enable seccomp filter and filter system call architectures so that
only the native architecture is allowed. For example, on amd64, i386
and x32 system calls are blocked as well as changing the execution
domain with personality(2) system call.
.br
.TP
\fB\-\-seccomp.drop=syscall,@group
Enable seccomp filter, and blacklist the syscalls or the syscall
groups specified by the command. On a 64 bit architecture, an
additional filter for 32 bit system calls can be installed with
\-\-seccomp.32.drop.
.br
.br
Example:
.br
$ firejail \-\-seccomp.drop=utime,utimensat,utimes,@clock
.br
.br
Instead of dropping the syscall by returning EPERM, another error
number can be returned using \fBsyscall:errno\fR syntax. This can be
also changed globally with \-\-seccomp-error-action or
in /etc/firejail/firejail.config file. The process can also be killed
by using \fBsyscall:kill\fR syntax, or the attempt may be logged with
\fBsyscall:log\fR.
.br
.br
Example:
.br
$ firejail \-\-seccomp.drop=unlinkat:ENOENT,utimensat,utimes
.br
Parent pid 10662, child pid 10663
.br
Child process initialized
.br
$ touch testfile
.br
$ ls testfile
.br
testfile
.br
$ rm testfile
.br
rm: cannot remove `testfile': No such file or directory
.br
.TP
\fB\-\-seccomp.keep=syscall,@group,!syscall2
Enable seccomp filter, blacklist all syscall not listed and "syscall2".
The system calls needed by Firejail (group @default-keep: prctl, execve, execveat)
are handled with the preload library. On a 64 bit architecture, an
additional filter for 32 bit system calls can be installed with
\-\-seccomp.32.keep.
.br
.br
Example:
.br
$ firejail \-\-shell=none \-\-seccomp.keep=poll,select,[...] transmission-gtk
.TP
\fB\-\-seccomp.print=name|pid
Print the seccomp filter for the sandbox identified by name or PID.
.br
.br
Example:
.br
$ firejail \-\-name=browser firefox &
.br
$ firejail --seccomp.print=browser
.br
line OP JT JF K
.br
=================================
.br
0000: 20 00 00 00000004 ld data.architecture
.br
0001: 15 01 00 c000003e jeq ARCH_64 0003 (false 0002)
.br
0002: 06 00 00 7fff0000 ret ALLOW
.br
0003: 20 00 00 00000000 ld data.syscall-number
.br
0004: 35 01 00 40000000 jge X32_ABI true:0006 (false 0005)
.br
0005: 35 01 00 00000000 jge read 0007 (false 0006)
.br
0006: 06 00 00 00050001 ret ERRNO(1)
.br
0007: 15 41 00 0000009a jeq modify_ldt 0049 (false 0008)
.br
0008: 15 40 00 000000d4 jeq lookup_dcookie 0049 (false 0009)
.br
0009: 15 3f 00 0000012a jeq perf_event_open 0049 (false 000a)
.br
000a: 15 3e 00 00000137 jeq process_vm_writev 0049 (false 000b)
.br
000b: 15 3d 00 0000009c jeq _sysctl 0049 (false 000c)
.br
000c: 15 3c 00 000000b7 jeq afs_syscall 0049 (false 000d)
.br
000d: 15 3b 00 000000ae jeq create_module 0049 (false 000e)
.br
000e: 15 3a 00 000000b1 jeq get_kernel_syms 0049 (false 000f)
.br
000f: 15 39 00 000000b5 jeq getpmsg 0049 (false 0010)
.br
0010: 15 38 00 000000b6 jeq putpmsg 0049 (false 0011)
.br
0011: 15 37 00 000000b2 jeq query_module 0049 (false 0012)
.br
0012: 15 36 00 000000b9 jeq security 0049 (false 0013)
.br
0013: 15 35 00 0000008b jeq sysfs 0049 (false 0014)
.br
0014: 15 34 00 000000b8 jeq tuxcall 0049 (false 0015)
.br
0015: 15 33 00 00000086 jeq uselib 0049 (false 0016)
.br
0016: 15 32 00 00000088 jeq ustat 0049 (false 0017)
.br
0017: 15 31 00 000000ec jeq vserver 0049 (false 0018)
.br
0018: 15 30 00 0000009f jeq adjtimex 0049 (false 0019)
.br
0019: 15 2f 00 00000131 jeq clock_adjtime 0049 (false 001a)
.br
001a: 15 2e 00 000000e3 jeq clock_settime 0049 (false 001b)
.br
001b: 15 2d 00 000000a4 jeq settimeofday 0049 (false 001c)
.br
001c: 15 2c 00 000000b0 jeq delete_module 0049 (false 001d)
.br
001d: 15 2b 00 00000139 jeq finit_module 0049 (false 001e)
.br
001e: 15 2a 00 000000af jeq init_module 0049 (false 001f)
.br
001f: 15 29 00 000000ad jeq ioperm 0049 (false 0020)
.br
0020: 15 28 00 000000ac jeq iopl 0049 (false 0021)
.br
0021: 15 27 00 000000f6 jeq kexec_load 0049 (false 0022)
.br
0022: 15 26 00 00000140 jeq kexec_file_load 0049 (false 0023)
.br
0023: 15 25 00 000000a9 jeq reboot 0049 (false 0024)
.br
0024: 15 24 00 000000a7 jeq swapon 0049 (false 0025)
.br
0025: 15 23 00 000000a8 jeq swapoff 0049 (false 0026)
.br
0026: 15 22 00 000000a3 jeq acct 0049 (false 0027)
.br
0027: 15 21 00 00000141 jeq bpf 0049 (false 0028)
.br
0028: 15 20 00 000000a1 jeq chroot 0049 (false 0029)
.br
0029: 15 1f 00 000000a5 jeq mount 0049 (false 002a)
.br
002a: 15 1e 00 000000b4 jeq nfsservctl 0049 (false 002b)
.br
002b: 15 1d 00 0000009b jeq pivot_root 0049 (false 002c)
.br
002c: 15 1c 00 000000ab jeq setdomainname 0049 (false 002d)
.br
002d: 15 1b 00 000000aa jeq sethostname 0049 (false 002e)
.br
002e: 15 1a 00 000000a6 jeq umount2 0049 (false 002f)
.br
002f: 15 19 00 00000099 jeq vhangup 0049 (false 0030)
.br
0030: 15 18 00 000000ee jeq set_mempolicy 0049 (false 0031)
.br
0031: 15 17 00 00000100 jeq migrate_pages 0049 (false 0032)
.br
0032: 15 16 00 00000117 jeq move_pages 0049 (false 0033)
.br
0033: 15 15 00 000000ed jeq mbind 0049 (false 0034)
.br
0034: 15 14 00 00000130 jeq open_by_handle_at 0049 (false 0035)
.br
0035: 15 13 00 0000012f jeq name_to_handle_at 0049 (false 0036)
.br
0036: 15 12 00 000000fb jeq ioprio_set 0049 (false 0037)
.br
0037: 15 11 00 00000067 jeq syslog 0049 (false 0038)
.br
0038: 15 10 00 0000012c jeq fanotify_init 0049 (false 0039)
.br
0039: 15 0f 00 00000138 jeq kcmp 0049 (false 003a)
.br
003a: 15 0e 00 000000f8 jeq add_key 0049 (false 003b)
.br
003b: 15 0d 00 000000f9 jeq request_key 0049 (false 003c)
.br
003c: 15 0c 00 000000fa jeq keyctl 0049 (false 003d)
.br
003d: 15 0b 00 000000ce jeq io_setup 0049 (false 003e)
.br
003e: 15 0a 00 000000cf jeq io_destroy 0049 (false 003f)
.br
003f: 15 09 00 000000d0 jeq io_getevents 0049 (false 0040)
.br
0040: 15 08 00 000000d1 jeq io_submit 0049 (false 0041)
.br
0041: 15 07 00 000000d2 jeq io_cancel 0049 (false 0042)
.br
0042: 15 06 00 000000d8 jeq remap_file_pages 0049 (false 0043)
.br
0043: 15 05 00 00000116 jeq vmsplice 0049 (false 0044)
.br
0044: 15 04 00 00000087 jeq personality 0049 (false 0045)
.br
0045: 15 03 00 00000143 jeq userfaultfd 0049 (false 0046)
.br
0046: 15 02 00 00000065 jeq ptrace 0049 (false 0047)
.br
0047: 15 01 00 00000136 jeq process_vm_readv 0049 (false 0048)
.br
0048: 06 00 00 7fff0000 ret ALLOW
.br
0049: 06 00 01 00000000 ret KILL
.br
$
.TP
\fB\-\-seccomp-error-action= kill | ERRNO | log
By default, if a seccomp filter blocks a system call, the process gets
EPERM as the error. With \-\-seccomp-error-action=error, another error
number can be returned, for example ENOSYS or EACCES. The process can
also be killed (like in versions <0.9.63 of Firejail) by using
\-\-seccomp-error-action=kill syntax, or the attempt may be logged
with \-\-seccomp-error-action=log. Not killing the process weakens
Firejail slightly when trying to contain intrusion, but it may also
allow tighter filters if the only alternative is to allow a system
call.
.br
.TP
\fB\-\-shell=none
Run the program directly, without a user shell.
.br
.br
Example:
.br
$ firejail \-\-shell=none script.sh
.TP
\fB\-\-shell=program
Set default user shell. Use this shell to run the application using \-c shell option.
For example "firejail \-\-shell=/bin/dash firefox" will start Mozilla Firefox as "/bin/dash \-c firefox".
By default the user's preferred shell is used.
.br
.br
Example:
$firejail \-\-shell=/bin/dash script.sh
.TP
\fB\-\-shutdown=name|pid
Shutdown the sandbox identified by name or PID.
.br
.br
Example:
.br
$ firejail \-\-name=mygame \-\-caps.drop=all warzone2100 &
.br
$ firejail \-\-shutdown=mygame
.br
.br
Example:
.br
$ firejail \-\-list
.br
3272:netblue::firejail \-\-private firefox
.br
$ firejail \-\-shutdown=3272
.TP
\fB\-\-tab
Enable shell tab completion in sandboxes using private or whitelisted home directories.
.br
.br
$ firejail \-\-private --tab
.TP
\fB\-\-timeout=hh:mm:ss
Kill the sandbox automatically after the time has elapsed. The time is specified in hours/minutes/seconds format.
.br
.br
$ firejail \-\-timeout=01:30:00 firefox
.TP
\fB\-\-tmpfs=dirname
Mount a writable tmpfs filesystem on directory dirname. Directories outside user home or not owned by the user are not allowed. Sandboxes running as root are exempt from these restrictions. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
.br
.br
Example:
.br
$ firejail \-\-tmpfs=~/.local/share
.TP
\fB\-\-top
Monitor the most CPU-intensive sandboxes, see \fBMONITORING\fR section for more details.
.br
.br
Example:
.br
$ firejail \-\-top
.TP
\fB\-\-trace[=filename]
Trace open, access and connect system calls. If filename is specified, log
trace output to filename, otherwise log to console.
.br
.br
Example:
.br
$ firejail \-\-trace wget -q www.debian.org
.br
Reading profile /etc/firejail/wget.profile
.br
3:wget:fopen64 /etc/wgetrc:0x5c8e8ce6c0
.br
3:wget:fopen /etc/hosts:0x5c8e8cfb70
.br
3:wget:socket AF_INET SOCK_DGRAM IPPROTO_IP:3
.br
3:wget:connect 3 8.8.8.8 port 53:0
.br
3:wget:socket AF_INET SOCK_STREAM IPPROTO_IP:3
.br
3:wget:connect 3 130.89.148.14 port 80:0
.br
3:wget:fopen64 index.html:0x5c8e8d1a60
.br
.br
parent is shutting down, bye...
.TP
\fB\-\-tracelog
This option enables auditing blacklisted files and directories. A message
is sent to syslog in case the file or the directory is accessed.
.br
.br
Example:
.br
$ firejail --tracelog firefox
.br
.br
Sample messages:
.br
$ sudo tail -f /var/log/syslog
.br
[...]
.br
Dec 3 11:43:25 debian firejail[70]: blacklist violation - sandbox 26370, exe firefox, syscall open64, path /etc/shadow
.br
Dec 3 11:46:17 debian firejail[70]: blacklist violation - sandbox 26370, exe firefox, syscall opendir, path /boot
.br
[...]
.TP
\fB\-\-tree
Print a tree of all sandboxed processes, see \fBMONITORING\fR section for more details.
.br
.br
Example:
.br
$ firejail \-\-tree
.br
11903:netblue:firejail iceweasel
.br
11904:netblue:iceweasel
.br
11957:netblue:/usr/lib/iceweasel/plugin-container
#ifdef HAVE_NETWORK
.br
11969:netblue:firejail \-\-net=eth0 transmission-gtk
#endif
.br
11970:netblue:transmission-gtk
#ifdef HAVE_FIRETUNNEL
.TP
\fB\-\-tunnel[=devname]
Connect the sandbox to a network overlay/VPN tunnel created by firetunnel utility. This options
tries first the client side of the tunnel. If this fails, it tries the server side. If multiple tunnels are active,
please specify the tunnel device using \-\-tunnel=devname.
.br
.br
The available tunnel devices are listed in /etc/firetunnel directory, one file for each device.
The files are regular firejail profile files containing the network configuration,
and are created and managed by firetunnel utility.
By default ftc is the client-side device and fts is the server-side device. For more information
please see man 1 firetunnel.
.br
.br
Example:
.br
$ firejail --tunnel firefox
.br
#endif
.TP
\fB\-\-version
Print program version/compile time support and exit.
.br
.br
Example:
.br
$ firejail \-\-version
.br
firejail version 0.9.27
Compile time support:
- AppArmor support is enabled
- AppImage support is enabled
- chroot support is enabled
- file and directory whitelisting support is enabled
- file transfer support is enabled
- firetunnel support is enabled
- networking support is enabled
- overlayfs support is enabled
- private-home support is enabled
- seccomp-bpf support is enabled
- user namespace support is enabled
- X11 sandboxing support is enabled
.br
#ifdef HAVE_NETWORK
.TP
\fB\-\-veth-name=name
Use this name for the interface connected to the bridge for --net=bridge_interface commands,
instead of the default one.
.br
.br
Example:
.br
$ firejail \-\-net=br0 --veth-name=if0
#endif
.TP
\fB\-\-whitelist=dirname_or_filename
Whitelist directory or file. A temporary file system is mounted on the top directory, and the
whitelisted files are mount-binded inside. Modifications to whitelisted files are persistent,
everything else is discarded when the sandbox is closed. The top directory can be
all directories in / (except /proc and /sys), /sys/module, /run/user/$UID, $HOME and
all directories in /usr.
.br
.br
Symbolic link handling: with the exception of user home, both the link and the real file should be in
the same top directory. For user home, both the link and the real file should be owned by the user.
.br
.br
File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
.br
.br
Example:
.br
$ firejail \-\-noprofile \-\-whitelist=~/.mozilla
.br
$ firejail \-\-whitelist=/tmp/.X11-unix --whitelist=/dev/null
.br
$ firejail "\-\-whitelist=/home/username/My Virtual Machines"
.br
$ firejail \-\-whitelist=~/work* \-\-whitelist=/var/backups*
.TP
\fB\-\-writable-etc
Mount /etc directory read-write.
.br
.br
Example:
.br
$ sudo firejail --writable-etc
.TP
\fB\-\-writable-run-user
Disable the default blacklisting of /run/user/$UID/systemd and /run/user/$UID/gnupg.
.br
.br
Example:
.br
$ sudo firejail --writable-run-user
.TP
\fB\-\-writable-var
Mount /var directory read-write.
.br
.br
Example:
.br
$ sudo firejail --writable-var
.TP
\fB\-\-writable-var-log
Use the real /var/log directory, not a clone. By default, a tmpfs is mounted on top of /var/log
directory, and a skeleton filesystem is created based on the original /var/log.
.br
.br
Example:
.br
$ sudo firejail --writable-var-log
#ifdef HAVE_X11
.TP
\fB\-\-x11
Sandbox the application using Xpra, Xephyr, Xvfb or Xorg security extension.
The sandbox will prevent screenshot and keylogger applications started inside the sandbox from accessing
clients running outside the sandbox.
Firejail will try Xpra first, and if Xpra is not installed on the system, it will try to find Xephyr.
If all fails, Firejail will not attempt to use Xvfb or X11 security extension.
.br
.br
Xpra, Xephyr and Xvfb modes require a network namespace to be instantiated in order to disable
X11 abstract Unix socket. If this is not possible, the user can disable the abstract socket
by adding "-nolisten local" on Xorg command line at system level.
.br
.br
Example:
.br
$ firejail \-\-x11 --net=eth0 firefox
.TP
\fB\-\-x11=none
Blacklist /tmp/.X11-unix directory, ${HOME}/.Xauthority and the file specified in ${XAUTHORITY} environment variable.
Remove DISPLAY and XAUTHORITY environment variables.
Stop with error message if X11 abstract socket will be accessible in jail.
.TP
\fB\-\-x11=xephyr
Start Xephyr and attach the sandbox to this server.
Xephyr is a display server implementing the X11 display server protocol.
A network namespace needs to be instantiated in order to deny access to X11 abstract Unix domain socket.
.br
.br
Xephyr runs in a window just like any other X11 application. The default window size is 800x600.
This can be modified in /etc/firejail/firejail.config file.
.br
.br
The recommended way to use this feature is to run a window manager inside the sandbox.
A security profile for OpenBox is provided.
.br
.br
Xephyr is developed by Xorg project. On Debian platforms it is installed with the command \fBsudo apt-get install xserver-xephyr\fR.
This feature is not available when running as root.
.br
.br
Example:
.br
$ firejail \-\-x11=xephyr --net=eth0 openbox
.TP
\fB\-\-x11=xorg
Sandbox the application using the untrusted mode implemented by X11 security extension.
The extension is available in Xorg package
and it is installed by default on most Linux distributions. It provides support for a simple trusted/untrusted
connection model. Untrusted clients are restricted in certain ways to prevent them from reading window
contents of other clients, stealing input events, etc.
The untrusted mode has several limitations. A lot of regular programs assume they are a trusted X11 clients
and will crash or lock up when run in untrusted mode. Chromium browser and xterm are two examples.
Firefox and transmission-gtk seem to be working fine.
A network namespace is not required for this option.
.br
.br
Example:
.br
$ firejail \-\-x11=xorg firefox
.TP
\fB\-\-x11=xpra
Start Xpra (https://xpra.org) and attach the sandbox to this server.
Xpra is a persistent remote display server and client for forwarding X11 applications and desktop screens.
A network namespace needs to be instantiated in order to deny access to X11 abstract Unix domain socket.
.br
.br
On Debian platforms Xpra is installed with the command \fBsudo apt-get install xpra\fR.
This feature is not available when running as root.
.br
.br
Example:
.br
$ firejail \-\-x11=xpra --net=eth0 firefox
.TP
\fB\-\-x11=xvfb
Start Xvfb X11 server and attach the sandbox to this server.
Xvfb, short for X virtual framebuffer, performs all graphical operations in memory
without showing any screen output. Xvfb is mainly used for remote access and software
testing on headless servers.
.br
.br
On Debian platforms Xvfb is installed with the command \fBsudo apt-get install xvfb\fR.
This feature is not available when running as root.
.br
.br
Example: remote VNC access
.br
.br
On the server we start a sandbox using Xvfb and openbox
window manager. The default size of Xvfb screen is 800x600 - it can be changed
in /etc/firejail/firejail.config (xvfb-screen). Some sort of networking (--net) is required
in order to isolate the abstract sockets used by other X servers.
.br
.br
$ firejail --net=none --x11=xvfb openbox
.br
.br
*** Attaching to Xvfb display 792 ***
.br
.br
Reading profile /etc/firejail/openbox.profile
.br
Reading profile /etc/firejail/disable-common.inc
.br
Reading profile /etc/firejail/disable-common.local
.br
Parent pid 5400, child pid 5401
.br
.br
On the server we also start a VNC server and attach it to the display handled by our
Xvfb server (792).
.br
.br
$ x11vnc -display :792
.br
.br
On the client machine we start a VNC viewer and use it to connect to our server:
.br
.br
$ vncviewer
.br
.TP
\fB\-\-xephyr-screen=WIDTHxHEIGHT
Set screen size for --x11=xephyr. The setting will overwrite the default set in /etc/firejail/firejail.config
for the current sandbox. Run xrandr to get a list of supported resolutions on your computer.
.br
.br
Example:
.br
$ firejail --net=eth0 --x11=xephyr --xephyr-screen=640x480 firefox
.br
#endif
#ifdef HAVE_APPARMOR
.SH APPARMOR
.TP
AppArmor support is disabled by default at compile time. Use --enable-apparmor configuration option to enable it:
.br
.br
$ ./configure --prefix=/usr --enable-apparmor
.TP
During software install, a generic AppArmor profile file, firejail-default, is placed in /etc/apparmor.d directory. The local customizations must be placed in /etc/apparmor.d/local/firejail-local. The profile needs to be loaded into the kernel by reloading apparmor.service, rebooting the system or running the following command as root:
.br
.br
# apparmor_parser -r /etc/apparmor.d/firejail-default
.TP
The installed profile is supplemental for main firejail functions and among other things does the following:
.br
.br
- Disable ptrace. With ptrace it is possible to inspect and hijack running programs. Usually this is needed only for debugging. You should have no problems running Chromium or Firefox. This feature is available only on Ubuntu kernels.
.br
.br
- Whitelist write access to several files under /run, /proc and /sys.
.br
.br
- Allow running programs only from well-known system paths, such as /bin, /sbin, /usr/bin etc. Those paths are available as read-only. Running programs and scripts from user home or other directories writable by the user is not allowed.
.br
.br
- Prevent using non-standard network sockets. Only unix, inet, inet6, netlink, raw and packet are allowed.
.br
.br
- Deny access to known sensitive paths like .snapshots.
.TP
To enable AppArmor confinement on top of your current Firejail security features, pass \fB\-\-apparmor\fR flag to Firejail command line. You can also include \fBapparmor\fR command in a Firejail profile file. Example:
.br
.br
$ firejail --apparmor firefox
#endif
.SH DESKTOP INTEGRATION
A symbolic link to /usr/bin/firejail under the name of a program, will start the program in Firejail sandbox.
The symbolic link should be placed in the first $PATH position. On most systems, a good place
is /usr/local/bin directory. Example:
.PP
.RS
.br
.br
Make a firefox symlink to /usr/bin/firejail:
.br
.br
$ sudo ln -s /usr/bin/firejail /usr/local/bin/firefox
.br
.br
Verify $PATH
.br
.br
$ which -a firefox
.br
/usr/local/bin/firefox
.br
/usr/bin/firefox
.br
.br
Starting firefox in this moment, automatically invokes “firejail firefox”.
.RE
.br
.br
This works for clicking on desktop environment icons, menus etc. Use "firejail --tree"
to verify the program is sandboxed.
.PP
.RS
.br
.br
.br
$ firejail --tree
.br
1189:netblue:firejail firefox
.br
1190:netblue:firejail firefox
.br
1220:netblue:/bin/sh -c "/usr/lib/firefox/firefox"
.br
1221:netblue:/usr/lib/firefox/firefox
.RE
We provide a tool that automates all this integration, please see \&\flfirecfg\fR\|(1) for more details.
.SH EXAMPLES
.TP
\f\firejail
Sandbox a regular shell session.
.TP
\f\firejail firefox
Start Mozilla Firefox.
.TP
\f\firejail \-\-debug firefox
Debug Firefox sandbox.
.TP
\f\firejail \-\-private firefox
Start Firefox with a new, empty home directory.
.TP
\f\firejail --net=none vlc
Start VLC in an unconnected network namespace.
#ifdef HAVE_NETWORK
.TP
\f\firejail \-\-net=eth0 firefox
Start Firefox in a new network namespace. An IP address is
assigned automatically.
.TP
\f\firejail \-\-net=br0 \-\-ip=10.10.20.5 \-\-net=br1 \-\-net=br2
Start a shell session in a new network namespace and connect it
to br0, br1, and br2 host bridge devices. IP addresses are assigned
automatically for the interfaces connected to br1 and b2
#endif
.TP
\f\firejail \-\-list
List all sandboxed processes.
.SH FILE GLOBBING
.TP
Globbing is the operation that expands a wildcard pattern into the
list of pathnames matching the pattern. This pattern is matched at
firejail \fBstart\fR, and is NOT UPDATED at runtime. \fBFiles matching
a blacklist, but created after firejail start will be accessible within
the jail.\fR Matching is defined by:
.br
.br
- '?' matches any character
.br
- '*' matches any string
.br
- '[' denotes a range of characters
.br
.TP
The globbing feature is implemented using glibc glob command. For
more information on the wildcard syntax see man 7 glob.
.br
.br
.TP
The following command line options are supported: \-\-blacklist,
\-\-private-bin, \-\-noexec, \-\-read-only, \-\-read-write,
\-\-tmpfs, and \-\-whitelist.
.br
.br
.TP
Examples:
.br
.br
$ firejail --private-bin=sh,bash,python*
.br
$ firejail --blacklist=~/dir[1234]
.br
$ firejail --read-only=~/dir[1-4]
.br
#ifdef HAVE_FILE_TRANSFER
.SH FILE TRANSFER
These features allow the user to inspect the filesystem container of an existing sandbox
and transfer files between the container and the host filesystem.
.TP
\fB\-\-cat=name|pid filename
Write content of a container file to standard out. The container is specified by name or PID.
If standard out is a terminal, all ASCII control characters except new line and horizontal tab
are replaced.
.TP
\fB\-\-get=name|pid filename
Retrieve the container file and store it on the host in the current working directory.
The container is specified by name or PID.
.TP
\fB\-\-ls=name|pid dir_or_filename
List container files. The container is specified by name or PID.
.TP
\fB\-\-put=name|pid src-filename dest-filename
Put src-filename in sandbox container.
The container is specified by name or PID.
.TP
Examples:
.br
.br
$ firejail \-\-name=mybrowser --private firefox
.br
.br
$ firejail \-\-ls=mybrowser ~/Downloads
.br
drwxr-xr-x netblue netblue 4096 .
.br
drwxr-xr-x netblue netblue 4096 ..
.br
-rw-r--r-- netblue netblue 7847 x11-x305.png
.br
-rw-r--r-- netblue netblue 6800 x11-x642.png
.br
-rw-r--r-- netblue netblue 34139 xpra-clipboard.png
.br
.br
$ firejail \-\-get=mybrowser ~/Downloads/xpra-clipboard.png
.br
.br
$ firejail \-\-put=mybrowser xpra-clipboard.png ~/Downloads/xpra-clipboard.png
.br
.br
$ firejail \-\-cat=mybrowser ~/.bashrc
.br
#endif
.SH INTRUSION DETECTION SYSTEM (IDS)
The host-based intrusion detection system tracks down and audits user and system file modifications.
The feature is configured using /etc/firejail/ids.config file, the checksums are stored in /var/lib/firejail/USERNAME.ids,
where USERNAME is the name of the current user. We use BLAKE2 cryptographic function for hashing.
As a regular user, initialize the database:
.br
.br
$ firejail --ids-init
.br
Opening config file /etc/firejail/ids.config
.br
Loading config file /etc/firejail/ids.config
.br
Opening config file /etc/firejail/ids.config.local
.br
500 1000 1500 2000
.br
2466 files scanned
.br
IDS database initialized
.br
.br
The default configuration targets several system executables in directories such as /bin, /sbin, /usr/bin, /usr/sbin, and several critical config files in user home directory
such as ~/.bashrc, ~/.xinitrc, and ~/.config/autostart. Several system config files in /etc directory are also hashed.
.br
.br
Run --ids-check to audit the system:
.br
.br
$ firejail --ids-check
.br
Opening config file /etc/firejail/ids.config
.br
Loading config file /etc/firejail/ids.config
.br
Opening config file /etc/firejail/ids.config.local
.br
500 1000 1500
.br
Warning: modified /home/netblue/.bashrc
.br
2000
.br
2466 files scanned: modified 1, permissions 0, new 0, removed 0
.br
.br
The program will print the files that have been modified since the database was created, or the files with different access permissions.
New files and deleted files are also flagged.
Currently while scanning the file system, symbolic links are not followed, and files the user doesn't have read access to are silently dropped.
The program can also be run as root (sudo firejail --ids-init/--ids-check).
.SH MONITORING
Option \-\-list prints a list of all sandboxes. The format
for each process entry is as follows:
PID:USER:Sandbox Name:Command
Option \-\-tree prints the tree of processes running in the sandbox. The format
for each process entry is as follows:
PID:USER:Sandbox Name:Command
Option \-\-top is similar to the UNIX top command, however it applies only to
sandboxes.
Option \-\-netstats prints network statistics for active sandboxes installing new network namespaces.
Listed below are the available fields (columns) in alphabetical
order for \-\-top and \-\-netstats options:
.TP
Command
Command used to start the sandbox.
.TP
CPU%
CPU usage, the sandbox share of the elapsed CPU time since the
last screen update
.TP
PID
Unique process ID for the task controlling the sandbox.
.TP
Prcs
Number of processes running in sandbox, including the controlling process.
.TP
RES
Resident Memory Size (KiB), sandbox non-swapped physical memory.
It is a sum of the RES values for all processes running in the sandbox.
.TP
RX(KB/s)
Network receive speed.
.TP
Sandbox Name
The name of the sandbox, if any.
.TP
SHR
Shared Memory Size (KiB), it reflects memory shared with other
processes. It is a sum of the SHR values for all processes running
in the sandbox, including the controlling process.
.TP
TX(KB/s)
Network transmit speed.
.TP
Uptime
Sandbox running time in hours:minutes:seconds format.
.TP
USER
The owner of the sandbox.
.SH RESTRICTED SHELL
To configure a restricted shell, replace /bin/bash with /usr/bin/firejail in
/etc/passwd file for each user that needs to be restricted. Alternatively,
you can specify /usr/bin/firejail in adduser command:
adduser \-\-shell /usr/bin/firejail username
Additional arguments passed to firejail executable upon login are declared in /etc/firejail/login.users file.
.SH SECURITY PROFILES
Several command line options can be passed to the program using
profile files. Firejail chooses the profile file as follows:
1. If a profile file is provided by the user with --profile=FILE option, the profile FILE is loaded. If a profile name is given, it is searched for first in the ~/.config/firejail directory and if not found then in /etc/firejail directory. Profile names do not include the .profile suffix. If there is a file with the same name as the given profile name, it will be used instead of doing the profile search. To force a profile search, prefix the profile name with a colon (:), eg. --profile=:PROFILE_NAME.
Example:
.PP
.RS
$ firejail --profile=/home/netblue/icecat.profile icecat
.br
Reading profile /home/netblue/icecat.profile
.br
[...]
.RE
.PP
.RS
$ firejail --profile=icecat icecat-wrapper.sh
.br
Reading profile /etc/firejail/icecat.profile
.br
[...]
.RE
2. If a profile file with the same name as the application is present in ~/.config/firejail directory or
in /etc/firejail, the profile is loaded. ~/.config/firejail takes precedence over /etc/firejail. Example:
.PP
.RS
$ firejail icecat
.br
Command name #icecat#
.br
Found icecat profile in /home/netblue/.config/firejail directory
.br
Reading profile /home/netblue/.config/firejail/icecat.profile
.br
[...]
.RE
3. Use default.profile file if the sandbox
is started by a regular user, or server.profile file if the sandbox
is started by root. Firejail looks for these files in ~/.config/firejail directory, followed by /etc/firejail directory.
To disable default profile loading, use --noprofile command option. Example:
.PP
.RS
$ firejail
.br
Reading profile /etc/firejail/default.profile
.br
Parent pid 8553, child pid 8554
.br
Child process initialized
.br
[...]
.br
.br
$ firejail \-\-noprofile
.br
Parent pid 8553, child pid 8554
.br
Child process initialized
.br
[...]
.RE
See \fBman 5 firejail-profile\fR for profile file syntax information.
#ifdef HAVE_NETWORK
.SH TRAFFIC SHAPING
Network bandwidth is an expensive resource shared among all sandboxes running on a system.
Traffic shaping allows the user to increase network performance by controlling
the amount of data that flows into and out of the sandboxes.
Firejail implements a simple rate-limiting shaper based on Linux command tc.
The shaper works at sandbox level, and can be used only for sandboxes configured with new network namespaces.
Set rate-limits:
$ firejail --bandwidth=name|pid set network download upload
Clear rate-limits:
$ firejail --bandwidth=name|pid clear network
Status:
$ firejail --bandwidth=name|pid status
where:
.br
name - sandbox name
.br
pid - sandbox pid
.br
network - network interface as used by \-\-net option
.br
download - download speed in KB/s (kilobyte per second)
.br
upload - upload speed in KB/s (kilobyte per second)
Example:
.br
$ firejail \-\-name=mybrowser \-\-net=eth0 firefox &
.br
$ firejail \-\-bandwidth=mybrowser set eth0 80 20
.br
$ firejail \-\-bandwidth=mybrowser status
.br
$ firejail \-\-bandwidth=mybrowser clear eth0
#endif
.SH LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
.PP
Homepage: https://firejail.wordpress.com
.SH SEE ALSO
.BR firemon (1),
.BR firecfg (1),
.BR firejail-profile (5),
.BR firejail-login (5),
.BR firejail-users (5),
.BR jailcheck (1)
.UR https://github.com/netblue30/firejail/wiki
.UE ,
.UR https://github.com/netblue30/firejail
.UE
|