Skip to content

Commit

Permalink
fix: use full dns name
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiebens committed Apr 27, 2022
1 parent 9035a8e commit a732a42
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cmd/server/tailscale_attestor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ package main
import (
"context"
"fmt"
"sync"
"tailscale.com/util/dnsname"

"github.com/hashicorp/hcl"
"github.com/spiffe/go-spiffe/v2/spiffeid"
"github.com/spiffe/spire-plugin-sdk/pluginmain"
nodeattestorv1 "github.com/spiffe/spire-plugin-sdk/proto/spire/plugin/server/nodeattestor/v1"
configv1 "github.com/spiffe/spire-plugin-sdk/proto/spire/service/common/config/v1"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"sync"
"tailscale.com/client/tailscale"
"tailscale.com/ipn/ipnstate"
"tailscale.com/types/key"
Expand Down Expand Up @@ -72,8 +70,7 @@ func (p *Plugin) Attest(stream nodeattestorv1.NodeAttestor_AttestServer) error {
return fmt.Errorf("unable to find provided client key")
}

sanitizeHostname := dnsname.SanitizeHostname(node.HostName)
id, err := agentID(c.trustDomain, fmt.Sprintf("/%s/%s", PluginName, sanitizeHostname))
id, err := agentID(c.trustDomain, fmt.Sprintf("/%s/%s", PluginName, node.DNSName))
if err != nil {
return err
}
Expand Down

0 comments on commit a732a42

Please sign in to comment.