Add prefs.ShieldsUp and --shields-up option.
This sets a default packet filter that blocks all incoming requests, giving end users more control over who can get into their machine, even if the admin hasn't set any central ACLs. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
This commit is contained in:
+5
-5
@@ -20,7 +20,7 @@ func fieldsOf(t reflect.Type) (fields []string) {
|
||||
}
|
||||
|
||||
func TestPrefsEqual(t *testing.T) {
|
||||
prefsHandles := []string{"ControlURL", "RouteAll", "AllowSingleHosts", "CorpDNS", "WantRunning", "UsePacketFilter", "AdvertiseRoutes", "NotepadURLs", "DisableDERP", "Persist"}
|
||||
prefsHandles := []string{"ControlURL", "RouteAll", "AllowSingleHosts", "CorpDNS", "WantRunning", "ShieldsUp", "AdvertiseRoutes", "NotepadURLs", "DisableDERP", "Persist"}
|
||||
if have := fieldsOf(reflect.TypeOf(Prefs{})); !reflect.DeepEqual(have, prefsHandles) {
|
||||
t.Errorf("Prefs.Equal check might be out of sync\nfields: %q\nhandled: %q\n",
|
||||
have, prefsHandles)
|
||||
@@ -123,13 +123,13 @@ func TestPrefsEqual(t *testing.T) {
|
||||
},
|
||||
|
||||
{
|
||||
&Prefs{UsePacketFilter: true},
|
||||
&Prefs{UsePacketFilter: false},
|
||||
&Prefs{ShieldsUp: true},
|
||||
&Prefs{ShieldsUp: false},
|
||||
false,
|
||||
},
|
||||
{
|
||||
&Prefs{UsePacketFilter: true},
|
||||
&Prefs{UsePacketFilter: true},
|
||||
&Prefs{ShieldsUp: true},
|
||||
&Prefs{ShieldsUp: true},
|
||||
true,
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user