Bläddra i källkod

Merge branch 'stretch' of https://github.com/bashrc/freedombone

Bob Mottram 7 år sedan
förälder
incheckning
2d45c34f22

+ 2
- 0
doc/EN/mobile.org Visa fil

96
 127.0.0.1       www.google-analytics.com
96
 127.0.0.1       www.google-analytics.com
97
 127.0.0.1       google-analytics.com
97
 127.0.0.1       google-analytics.com
98
 127.0.0.1       ssl.google-analytics.com
98
 127.0.0.1       ssl.google-analytics.com
99
+127.0.0.1       telemetry.mozilla.org
100
+127.0.0.1       incoming.telemetry.mozilla.org
99
 #+end_src
101
 #+end_src
100
 
102
 
101
 Then upload the hosts file back again with:
103
 Then upload the hosts file back again with:

Binär
man/freedombone-image.1.gz Visa fil


+ 25
- 5
src/freedombone-app-pleroma Visa fil

36
 PLEROMA_PORT=4000
36
 PLEROMA_PORT=4000
37
 PLEROMA_ONION_PORT=8011
37
 PLEROMA_ONION_PORT=8011
38
 PLEROMA_REPO="https://git.pleroma.social/pleroma/pleroma.git"
38
 PLEROMA_REPO="https://git.pleroma.social/pleroma/pleroma.git"
39
-PLEROMA_COMMIT='5b6d6d7f2d9363c494642bfda4d6e4d12daa53c7'
39
+PLEROMA_COMMIT='762f6edc29a7a48e3a663e9bedec58e0036ff363'
40
 PLEROMA_ADMIN_PASSWORD=
40
 PLEROMA_ADMIN_PASSWORD=
41
 PLEROMA_DIR=/etc/pleroma
41
 PLEROMA_DIR=/etc/pleroma
42
 PLEROMA_SECRET_KEY=""
42
 PLEROMA_SECRET_KEY=""
733
             enablechatstr=$'Disable chat system'
733
             enablechatstr=$'Disable chat system'
734
         fi
734
         fi
735
 
735
 
736
+        pleromatorstr=$'Enable routing through Tor for onion addresses'
737
+        if grep -q '9050' $pleroma_secret; then
738
+            pleromatorstr=$'Disable routing through Tor'
739
+        fi
740
+
736
         W=(1 $"Set a background image"
741
         W=(1 $"Set a background image"
737
            2 $"Set the title"
742
            2 $"Set the title"
738
            3 $"Disable new account registrations"
743
            3 $"Disable new account registrations"
739
            4 $"Add a custom emoji"
744
            4 $"Add a custom emoji"
740
            5 $"Set post expiry period (currently $PLEROMA_EXPIRE_MONTHS months)"
745
            5 $"Set post expiry period (currently $PLEROMA_EXPIRE_MONTHS months)"
741
-           6 "$enablechatstr")
746
+           6 "$enablechatstr"
747
+           7 "$pleromatorstr")
742
 
748
 
743
         # shellcheck disable=SC2068
749
         # shellcheck disable=SC2068
744
-        selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Pleroma" --menu $"Choose an operation, or ESC to exit:" 13 60 6 "${W[@]}" 3>&2 2>&1 1>&3)
750
+        selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Pleroma" --menu $"Choose an operation, or ESC to exit:" 14 60 7 "${W[@]}" 3>&2 2>&1 1>&3)
745
 
751
 
746
         if [ ! "$selection" ]; then
752
         if [ ! "$selection" ]; then
747
             break
753
             break
759
                    pleroma_enable_chat true
765
                    pleroma_enable_chat true
760
                fi
766
                fi
761
                ;;
767
                ;;
768
+            7) if grep -q '9050' $pleroma_secret; then
769
+                   pleroma_disable_tor
770
+               else
771
+                   pleroma_enable_tor
772
+               fi
773
+               ;;
762
         esac
774
         esac
763
     done
775
     done
764
 }
776
 }
765
 
777
 
766
-function pleroma_upgrade_tor {
778
+function pleroma_disable_tor {
779
+    if grep -q '9050' $pleroma_secret; then
780
+        sed -i '/9050/d' $pleroma_secret
781
+        sed -i 's|# config :pleroma, :http, proxy_url:|config :pleroma, :http, proxy_url:|g' $PLEROMA_DIR/config/config.exs
782
+        pleroma_recompile
783
+    fi
784
+}
785
+
786
+function pleroma_enable_tor {
767
     pleroma_tor_update=
787
     pleroma_tor_update=
768
 
788
 
769
     if ! grep -q '{:socks5, :localhost, 9050}' $pleroma_secret; then
789
     if ! grep -q '{:socks5, :localhost, 9050}' $pleroma_secret; then
806
         create_pleroma_blocklist
826
         create_pleroma_blocklist
807
     fi
827
     fi
808
 
828
 
809
-    pleroma_upgrade_tor
829
+    #pleroma_enable_tor
810
 
830
 
811
     CURR_PLEROMA_COMMIT=$(get_completion_param "pleroma commit")
831
     CURR_PLEROMA_COMMIT=$(get_completion_param "pleroma commit")
812
     if [[ "$CURR_PLEROMA_COMMIT" == "$PLEROMA_COMMIT" ]]; then
832
     if [[ "$CURR_PLEROMA_COMMIT" == "$PLEROMA_COMMIT" ]]; then

+ 125
- 86
src/freedombone-controlpanel Visa fil

224
 function show_domains {
224
 function show_domains {
225
     read_config_param "DEFAULT_DOMAIN_NAME"
225
     read_config_param "DEFAULT_DOMAIN_NAME"
226
 
226
 
227
-    W=()
227
+    while true
228
+    do
229
+        W=()
228
 
230
 
229
-    W+=("IPv4" "$(get_ipv4_address) / $(get_external_ipv4_address)")
230
-    ipv6_address="$(get_ipv6_address)"
231
-    if [ ${#ipv6_address} -gt 0 ]; then
232
-        W+=("IPv6" "${ipv6_address}")
233
-    fi
231
+        W+=("IPv4" "$(get_ipv4_address) / $(get_external_ipv4_address)")
232
+        ipv6_address="$(get_ipv6_address)"
233
+        if [ ${#ipv6_address} -gt 0 ]; then
234
+            W+=("IPv6" "${ipv6_address}")
235
+        fi
234
 
236
 
235
-    if [ -f /etc/ssh/ssh_host_rsa_key.pub ]; then
236
-        W+=("ssh rsa sha256" "$(awk '{print $2}' /etc/ssh/ssh_host_rsa_key.pub | base64 -d | sha256sum -b | awk '{print $1}' | xxd -r -p | base64 | sed 's|=||g')")
237
-    fi
238
-    if [ -f /etc/ssh/ssh_host_ed25519_key.pub ]; then
239
-        W+=("ssh ed25519 sha256" "$(awk '{print $2}' /etc/ssh/ssh_host_ed25519_key.pub | base64 -d | sha256sum -b | awk '{print $1}' | xxd -r -p | base64 | sed 's|=||g')")
240
-    fi
237
+        if [ -f /etc/ssh/ssh_host_rsa_key.pub ]; then
238
+            W+=("ssh rsa sha256" "$(awk '{print $2}' /etc/ssh/ssh_host_rsa_key.pub | base64 -d | sha256sum -b | awk '{print $1}' | xxd -r -p | base64 | sed 's|=||g')")
239
+        fi
240
+        if [ -f /etc/ssh/ssh_host_ed25519_key.pub ]; then
241
+            W+=("ssh ed25519 sha256" "$(awk '{print $2}' /etc/ssh/ssh_host_ed25519_key.pub | base64 -d | sha256sum -b | awk '{print $1}' | xxd -r -p | base64 | sed 's|=||g')")
242
+        fi
241
 
243
 
242
-    if grep -q "ssh onion domain" "$COMPLETION_FILE"; then
243
-        domain_onion=$(grep 'ssh onion domain' "${COMPLETION_FILE}" | awk -F ':' '{print $2}')
244
-        W+=("ssh" "${DEFAULT_DOMAIN_NAME} / ${domain_onion}")
245
-    fi
246
-    if grep -q "email onion domain" "$COMPLETION_FILE"; then
247
-        domain_onion=$(grep 'email onion domain' "${COMPLETION_FILE}" | awk -F ':' '{print $2}')
248
-        W+=("Email" "${DEFAULT_DOMAIN_NAME} / ${domain_onion}")
249
-    fi
250
-    if grep -q "sks onion domain" "$COMPLETION_FILE"; then
251
-        read_config_param "KEYSERVER_DOMAIN_NAME"
252
-        domain_onion=$(grep 'sks onion domain' "${COMPLETION_FILE}" | awk -F ':' '{print $2}')
253
-        W+=("SKS" "${KEYSERVER_DOMAIN_NAME} / ${domain_onion}")
254
-    fi
244
+        if grep -q "ssh onion domain" "$COMPLETION_FILE"; then
245
+            domain_onion=$(grep 'ssh onion domain' "${COMPLETION_FILE}" | awk -F ':' '{print $2}')
246
+            W+=("ssh" "${DEFAULT_DOMAIN_NAME} / ${domain_onion}")
247
+        fi
248
+        if grep -q "email onion domain" "$COMPLETION_FILE"; then
249
+            domain_onion=$(grep 'email onion domain' "${COMPLETION_FILE}" | awk -F ':' '{print $2}')
250
+            W+=("Email" "${DEFAULT_DOMAIN_NAME} / ${domain_onion}")
251
+        fi
252
+        if grep -q "sks onion domain" "$COMPLETION_FILE"; then
253
+            read_config_param "KEYSERVER_DOMAIN_NAME"
254
+            domain_onion=$(grep 'sks onion domain' "${COMPLETION_FILE}" | awk -F ':' '{print $2}')
255
+            W+=("SKS" "${KEYSERVER_DOMAIN_NAME} / ${domain_onion}")
256
+        fi
255
 
257
 
256
-    INTRODUCER_FILENAME=/home/tahoelafs/data/private/introducer.furl
257
-    if [ -f $INTRODUCER_FILENAME ]; then
258
-        W+=("Tahoe-LAFS" "$(cat $INTRODUCER_FILENAME)")
259
-    fi
258
+        INTRODUCER_FILENAME=/home/tahoelafs/data/private/introducer.furl
259
+        if [ -f $INTRODUCER_FILENAME ]; then
260
+            W+=("Tahoe-LAFS" "$(cat $INTRODUCER_FILENAME)")
261
+        fi
260
 
262
 
261
-    show_tor_bridges
263
+        show_tor_bridges
262
 
264
 
263
-    # shellcheck disable=SC2068
264
-    for app_name in ${APPS_INSTALLED_NAMES[@]}
265
-    do
266
-        if ! grep -q "SHOW_ON_ABOUT=1" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
267
-            continue
268
-        fi
265
+        # shellcheck disable=SC2068
266
+        for app_name in ${APPS_INSTALLED_NAMES[@]}
267
+        do
268
+            if ! grep -q "SHOW_ON_ABOUT=1" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
269
+                continue
270
+            fi
269
 
271
 
270
-        # handle the foibles of capitalisation
271
-        if ! grep -q "${app_name} domain" "$COMPLETION_FILE"; then
272
-            app_name_upper=$(echo "${app_name}" | awk '{print toupper($0)}')
273
-            if grep -q "${app_name_upper} domain" "$COMPLETION_FILE"; then
274
-                app_name=${app_name_upper}
275
-            else
276
-                app_name_first_upper="$(tr '[:lower:]' '[:upper:]' <<< "${app_name:0:1}")${app_name:1}"
277
-                if grep -q "${app_name_first_upper} domain" "$COMPLETION_FILE"; then
278
-                    app_name=${app_name_first_upper}
272
+            # handle the foibles of capitalisation
273
+            if ! grep -q "${app_name} domain" "$COMPLETION_FILE"; then
274
+                app_name_upper=$(echo "${app_name}" | awk '{print toupper($0)}')
275
+                if grep -q "${app_name_upper} domain" "$COMPLETION_FILE"; then
276
+                    app_name=${app_name_upper}
277
+                else
278
+                    app_name_first_upper="$(tr '[:lower:]' '[:upper:]' <<< "${app_name:0:1}")${app_name:1}"
279
+                    if grep -q "${app_name_first_upper} domain" "$COMPLETION_FILE"; then
280
+                        app_name=${app_name_first_upper}
281
+                    fi
279
                 fi
282
                 fi
280
             fi
283
             fi
281
-        fi
282
 
284
 
283
-        if [ ${#app_name} -gt 0 ]; then
284
-            icann_address=$(get_app_icann_address "$app_name")
285
-            if grep -q "SHOW_ICANN_ADDRESS_ON_ABOUT=0" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
286
-                icann_address='-'
287
-            fi
288
-            if [[ "$ONION_ONLY" != 'no' ]]; then
289
-                if [[ "${icann_address}" != "${LOCAL_NAME}.local" ]]; then
285
+            if [ ${#app_name} -gt 0 ]; then
286
+                icann_address=$(get_app_icann_address "$app_name")
287
+                if grep -q "SHOW_ICANN_ADDRESS_ON_ABOUT=0" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
290
                     icann_address='-'
288
                     icann_address='-'
291
                 fi
289
                 fi
292
-            fi
293
-            onion_address=$(get_app_onion_address "$app_name")
294
-            if [ ${#onion_address} -eq 0 ]; then
295
-                onion_address="-"
296
-            fi
297
-
298
-            if [[ "${icann_address}" != '-' ]]; then
299
-                if [[ "${onion_address}" != '-' ]]; then
300
-                    W+=("${app_name}" "${icann_address} / ${onion_address}")
301
-                else
302
-                    W+=("${app_name}" "${icann_address}")
290
+                if [[ "$ONION_ONLY" != 'no' ]]; then
291
+                    if [[ "${icann_address}" != "${LOCAL_NAME}.local" ]]; then
292
+                        icann_address='-'
293
+                    fi
294
+                fi
295
+                onion_address=$(get_app_onion_address "$app_name")
296
+                if [ ${#onion_address} -eq 0 ]; then
297
+                    onion_address="-"
303
                 fi
298
                 fi
304
-            else
305
-                W+=("${app_name}" "${onion_address}")
306
-            fi
307
 
299
 
308
-            if grep -q "mobile${app_name} onion domain" "$COMPLETION_FILE"; then
309
-                onion_address=$(get_app_onion_address "${app_name}" "mobile")
310
                 if [[ "${icann_address}" != '-' ]]; then
300
                 if [[ "${icann_address}" != '-' ]]; then
311
-                    W+=("${app_name} (mobile)" "${icann_address} / ${onion_address}")
301
+                    if [[ "${onion_address}" != '-' ]]; then
302
+                        W+=("${app_name}" "${icann_address} / ${onion_address}")
303
+                    else
304
+                        W+=("${app_name}" "${icann_address}")
305
+                    fi
312
                 else
306
                 else
313
-                    W+=("${app_name} (mobile)" "${onion_address}")
307
+                    W+=("${app_name}" "${onion_address}")
308
+                fi
309
+
310
+                if grep -q "mobile${app_name} onion domain" "$COMPLETION_FILE"; then
311
+                    onion_address=$(get_app_onion_address "${app_name}" "mobile")
312
+                    if [[ "${icann_address}" != '-' ]]; then
313
+                        W+=("${app_name} (mobile)" "${icann_address} / ${onion_address}")
314
+                    else
315
+                        W+=("${app_name} (mobile)" "${onion_address}")
316
+                    fi
314
                 fi
317
                 fi
315
             fi
318
             fi
316
-        fi
317
-    done
319
+        done
318
 
320
 
319
-    if grep -q "rss reader domain" "$COMPLETION_FILE"; then
320
-        if [ -d /var/lib/tor/hidden_service_ttrss ]; then
321
-            domain_onion=$(cat /var/lib/tor/hidden_service_ttrss/hostname)
322
-            W+=("RSS Reader" "${domain_onion}")
323
-        fi
324
-        if [ -d /var/lib/tor/hidden_service_mobilerss ]; then
325
-            domain_onion=$(cat /var/lib/tor/hidden_service_mobilerss/hostname)
326
-            W+=("RSS mobile" "${domain_onion}")
321
+        if grep -q "rss reader domain" "$COMPLETION_FILE"; then
322
+            if [ -d /var/lib/tor/hidden_service_ttrss ]; then
323
+                domain_onion=$(cat /var/lib/tor/hidden_service_ttrss/hostname)
324
+                W+=("RSS Reader" "${domain_onion}")
325
+            fi
326
+            if [ -d /var/lib/tor/hidden_service_mobilerss ]; then
327
+                domain_onion=$(cat /var/lib/tor/hidden_service_mobilerss/hostname)
328
+                W+=("RSS mobile" "${domain_onion}")
329
+            fi
327
         fi
330
         fi
328
-    fi
329
 
331
 
330
-    width=$(tput cols)
331
-    height=$(tput lines)
332
+        width=$(tput cols)
333
+        height=$(tput lines)
332
 
334
 
333
-    # shellcheck disable=SC2068
334
-    dialog --backtitle $"Freedombone Control Panel" --title $"Domains" --menu $"Use Shift+cursors to select and copy onion addresses" $((height-4)) $((width-4)) $((height-4)) "${W[@]}" 3>&2 2>&1 1>&3
335
+        # shellcheck disable=SC2068
336
+        selected=$(dialog --backtitle $"Freedombone Control Panel" --title $"Domains" --menu $"Use Shift+cursors to select and copy onion addresses" $((height-4)) $((width-4)) $((height-4)) "${W[@]}" 3>&2 2>&1 1>&3)
337
+        if [ ! "$selected" ]; then
338
+            break
339
+        fi
340
+        # obtain the addresses from the key by itterating through
341
+        # the array. This is quite crude and maybe there's a better way
342
+        key_found=
343
+        selected_addresses=
344
+        for key in "${W[@]}";
345
+        do
346
+            if [ $key_found ]; then
347
+                selected_addresses="$key"
348
+                break
349
+            fi
350
+            if [[ "$key" == "$selected" ]]; then
351
+                key_found=1
352
+            fi
353
+        done
354
+        # Was the key matched?
355
+        if [ ! "$selected_addresses" ]; then
356
+            break
357
+        fi
358
+        # addresses were found - is this an onion?
359
+        if [[ "$selected_addresses" != *".onion"* ]]; then
360
+            continue
361
+        fi
362
+        # There are two forms of addresses: "x / y.onion" and "x.onion"
363
+        if [[ "$selected_addresses" == *'/'* ]]; then
364
+            onion_addr=$(echo "$selected_addresses" | awk -F '/' '{print $2}' | awk -F ' ' '{print $1}')
365
+        else
366
+            onion_addr="$selected_addresses"
367
+        fi
368
+        # show the onion address as a QR code
369
+        clear
370
+        echo "${selected}: ${onion_addr}"
371
+        echo -n "$onion_addr" | qrencode -t UTF8
372
+        any_key
373
+    done
335
 }
374
 }
336
 
375
 
337
 function show_users {
376
 function show_users {

+ 4
- 0
src/freedombone-controlpanel-user Visa fil

434
     dialog --title $"My PGP/GPG Key" \
434
     dialog --title $"My PGP/GPG Key" \
435
            --backtitle $"Freedombone User Control Panel" \
435
            --backtitle $"Freedombone User Control Panel" \
436
            --msgbox $"Email Address: $MY_EMAIL_ADDRESS\\n\\nKey ID: $GPG_ID\\n\\nFingerprint: $GPG_FINGERPRINT\\n\\nCreated: $GPG_DATE" 12 70
436
            --msgbox $"Email Address: $MY_EMAIL_ADDRESS\\n\\nKey ID: $GPG_ID\\n\\nFingerprint: $GPG_FINGERPRINT\\n\\nCreated: $GPG_DATE" 12 70
437
+    clear
438
+    echo $"Your GPG/PGP public key:"
439
+    gpg --armor --export "$GPG_ID" | qrencode -t UTF8
440
+    any_key
437
 }
441
 }
438
 
442
 
439
 function show_full_gpg_key {
443
 function show_full_gpg_key {

+ 9
- 2
src/freedombone-image Visa fil

74
 USERNAME="$USER"
74
 USERNAME="$USER"
75
 PASSWORD=
75
 PASSWORD=
76
 
76
 
77
+CONTINUOUS_INTEGRATION=
78
+
77
 # IP address of the router (gateway)
79
 # IP address of the router (gateway)
78
 ROUTER_IP_ADDRESS="192.168.1.254"
80
 ROUTER_IP_ADDRESS="192.168.1.254"
79
 
81
 
378
             shift
380
             shift
379
             INTERACTIVE="$1"
381
             INTERACTIVE="$1"
380
             ;;
382
             ;;
383
+        --ci)
384
+            shift
385
+            CONTINUOUS_INTEGRATION="$1"
386
+            ;;
381
         -g|--generic)
387
         -g|--generic)
382
             shift
388
             shift
383
             GENERIC_IMAGE="$1"
389
             GENERIC_IMAGE="$1"
614
      AMNESIC="$AMNESIC" \
620
      AMNESIC="$AMNESIC" \
615
      SOCIALINSTANCE="$SOCIALINSTANCE" \
621
      SOCIALINSTANCE="$SOCIALINSTANCE" \
616
      EXTERNAL_DRIVE="$EXTERNAL_DRIVE" \
622
      EXTERNAL_DRIVE="$EXTERNAL_DRIVE" \
623
+     CONTINUOUS_INTEGRATION="$CONTINUOUS_INTEGRATION" \
617
      LOCAL_NAME="$LOCAL_NAME"
624
      LOCAL_NAME="$LOCAL_NAME"
618
 
625
 
619
 # shellcheck disable=SC2181
626
 # shellcheck disable=SC2181
641
 for im in ${image_types[@]}
648
 for im in ${image_types[@]}
642
 do
649
 do
643
     # shellcheck disable=SC2012,SC2086
650
     # shellcheck disable=SC2012,SC2086
644
-    no_of_files=$(ls -afq build/${PROJECT_NAME}*.${im} | wc -l)
645
-    if (( no_of_files > 0 )); then
651
+    no_of_files=$(ls -l build/${PROJECT_NAME}*.${im} | wc -l)
652
+    if [ "$no_of_files" -gt 0 ]; then
646
         # shellcheck disable=SC2086
653
         # shellcheck disable=SC2086
647
         mv build/${PROJECT_NAME}*.${im} ${CURR_DIR}/
654
         mv build/${PROJECT_NAME}*.${im} ${CURR_DIR}/
648
         # shellcheck disable=SC2086
655
         # shellcheck disable=SC2086

+ 4
- 2
src/freedombone-image-customise Visa fil

139
 BMX7_REPO="https://github.com/bmx-routing/bmx7"
139
 BMX7_REPO="https://github.com/bmx-routing/bmx7"
140
 BMX7_COMMIT='0a82c7c10fef44b259b35e77ab33632aa132d219'
140
 BMX7_COMMIT='0a82c7c10fef44b259b35e77ab33632aa132d219'
141
 
141
 
142
+CONTINUOUS_INTEGRATION=
143
+
142
 PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
144
 PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
143
 
145
 
144
 # Whether to use a SATA drive and if so what its device/partition name is
146
 # Whether to use a SATA drive and if so what its device/partition name is
1766
     chroot "$rootdir" apt-get -yq -t stretch-backports install tor
1768
     chroot "$rootdir" apt-get -yq -t stretch-backports install tor
1767
     chroot "$rootdir" apt-get -yq install connect-proxy
1769
     chroot "$rootdir" apt-get -yq install connect-proxy
1768
     chroot "$rootdir" connect-proxy
1770
     chroot "$rootdir" connect-proxy
1769
-    sed -i 's|#Log notice file.*|Log notice file /dev/null|g' "$rootdir/etc/tor/torrc"
1770
-    sed -i 's|Log notice file.*|Log notice file /dev/null|g' "$rootdir/etc/tor/torrc"
1771
+    sed -i 's|#Log notice file.*|Log notice file /var/log/tor/notices.log|g' "$rootdir/etc/tor/torrc"
1772
+    sed -i 's|Log notice file.*|Log notice file /var/log/tor/notices.log|g' "$rootdir/etc/tor/torrc"
1771
     sed -i "s|#AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes|g" "$rootdir/etc/tor/torrc"
1773
     sed -i "s|#AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes|g" "$rootdir/etc/tor/torrc"
1772
     sed -i "s|AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes|g" "$rootdir/etc/tor/torrc"
1774
     sed -i "s|AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes|g" "$rootdir/etc/tor/torrc"
1773
     if ! grep -q 'Host *.onion' "$rootdir/root/.ssh/config"; then
1775
     if ! grep -q 'Host *.onion' "$rootdir/root/.ssh/config"; then

+ 2
- 0
src/freedombone-image-make Visa fil

78
 export SOCIALINSTANCE
78
 export SOCIALINSTANCE
79
 export LOCAL_NAME
79
 export LOCAL_NAME
80
 export EXTERNAL_DRIVE
80
 export EXTERNAL_DRIVE
81
+export CONTINUOUS_INTEGRATION
81
 
82
 
82
 # Locate vmdebootstrap program fetched in Makefile
83
 # Locate vmdebootstrap program fetched in Makefile
83
 basedir=`pwd`
84
 basedir=`pwd`
228
 sed -i "s|LOCAL_NAME=.*|LOCAL_NAME=\"${LOCAL_NAME}\"|g" "$TEMP_CUSTOMISE3"
229
 sed -i "s|LOCAL_NAME=.*|LOCAL_NAME=\"${LOCAL_NAME}\"|g" "$TEMP_CUSTOMISE3"
229
 sed -i "s|EXTERNAL_DRIVE=.*|EXTERNAL_DRIVE=\"${EXTERNAL_DRIVE}\"|g" "$TEMP_CUSTOMISE3"
230
 sed -i "s|EXTERNAL_DRIVE=.*|EXTERNAL_DRIVE=\"${EXTERNAL_DRIVE}\"|g" "$TEMP_CUSTOMISE3"
230
 sed -i 's|#!/bin/bash||g' "$TEMP_CUSTOMISE3"
231
 sed -i 's|#!/bin/bash||g' "$TEMP_CUSTOMISE3"
232
+sed -i "s|CONTINUOUS_INTEGRATION=.*|CONTINUOUS_INTEGRATION=${CONTINUOUS_INTEGRATION}|g" "$TEMP_CUSTOMISE3"
231
 
233
 
232
 cat $TEMP_CUSTOMISE2 $TEMP_CUSTOMISE3 > $TEMP_CUSTOMISE4
234
 cat $TEMP_CUSTOMISE2 $TEMP_CUSTOMISE3 > $TEMP_CUSTOMISE4
233
 if [ -f $TEMP_CUSTOMISE ]; then
235
 if [ -f $TEMP_CUSTOMISE ]; then

+ 20
- 15
src/freedombone-image-makefile Visa fil

41
 ARCHIVE = $(IMAGE).xz
41
 ARCHIVE = $(IMAGE).xz
42
 SIGNATURE = $(ARCHIVE).sig
42
 SIGNATURE = $(ARCHIVE).sig
43
 OWNER = 1000
43
 OWNER = 1000
44
-XZ = xz --no-warn --verbose --keep --threads=0 -3
45
-SIGN = -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE)
44
+ifeq ("$CONTINUOUS_INTEGRATION", "")
45
+    XZ = xz --no-warn --verbose --keep --threads=0 -3 $(IMAGE)
46
+    SIGN = -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE)
47
+else
48
+	XZ =
49
+	SIGN =
50
+endif
46
 
51
 
47
 # settings for `make test`
52
 # settings for `make test`
48
 TEST_SSH_PORT = 2222
53
 TEST_SSH_PORT = 2222
90
 	$(eval MACHINE = beaglebone)
95
 	$(eval MACHINE = beaglebone)
91
 	$(MAKE_IMAGE)
96
 	$(MAKE_IMAGE)
92
 	@rm -f $(ARCHIVE)
97
 	@rm -f $(ARCHIVE)
93
-	$(XZ) $(IMAGE)
98
+	$(XZ)
94
 	@echo ""
99
 	@echo ""
95
 	$(SIGN)
100
 	$(SIGN)
96
 	@echo "Build complete."
101
 	@echo "Build complete."
101
 	$(eval MACHINE = cubieboard2)
106
 	$(eval MACHINE = cubieboard2)
102
 	$(MAKE_IMAGE)
107
 	$(MAKE_IMAGE)
103
 	@rm -f $(ARCHIVE)
108
 	@rm -f $(ARCHIVE)
104
-	$(XZ) $(IMAGE)
109
+	$(XZ)
105
 	@echo ""
110
 	@echo ""
106
 	$(SIGN)
111
 	$(SIGN)
107
 	@echo "Build complete."
112
 	@echo "Build complete."
112
 	$(eval MACHINE = pcduino3)
117
 	$(eval MACHINE = pcduino3)
113
 	$(MAKE_IMAGE)
118
 	$(MAKE_IMAGE)
114
 	@rm -f $(ARCHIVE)
119
 	@rm -f $(ARCHIVE)
115
-	$(XZ) $(IMAGE)
120
+	$(XZ)
116
 	@echo ""
121
 	@echo ""
117
 	$(SIGN)
122
 	$(SIGN)
118
 	@echo "Build complete."
123
 	@echo "Build complete."
123
 	$(eval MACHINE = cubietruck)
128
 	$(eval MACHINE = cubietruck)
124
 	$(MAKE_IMAGE)
129
 	$(MAKE_IMAGE)
125
 	@rm -f $(ARCHIVE)
130
 	@rm -f $(ARCHIVE)
126
-	$(XZ) $(IMAGE)
131
+	$(XZ)
127
 	@echo ""
132
 	@echo ""
128
 	$(SIGN)
133
 	$(SIGN)
129
 	@echo "Build complete."
134
 	@echo "Build complete."
135
 	$(eval IMAGE = $(NAME).img)
140
 	$(eval IMAGE = $(NAME).img)
136
 	$(MAKE_IMAGE)
141
 	$(MAKE_IMAGE)
137
 	rm -f $(ARCHIVE)
142
 	rm -f $(ARCHIVE)
138
-	$(XZ) $(IMAGE)
143
+	$(XZ)
139
 	@echo ""
144
 	@echo ""
140
 	$(SIGN)
145
 	$(SIGN)
141
 
146
 
145
 	$(eval MACHINE = a20-olinuxino-lime2)
150
 	$(eval MACHINE = a20-olinuxino-lime2)
146
 	$(MAKE_IMAGE)
151
 	$(MAKE_IMAGE)
147
 	@rm -f $(ARCHIVE)
152
 	@rm -f $(ARCHIVE)
148
-	$(XZ) $(IMAGE)
153
+	$(XZ)
149
 	@echo ""
154
 	@echo ""
150
 	$(SIGN)
155
 	$(SIGN)
151
 	@echo "Build complete."
156
 	@echo "Build complete."
156
 	$(eval MACHINE = a20-olinuxino-micro)
161
 	$(eval MACHINE = a20-olinuxino-micro)
157
 	$(MAKE_IMAGE)
162
 	$(MAKE_IMAGE)
158
 	@rm -f $(ARCHIVE)
163
 	@rm -f $(ARCHIVE)
159
-	$(XZ) $(IMAGE)
164
+	$(XZ)
160
 	@echo ""
165
 	@echo ""
161
 	$(SIGN)
166
 	$(SIGN)
162
 	@echo "Build complete."
167
 	@echo "Build complete."
167
 	$(eval MACHINE = all)
172
 	$(eval MACHINE = all)
168
 	$(MAKE_IMAGE)
173
 	$(MAKE_IMAGE)
169
 	@rm -f $(ARCHIVE)
174
 	@rm -f $(ARCHIVE)
170
-	$(XZ) $(IMAGE)
175
+	$(XZ)
171
 	@echo ""
176
 	@echo ""
172
 	$(SIGN)
177
 	$(SIGN)
173
 	@echo "Build complete."
178
 	@echo "Build complete."
178
 	$(eval MACHINE = all)
183
 	$(eval MACHINE = all)
179
 	$(MAKE_IMAGE)
184
 	$(MAKE_IMAGE)
180
 	@rm -f $(ARCHIVE)
185
 	@rm -f $(ARCHIVE)
181
-	$(XZ) $(IMAGE)
186
+	$(XZ)
182
 	@echo ""
187
 	@echo ""
183
 	$(SIGN)
188
 	$(SIGN)
184
 	@echo "Build complete."
189
 	@echo "Build complete."
189
 	$(eval MACHINE = all)
194
 	$(eval MACHINE = all)
190
 	$(MAKE_IMAGE)
195
 	$(MAKE_IMAGE)
191
 	@rm -f $(ARCHIVE)
196
 	@rm -f $(ARCHIVE)
192
-	$(XZ) $(IMAGE)
197
+	$(XZ)
193
 	@echo ""
198
 	@echo ""
194
 	$(SIGN)
199
 	$(SIGN)
195
 	@echo "Build complete."
200
 	@echo "Build complete."
200
 	$(eval MACHINE = all)
205
 	$(eval MACHINE = all)
201
 	$(MAKE_IMAGE)
206
 	$(MAKE_IMAGE)
202
 	@rm -f $(ARCHIVE)
207
 	@rm -f $(ARCHIVE)
203
-	$(XZ) $(IMAGE)
208
+	$(XZ)
204
 	@echo ""
209
 	@echo ""
205
 	$(SIGN)
210
 	$(SIGN)
206
 	@echo "Build complete."
211
 	@echo "Build complete."
215
 	# Convert image to qemu format
220
 	# Convert image to qemu format
216
 	qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
221
 	qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
217
 	@rm -f $(ARCHIVE)
222
 	@rm -f $(ARCHIVE)
218
-	$(XZ) $(IMAGE)
223
+	$(XZ)
219
 	@echo ""
224
 	@echo ""
220
 	$(SIGN)
225
 	$(SIGN)
221
 	@echo "Build complete."
226
 	@echo "Build complete."
227
 	# Convert image to qemu format
232
 	# Convert image to qemu format
228
 	qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
233
 	qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
229
 	@rm -f $(ARCHIVE)
234
 	@rm -f $(ARCHIVE)
230
-	$(XZ) $(IMAGE)
235
+	$(XZ)
231
 	@echo ""
236
 	@echo ""
232
 	$(SIGN)
237
 	$(SIGN)
233
 	@echo "Build complete."
238
 	@echo "Build complete."

+ 2
- 3
src/freedombone-logging Visa fil

179
 else
179
 else
180
     turn_logging_off
180
     turn_logging_off
181
 
181
 
182
-    if [ -d /etc/tor ]; then
183
-        echo 'Log notice file /dev/null' > /etc/torrc.d/logging
184
-        rm /var/log/tor/*
182
+    if [ -d /etc/torrc.d ]; then
183
+        echo 'Log notice file /var/log/tor/notices.log' > /etc/torrc.d/logging
185
     fi
184
     fi
186
     if [ -d /var/log/radicale ]; then
185
     if [ -d /var/log/radicale ]; then
187
         $REMOVE_FILES_COMMAND /var/log/radicale/*
186
         $REMOVE_FILES_COMMAND /var/log/radicale/*

+ 6
- 0
src/freedombone-tests Visa fil

759
     output "V-38605" $? ${SETLANG}
759
     output "V-38605" $? ${SETLANG}
760
     ################
760
     ################
761
 
761
 
762
+    ##Check that openssh client and server are installed
763
+    bash $STIG_TESTS_DIR/check-ssh.sh installed >/dev/null 2>&1 &
764
+    stig_spinner $!
765
+    output "SV-86857r1_rule" $? ${SETLANG}
766
+    ################
767
+    
762
     ##RHEL-06-000227
768
     ##RHEL-06-000227
763
     ##The SSH daemon must be configured to use only the SSHv2 protocol.
769
     ##The SSH daemon must be configured to use only the SSHv2 protocol.
764
 
770
 

+ 62
- 0
src/freedombone-tor-health Visa fil

1
+#!/bin/bash
2
+#  _____               _           _
3
+# |   __|___ ___ ___ _| |___ _____| |_ ___ ___ ___
4
+# |   __|  _| -_| -_| . | . |     | . | . |   | -_|
5
+# |__|  |_| |___|___|___|___|_|_|_|___|___|_|_|___|
6
+#
7
+#                              Freedom in the Cloud
8
+#
9
+# Returns a health status for Tor
10
+#
11
+# License
12
+# =======
13
+#
14
+# Copyright (C) 2018 Bob Mottram <bob@freedombone.net>
15
+#
16
+# This program is free software: you can redistribute it and/or modify
17
+# it under the terms of the GNU Affero General Public License as published by
18
+# the Free Software Foundation, either version 3 of the License, or
19
+# (at your option) any later version.
20
+#
21
+# This program is distributed in the hope that it will be useful,
22
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
+# GNU Affero General Public License for more details.
25
+#
26
+# You should have received a copy of the GNU Affero General Public License
27
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
28
+
29
+PROJECT_NAME='freedombone'
30
+
31
+export TEXTDOMAIN=${PROJECT_NAME}-tor-health
32
+export TEXTDOMAINDIR="/usr/share/locale"
33
+
34
+d1=$(date --date="-10 min" "+%b %d %H:%M"):00
35
+d2=$(date "+%b %d %H:%M"):00
36
+ctr=0
37
+echo -n '' > /var/log/tor/notices_new.log
38
+while read -r line; do
39
+    datestr=$(echo "$line" | awk -F '.' '{print $1}')
40
+    if [[ "$datestr" > "$d1" && "$datestr" < "$d2" || "$datestr" =~ $d2 ]]; then
41
+        if [[ "$line" == *'Retrying'* ]]; then
42
+            ctr=$((ctr+1))
43
+        fi
44
+        echo "$line" >> /var/log/tor/notices_new.log
45
+    fi
46
+done < /var/log/tor/notices.log
47
+
48
+mv /var/log/tor/notices_new.log /var/log/tor/notices.log
49
+chown -R debian-tor:adm /var/log/tor
50
+
51
+if [ $ctr -gt 5 ]; then
52
+    echo $'Failed'
53
+    exit 0
54
+fi
55
+
56
+if [ $ctr -gt 0 ]; then
57
+    echo $'Poor'
58
+    exit 0
59
+fi
60
+
61
+echo $'Good'
62
+exit 0

+ 49
- 1
src/freedombone-utils-firewall Visa fil

32
 FIREWALL_DOMAINS=$HOME/${PROJECT_NAME}-firewall-domains.cfg
32
 FIREWALL_DOMAINS=$HOME/${PROJECT_NAME}-firewall-domains.cfg
33
 FIREWALL_EIFACE=eth0
33
 FIREWALL_EIFACE=eth0
34
 EXTERNAL_IPV4_ADDRESS=
34
 EXTERNAL_IPV4_ADDRESS=
35
+FIREFOX_TELEMETRY_IP='52.88.27.118'
35
 
36
 
36
 function save_firewall_settings {
37
 function save_firewall_settings {
37
     iptables-save > /etc/firewall.conf
38
     iptables-save > /etc/firewall.conf
47
     fi
48
     fi
48
 }
49
 }
49
 
50
 
51
+function block_firefox_telemetry {
52
+    # This shouldn't be needed on a server, but we'll do it anyway
53
+    # to be on the safe side
54
+    # Within firefox source code see submit_telemetry_data.py
55
+
56
+    if ! grep -q 'telemetry.mozilla' /etc/hosts; then
57
+	echo '127.0.0.1  telemetry.mozilla.org' >> /etc/hosts
58
+	echo '127.0.0.1  incoming.telemetry.mozilla.org' >> /etc/hosts
59
+    fi
60
+        
61
+    if grep -q "$FIREFOX_TELEMETRY_IP" /etc/firewall.conf; then
62
+        return
63
+    fi
64
+
65
+    iptables -A INPUT -s $FIREFOX_TELEMETRY_IP -j DROP
66
+    iptables -A OUTPUT -s $FIREFOX_TELEMETRY_IP -j DROP
67
+    save_firewall_settings
68
+}
69
+
50
 function firewall_block_bad_ip_ranges {
70
 function firewall_block_bad_ip_ranges {
51
     if [ "$INSTALLING_MESH" ]; then
71
     if [ "$INSTALLING_MESH" ]; then
52
         return
72
         return
340
     FIREWALL_FILENAME="${rootdir}/etc/systemd/system/meshfirewall.service"
360
     FIREWALL_FILENAME="${rootdir}/etc/systemd/system/meshfirewall.service"
341
     MESH_FIREWALL_SCRIPT=${rootdir}/usr/bin/mesh-firewall
361
     MESH_FIREWALL_SCRIPT=${rootdir}/usr/bin/mesh-firewall
342
 
362
 
363
+    if ! grep -q 'telemetry.mozilla' ${rootdir}/etc/hosts; then
364
+	echo '127.0.0.1       telemetry.mozilla.org' >> ${rootdir}/etc/hosts
365
+	echo '127.0.0.1       incoming.telemetry.mozilla.org' >> ${rootdir}/etc/hosts
366
+    fi
367
+
368
+    if ! grep -q 'facebook' ${rootdir}/etc/hosts; then
369
+	{ echo '127.0.0.1       www.facebook.com';
370
+	  echo '127.0.0.1       facebook.com';
371
+	  echo '127.0.0.1       static.ak.fbcdn.net';
372
+	  echo '127.0.0.1       www.static.ak.fbcdn.net';
373
+	  echo '127.0.0.1       login.facebook.com';
374
+	  echo '127.0.0.1       www.login.facebook.com';
375
+	  echo '127.0.0.1       fbcdn.net';
376
+	  echo '127.0.0.1       www.fbcdn.net';
377
+	  echo '127.0.0.1       fbcdn.com';
378
+	  echo '127.0.0.1       www.fbcdn.com';
379
+	  echo '127.0.0.1       static.ak.connect.facebook.com';
380
+	  echo '127.0.0.1       www.static.ak.connect.facebook.com'; } >> ${rootdir}/etc/hosts	
381
+    fi
382
+    
383
+    if ! grep -q 'google' ${rootdir}/etc/hosts; then
384
+	{ echo '127.0.0.1       www.google-analytics.com';
385
+	  echo '127.0.0.1       google-analytics.com';
386
+	  echo '127.0.0.1       ssl.google-analytics.com'; } >> ${rootdir}/etc/hosts
387
+    fi    
388
+    
343
     { echo '#!/bin/bash';
389
     { echo '#!/bin/bash';
344
       echo 'iptables -P INPUT ACCEPT';
390
       echo 'iptables -P INPUT ACCEPT';
345
       echo 'ip6tables -P INPUT ACCEPT';
391
       echo 'ip6tables -P INPUT ACCEPT';
387
       echo "iptables -A INPUT -p tcp --dport $TRACKER_PORT -j ACCEPT";
433
       echo "iptables -A INPUT -p tcp --dport $TRACKER_PORT -j ACCEPT";
388
       echo "ip6tables -A INPUT -p tcp --dport $TRACKER_PORT -j ACCEPT";
434
       echo "ip6tables -A INPUT -p tcp --dport $TRACKER_PORT -j ACCEPT";
389
       echo "iptables -A INPUT -p udp --dport 1900 -j ACCEPT";
435
       echo "iptables -A INPUT -p udp --dport 1900 -j ACCEPT";
390
-      echo "ip6tables -A INPUT -p udp --dport 1900 -j ACCEPT"; } > "$MESH_FIREWALL_SCRIPT"
436
+      echo "ip6tables -A INPUT -p udp --dport 1900 -j ACCEPT";
437
+      echo "iptables -A INPUT -s $FIREFOX_TELEMETRY_IP -j DROP";
438
+      echo "iptables -A OUTPUT -s $FIREFOX_TELEMETRY_IP -j DROP"; } > "$MESH_FIREWALL_SCRIPT"
391
     chmod +x "$MESH_FIREWALL_SCRIPT"
439
     chmod +x "$MESH_FIREWALL_SCRIPT"
392
 
440
 
393
     { echo '[Unit]';
441
     { echo '[Unit]';

+ 29
- 1
src/freedombone-utils-onion Visa fil

311
     mark_completed "${FUNCNAME[0]}"
311
     mark_completed "${FUNCNAME[0]}"
312
 }
312
 }
313
 
313
 
314
+function check_tor_health {
315
+    { echo '#!/bin/bash';
316
+      echo "status=\$(${PROJECT_NAME}-tor-health)";
317
+      echo "ADMIN_USER=\$(grep \"MY_USERNAME=\" ~/${PROJECT_NAME}.cfg | awk -F '=' '{print \$2}')";
318
+      echo "if [[ \"\$status\" == 'G'* ]]; then";
319
+      echo '    if [ -f /tmp/.torfailed ]; then';
320
+      echo '        rm /tmp/.torfailed';
321
+      echo "        tail -n 3 /var/log/tor/notices.log | mail -s \"[${PROJECT_NAME}] Tor status is now \$status\" \$ADMIN_USER@\$HOSTNAME";
322
+      echo '    fi';
323
+      echo '    exit 0';
324
+      echo 'fi';
325
+      echo 'if [ ! -f /tmp/.torfailed ]; then';
326
+      echo "    tail -n 3 /var/log/tor/notices.log | mail -s \"[${PROJECT_NAME}] Tor status is \$status\" \$ADMIN_USER@\$HOSTNAME";
327
+      echo "    echo \"\$status\" > /tmp/.torfailed";
328
+      echo 'else';
329
+      echo "    prev_status=\$(cat /tmp/.torfailed)";
330
+      echo "    if [[ \"\$prev_status\" != \"\$status\" ]]; then";
331
+      echo "        tail -n 3 /var/log/tor/notices.log | mail -s \"[${PROJECT_NAME}] Tor status is \$status\" \$ADMIN_USER@\$HOSTNAME";
332
+      echo "        echo \"\$status\" > /tmp/.torfailed";
333
+      echo '    fi';
334
+      echo 'fi'; } > /usr/bin/check_tor_health
335
+    chmod +x /usr/bin/check_tor_health
336
+
337
+    if ! grep -q 'check_tor_health' /etc/crontab; then
338
+        cron_add_mins 10 "/usr/bin/check_tor_health"
339
+    fi
340
+}
341
+
314
 function install_tor {
342
 function install_tor {
315
     if [[ $SYSTEM_TYPE == "mesh*" ]]; then
343
     if [[ $SYSTEM_TYPE == "mesh*" ]]; then
316
         return
344
         return
336
         echo '%include /etc/torrc.d' >> /etc/tor/torrc
364
         echo '%include /etc/torrc.d' >> /etc/tor/torrc
337
     fi
365
     fi
338
 
366
 
339
-    echo 'Log notice file /dev/null' > /etc/torrc.d/logging
367
+    echo 'Log notice file /var/log/tor/notices.log' > /etc/torrc.d/logging
340
     echo "AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes" > /etc/torrc.d/maxtraffic
368
     echo "AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes" > /etc/torrc.d/maxtraffic
341
 
369
 
342
     mark_completed "${FUNCNAME[0]}"
370
     mark_completed "${FUNCNAME[0]}"

+ 6
- 0
src/freedombone-utils-setup Visa fil

720
     function_check configure_firewall
720
     function_check configure_firewall
721
     configure_firewall
721
     configure_firewall
722
 
722
 
723
+    function_check block_firefox_telemetry
724
+    block_firefox_telemetry
725
+
723
     function_check configure_firewall_ping
726
     function_check configure_firewall_ping
724
     configure_firewall_ping
727
     configure_firewall_ping
725
 
728
 
971
     function_check install_tor
974
     function_check install_tor
972
     install_tor
975
     install_tor
973
 
976
 
977
+    function_check check_tor_health
978
+    check_tor_health
979
+
974
     function_check install_command_line_browser
980
     function_check install_command_line_browser
975
     install_command_line_browser
981
     install_command_line_browser
976
 
982
 

+ 13
- 0
tests/check-ssh.sh Visa fil

44
             exit 1
44
             exit 1
45
         fi
45
         fi
46
         ;;
46
         ;;
47
+    installed)
48
+	OPENSSH_SERVER=$(dpkg -s openssh-server | grep -i "Status:.*install.*ok.*installed" | wc -l)
49
+	OPENSSH_CLIENT=$(dpkg -s openssh-client | grep -i "Status:.*install.*ok.*installed" | wc -l)
50
+	if [ ${OPENSSH_SERVER} -eq 1 ]; then
51
+	    if [ ${OPENSSH_CLIENT} -eq 1 ]; then
52
+		:
53
+	    else
54
+		exit 1
55
+	    fi
56
+	else
57
+	    exit 1
58
+	fi	
59
+	;;    
47
     sshd_status)
60
     sshd_status)
48
         if systemctl status sshd | grep "Active:.*(running)";then
61
         if systemctl status sshd | grep "Active:.*(running)";then
49
             :
62
             :

+ 9
- 0
tests/output.sh Visa fil

1399
                   printf '\n######################\n\nSTIG-ID:RHEL-06-000224\n\nVulnerability Discussion: Due to its usage for maintenance and security-supporting tasks, enabling the cron daemon is essential.\n\nFix text: The "crond" service is used to execute commands at preconfigured times. It is required by almost all systems to perform necessary maintenance tasks, such as notifying root of system activity. The "crond" service can be enabled with the following commands:\n\n#update-rc.d cron defaults\nservice cron start\n\n######################\n\n' >> $LOG
1399
                   printf '\n######################\n\nSTIG-ID:RHEL-06-000224\n\nVulnerability Discussion: Due to its usage for maintenance and security-supporting tasks, enabling the cron daemon is essential.\n\nFix text: The "crond" service is used to execute commands at preconfigured times. It is required by almost all systems to perform necessary maintenance tasks, such as notifying root of system activity. The "crond" service can be enabled with the following commands:\n\n#update-rc.d cron defaults\nservice cron start\n\n######################\n\n' >> $LOG
1400
               fi
1400
               fi
1401
               ;;
1401
               ;;
1402
+    SV-86857r1_rule) if [ "$3" = "en" ]; then
1403
+			 log_msg $2 'OpenSSH server and client must be installed.'
1404
+		     else
1405
+			 log_msg $2 '必须安装OpenSSH服务器和客户端'
1406
+		     fi		     
1407
+		     if [ $2 -ne 0 ];then
1408
+			 printf '\n######################\n\nWithout protection of the transmitted information, confidentiality and integrity may be compromised because unprotected communications can be intercepted and either read or altered. \n\nThis requirement applies to both internal and external networks and all types of information system components from which information can be transmitted (e.g., servers, mobile devices, notebook computers, printers, copiers, scanners, and facsimile machines). Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification. \n\nProtecting the confidentiality and integrity of organizational information can be accomplished by physical means (e.g., employing physical distribution systems) or by logical means (e.g., employing cryptographic techniques). If physical means of protection are employed, logical means (cryptography) do not have to be employed, and vice versa.\n\n######################\n\n' >> $LOG
1409
+		     fi
1410
+		     ;;
1402
     V-38607)  if [ "$3" = "en" ]; then
1411
     V-38607)  if [ "$3" = "en" ]; then
1403
                   log_msg $2 'The SSH daemon must be configured to use only the SSHv2 protocol.'
1412
                   log_msg $2 'The SSH daemon must be configured to use only the SSHv2 protocol.'
1404
               else
1413
               else