Authenticating the Gremlin Agent
Before you can start using Gremlin, you need to authenticate the Agent with your Gremlin team. This documentation page covers the various methods of authenticating the Agent.
Agent authentication methods
There are three methods for authenticating clients with Gremlin:
- (Recommended) The Client configuration file is a pre-generated configuration file containing everything needed to authenticate a Gremlin Agent, including a team ID.
- Signature authentication requires supplying a public and private ECDSA certificate-key pair to Gremlin clients. This certificate pair is created from the Gremlin web app, and can be downloaded again at any time, but expires 1 year from the date of creation.
- Secret authentication involves a secret string value that Gremlin clients use to prove their identity. Secrets are created from the Gremlin UI, and are like passwords. They can never be retrieved from Gremlin after creation; they can only be reset.
The recommended method is using the client configuration file, but the other authentication methods are available for teams that wish to use them.
Client Configuration File
Gremlin automatically generates a pre-formatted configuration file containing everything you need to authenticate, including your team ID. It uses signature-based authentication to generate a private and public key pair and embeds those keys into a YAML file, which you can use to authenticate your Agents.
To create a client configuration file:
- Access the Team Settings page in the Gremlin web app.
- Click the Configuration tab.
- On the Client Configuration File line, click Download to download the file. You'll receive a file named
config.yaml
. - Optionally, make any additional configurations to the
config.yaml
file. - Copy the contents of the file into the
/etc/gremlin/config.yaml
file (or simply overwrite the existing file). - Restart the
gremlind
service.
Signature-based authentication
Download a certificate pair
To generate a certificate pair:
- Navigate to Team Settings in the Gremlin web app.
- Click on the Configuration tab.
- On the Certificates line, click Create to create a new certificate.
- Click Download to download your certificates. The downloaded zip file contains both a public-key certificate and a matching private key.
- Unzip the file, then read the next section to configure the clients.
Configure clients with certificate pair
To configure Gremlin clients for signature authentication, follow one of the advanced configuration methods:
- set
team_id
,team_certificate
, andteam_private_key
in yourconfig.yaml
1#/etc/gremlin/config.yaml2team_id: 11111111-1111-1111-1111-1111111111113team_certificate: file:///var/lib/gremlin/cert.pem4team_private_key: file:///var/lib/gremlin/key.pem
- or pass environment variables
GREMLIN_TEAM_ID
,GREMLIN_TEAM_CERTIFICATE_OR_FILE
, andGREMLIN_TEAM_PRIVATE_KEY_OR_FILE
directly to thegremlind
process
1# export these to the gremlind process or save them to /etc/default/gremlind (used by Systemd and SysV)2GREMLIN_TEAM_ID=11111111-1111-1111-1111-1111111111113GREMLIN_TEAM_CERTIFICATE_OR_FILE=file:///var/lib/gremlin/cert.pem4GREMLIN_TEAM_PRIVATE_KEY_OR_FILE=file:///var/lib/gremlin/key.pem
Rotating expiring certificates
You must be a Team or Company Manager of your Gremlin account to manage certificates.
All certificates expire one year after creation. Before the expiration date, you must create a new certificate, reconfigure all clients with it, and delete the old certificate. As the expiration date draws near, the Gremlin web app will display a warning about it.
To create a new certificate, simply click the Create New button next to your existing certificate. Now that you have two certificates, you cannot download the older certificate (though all clients still configured with it may still use it to authenticate), and you cannot create a third certificate. Make sure you move all clients to the new certificate before the old one expires.
Secret-based authentication
Create a secret
To create a new secret:
- Navigate to Team Settings in the Gremlin web app.
- Click on the Configuration tab.
- On the Secret Key line, click Create to create a new secret key, then read the next section to configure your Agents.
If a secret already exists, you must reset the existing secret. If you reset the secret, you will need to apply the new secret to any existing clients.
Configure clients with secret
To configure Gremlin clients for secret authentication, follow one of the [advanced configuration] (/docs/getting-started/advanced-configuration/) methods:
- set
team_id
andteam_secret
in yourconfig.yaml
1team_id: 11111111-1111-1111-1111-1111111111112team_secret: 11111111-1111-1111-1111-111111111111
- or pass environment variables
GREMLIN_TEAM_ID
andGREMLIN_TEAM_SECRET
directly to thegremlind
process.
1# export these to the gremlind process or save them to /etc/default/gremlind (used by Systemd and SysV)2GREMLIN_TEAM_ID=11111111-1111-1111-1111-1111111111113GREMLIN_TEAM_SECRET=11111111-1111-1111-1111-111111111111
Additionally, secret authentication can also be set up via gremlin init
1gremlin init --tag service=my-api --tag service-version=1.0.0 --tag service-type=http
If secret-based auth is successful, the client will create a hidden file, .credentials
in the gremlin
user's home directory. This file contains an authentication token that gremlind
uses to connect to the Gremlin Control Plane.
Verifying Gremlin Agent authentication
To verify that your Gremlin Agents are connected to the Gremlin Control Plane, open the Agents page in the Gremlin web app. If your system doesn't appear there, the next step is to ensure that the Gremlin Agent is running.
FOr Linux hosts, run the following command:
1sudo systemctl status gremlind
For Windows hosts, run the following command:
1Get-Service gremlind
The output from either of these commands should show the service as Running
.
Next, use gremlin check auth
to check the Gremlin Agent's authentication status:
1gremlin check auth
If the Gremlin Agent authenticated successfully, the output will be similar to the following:
1auth2====================================================3Auth Input Type : Certificate4API Response : OK
If not, the output will explain why the Gremlin Agent was unable to authenticate:
1auth2====================================================3Auth Input Type : No valid auth found4========= Identification ============:5Team ID Source : Team ID not found6Gremlin Identifier : [Host identifier]7Gremlin Identifier Source : Not supplied explicitly, using the default8========= Secret/Token Info =========:9Team Secret Source : Team Secret not found10.credentials valid : /var/lib/gremlin/.credentials file not found11========= Certificate Info ==========:12Team Certificate Source : Team Certificate not found13========= Private Key Info ==========:14Team Private Key Source : Team Private Key not found
If you're having trouble authenticating, see the troubleshooting section below.
Releasing client certificates
There are three different methods you can use to release client certificates:
- Gremlin Logout command - From the host, you can log out of the client using the command "gremlin logout". This method allows you to remove the authorization from our server but keep the binaries in place for future use. Once logged out, the license should be released within a few minutes for consumption by other clients.
- WebUI deactivation option - From the WebUI, you can deactivate the client to release the license. This will prevent the host from being used in future experiments until it is reactivated.
- Uninstalling Gremlin client from the host - This method is similar to option 1. By removing the binaries, the host will no longer communicate with our service and the license will be released for future consumption.
Once any of these options have been performed, it may take a few minutes for new clients to use the newly released entitlements. You can view the details of which teams have active clients for a given month by navigating to Gremlin Reports within the Gremlin web app. The Active Clients metric on this page is cumulative for any active clients that may have authenticated.
Gremlin .credentials file
When secret-based authentication is used and the Gremlin agent successfully authenticates against the Gremlin Control Plane, the Gremlin agent creates a new file named /var/lib/gremlin/.credentials
(C:\ProgramData\Gremlin\Agent\.credentials
on a Windows-based install). This file stores temporary session and authorization data. Sessions are valid for twelve hours. After twelve hours (or if the session is ever invalidated), the agent creates a new .credentials
file in the same location. It also assigns the file to user ID and group ID (uid:gid) gremlin:gremlin
and sets the file's permissions to 660.
Note that this file isn't created when using certificate-based authentication.
Troubleshooting
If you're having problems authenticating the agent, see the Authentication FAQ in the Gremlin Knowledge Base.
Configuring Gremlin
Once you've successfully authenticated, continue to Configuring Gremlin to complete Agent setup.