credentials-fetcher is a Linux daemon that retrieves gMSA credentials from Active Directory over LDAP. It creates and refreshes kerberos tickets from gMSA credentials. Kerberos tickets can be used by containers to run apps/services that authenticate using Active Directory.
# Install Go
sudo dnf install -y golang make krb5-devel
# Install golangci-lint (Optional)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
# Install gosec (Optional)
go install github.com/securego/gosec/v2/cmd/gosec@latest
# Add to PATH
export PATH=$PATH:$(go env GOPATH)/bin
Building from Source
Quick Build
make build
The binary will be created at bin/credentials-fetcherd.
Build Options
Command
Description
make build
Build the binary
make lint-check
Run golangci-lint
make security-check
Run gosec security scanner
make release-strict
Full build with security checks, linting, and race detection
make cf-install
Build and install to system (requires sudo)
make cf-create-service
Generate systemd service file
Build Flags
Enable debugging symbols:
ENABLE_DEBUGGING=1 make build
Enable code coverage:
CODE_COVERAGE=1 make build
Manual Installation
After building:
sudo make cf-install
This installs:
Binary to /usr/sbin/credentials-fetcher
Service file to /usr/lib/systemd/system/credentials-fetcher.service
Config to /etc/credentials-fetcher.conf
Please note the name of the binary is updated to credentials-fetcher
Installation
Installing the latest version of credentials-fetcher
dnf install credentials-fetcher
Verify Installation
systemctl status credentials-fetcher
credentials-fetcher --version
Configuration
The daemon is configured via /etc/credentials-fetcher.conf.
For ECS/Fargate (managed modes): No configuration needed. Default settings work out of the box.
For standalone mode: All options remain optional for basic lease operations. Configuration is only needed if you require automatic credential renewal in non-domain joined standalone deployments.
Configuration Options
Option
Type
Default
Description
RunRenewalNonDomainJoined
bool
false
Enable automatic credential renewal for non-domain joined standalone mode
CFGmsaSecretName
string
“”
AWS Secrets Manager secret name containing AD credentials
LDAPSearchTimeout
int
5
LDAP search timeout in seconds
Default Configuration (ECS/Fargate/Standalone)
Works for all deployment modes without modification:
Setup gMSA accounts using instructions here. Both domain-joined and non-domain joined use cases are supported. In Fargate, only non-domain joined is supported.
Setting up domain credentials to retrieve gMSA password
In non domain joined modes, the AD User credentials need to be stored in a secret store that will be retrieved by the daemon. We use AWS Secret Manager for this.
Save the AD User credentials to AWS secrets manager
cd tests/test_scripts
python -m grpc_tools.protoc --proto_path=../../internal/grpc/proto --python_out=. --grpc_python_out=. credentialsfetcher.proto
Start credentials-fetcher daemon:
sudo systemctl start credentials-fetcher
Running Tests
Domain-joined mode:
# Replace {CREDSPEC_PLACEHOLDER} with your credspec JSON
python add_kerberos_lease_test.py
# Delete lease (replace {LEASE_ID_PLACEHOLDER} with returned lease_id)
python delete_kerberos_lease_test.py
Non-domain-joined mode:
# Replace {CREDSPEC_PLACEHOLDER} and {PASSWORD_PLACEHOLDER} with actual values
python add_non_domain_joined_kerberos_lease_test.py
# Test renewal
python renew_non_domain_joined_kerberos_lease.py
Expected output: Scripts print GRPC_TEST_RESULT: followed by JSON with success status and lease details.
Credentials Fetcher
credentials-fetcher is a Linux daemon that retrieves gMSA credentials from Active Directory over LDAP. It creates and refreshes kerberos tickets from gMSA credentials. Kerberos tickets can be used by containers to run apps/services that authenticate using Active Directory.
This daemon works in a similar way as ccg.exe and the gMSA plugin in Windows as described in - https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/manage-serviceaccounts#gmsa-architecture-and-improvements
Table of Contents
Prerequisites
Supported Platforms: Amazon Linux 2023 (recommended), Fedora 41+
Required Dependencies:
For Domain-Joined Mode (additional):
Build Dependencies (AL2023):
Building from Source
Quick Build
The binary will be created at
bin/credentials-fetcherd.Build Options
make buildmake lint-checkmake security-checkmake release-strictmake cf-installmake cf-create-serviceBuild Flags
Enable debugging symbols:
Enable code coverage:
Manual Installation
After building:
This installs:
/usr/sbin/credentials-fetcher/usr/lib/systemd/system/credentials-fetcher.service/etc/credentials-fetcher.confPlease note the name of the binary is updated to
credentials-fetcherInstallation
Installing the latest version of credentials-fetcher
Verify Installation
Configuration
The daemon is configured via
/etc/credentials-fetcher.conf.For ECS/Fargate (managed modes): No configuration needed. Default settings work out of the box.
For standalone mode: All options remain optional for basic lease operations. Configuration is only needed if you require automatic credential renewal in non-domain joined standalone deployments.
Configuration Options
RunRenewalNonDomainJoinedCFGmsaSecretNameLDAPSearchTimeoutDefault Configuration (ECS/Fargate/Standalone)
Works for all deployment modes without modification:
Standalone Non-Domain-Joined with Auto-Renewal
Only needed for standalone deployments requiring automatic credential renewal:
AWS Secrets Manager secret format:
Setting up testing environment
Setting up gMSA accounts
Setup gMSA accounts using instructions here. Both domain-joined and non-domain joined use cases are supported. In Fargate, only non-domain joined is supported.
Setting up domain credentials to retrieve gMSA password
In non domain joined modes, the AD User credentials need to be stored in a secret store that will be retrieved by the daemon. We use AWS Secret Manager for this.
Save the AD User credentials to AWS secrets manager
Next, on the EC2 instance where credentials-fetcher is installed, navigate to /etc/credentials-fetcher.conf and provide the secrets manager name
For domain joined modes, the host principle needs to be part of the group that is allowed to retrieve the managed password in AD setup.
Testing
Once gMSA accounts are created, use the test scripts in
tests/test_scripts/to validate kerberos ticket functionality.Quick Test Setup
Install Python dependencies:
Generate gRPC Python files:
Start credentials-fetcher daemon:
Running Tests
Domain-joined mode:
Non-domain-joined mode:
Expected output: Scripts print
GRPC_TEST_RESULT:followed by JSON with success status and lease details.Sample Credspec
Domain-Joined Mode:
Non-Domain-Joined Mode:
Service Management
Troubleshooting
Common Issues
Service won’t start:
sudo journalctl -u credentials-fetcher/etc/credentials-fetcher.conf/var/credentials-fetcher/socketLDAP connection failures:
ldapsearch -H ldap://your-dc.contoso.comnslookup your-dc.contoso.comjournalctl -u credentials-fetcher | grep -i ldap(automatic retry with debug on failure)Kerberos ticket issues:
klist -c /var/credentials-fetcher/krbdir/*/krb5cc_*timedatectl statuskinit username@DOMAIN.COMTest script failures:
systemctl status credentials-fetcherls -la /var/credentials-fetcher/socket/ls -la tests/test_scripts/*_pb2.pyLog Locations
journalctl -u credentials-fetcher/var/credentials-fetcher/logging/var/credentials-fetcher/krbdir