-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kevin Fox <[email protected]>
- Loading branch information
Showing
4 changed files
with
64 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
module github.com/spiffe/k8s-spiffe-workload-auth-config | ||
|
||
go 1.22 | ||
go 1.23.2 | ||
|
||
require ( | ||
github.com/Microsoft/go-winio v0.6.2 // indirect | ||
github.com/go-jose/go-jose/v4 v4.0.4 // indirect | ||
github.com/spiffe/go-spiffe/v2 v2.4.0 // indirect | ||
github.com/spiffe/spire v1.11.0 // indirect | ||
github.com/zeebo/errs v1.3.0 // indirect | ||
golang.org/x/crypto v0.26.0 // indirect | ||
golang.org/x/net v0.28.0 // indirect | ||
golang.org/x/sys v0.24.0 // indirect | ||
golang.org/x/text v0.17.0 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect | ||
golang.org/x/crypto v0.28.0 // indirect | ||
golang.org/x/net v0.30.0 // indirect | ||
golang.org/x/sys v0.26.0 // indirect | ||
golang.org/x/text v0.19.0 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect | ||
google.golang.org/grpc v1.67.1 // indirect | ||
google.golang.org/protobuf v1.34.2 // indirect | ||
google.golang.org/protobuf v1.35.1 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[Unit] | ||
Description=Kubernetes SPIFFE Workload Authentication Configuration | ||
PartOf=spire-server.target | ||
After=network-online.target local-fs.target time-sync.target | ||
Before=remote-fs-pre.target | ||
Wants=network-online.target local-fs.target time-sync.target remote-fs-pre.target | ||
StartLimitIntervalSec=0 | ||
|
||
[Service] | ||
WorkingDirectory=/tmp | ||
RuntimeDirectoryPreserve=true | ||
EnvironmentFile=-/etc/spiffe/default-trust-domain.env | ||
EnvironmentFile=-/etc/spiffe/k8s-spiffe-workload-auth-config.env | ||
Environment="SPIFFE_ENDPOINT_SOCKET=unix:///var/run/spire/agent/sockets/main/public/api.sock" | ||
ExecStart=/bin/k8s-spiffe-workload-auth-config /etc/kubernetes/auth-config.yaml /etc/kubernetes/pki/auth-config.yaml | ||
LockPersonality=true | ||
MemoryDenyWriteExecute=true | ||
NoNewPrivileges=true | ||
PrivateDevices=false | ||
# Needed by plugins | ||
PrivateTmp=false | ||
ProtectControlGroups=true | ||
ProtectHome=true | ||
ProtectHostname=true | ||
ProtectKernelLogs=true | ||
ProtectKernelModules=true | ||
ProtectKernelTunables=true | ||
ProtectSystem=strict | ||
ReadOnlyPaths=/ | ||
ReadWritePaths=/etc/kubernetes | ||
Restart=always | ||
RestartSec=5s | ||
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK | ||
RestrictNamespaces=true | ||
RestrictRealtime=yes | ||
RestrictSUIDSGID=yes | ||
TasksMax=infinity | ||
|
||
[Install] | ||
WantedBy=kubelet.service |