Skip to content

Commit

Permalink
Enable http2 DOS mitigations for unauthenticated clients
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Greene <greene.al1991@gmail.com>
  • Loading branch information
awgreene authored and tmshort committed Oct 26, 2023
1 parent a217efc commit 9ec03f0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/package-server/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import (
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
genericfeatures "k8s.io/apiserver/pkg/features"
genericserver "k8s.io/apiserver/pkg/server"
genericoptions "k8s.io/apiserver/pkg/server/options"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
Expand Down Expand Up @@ -194,6 +196,11 @@ func (o *PackageServerOptions) Run(ctx context.Context) error {
log.SetLevel(log.DebugLevel)
}

// Enables http2 DOS mitigations for unauthenticated clients.
utilfeature.DefaultMutableFeatureGate.SetFromMap(map[string]bool{
string(genericfeatures.UnauthenticatedHTTP2DOSMitigation): true,
})

// Grab the config for the API server
config, err := o.Config(ctx)
if err != nil {
Expand Down

0 comments on commit 9ec03f0

Please sign in to comment.