Credentials and targets
Most machines are best enrolled with the Gardience agent: you get patching, hardening, CVE checks, and evidence, and playbooks run with no SSH keys or WinRM. Automation > Credentials and targets covers what the agent cannot reach:
| Target | How Gardience reaches it | What it needs |
|---|---|---|
| Agentless Linux machine | SSH | A Machine over SSH credential, and its host key confirmed once |
| Agentless Windows machine | WinRM (HTTP 5985 or HTTPS 5986) | A Windows over WinRM credential |
| Network device | Ansible's network connection (NETCONF for Juniper) | The device under Machines > Network devices, and a change credential |
| Cloud and Kubernetes APIs | Tasks on localhost with the credential in their environment | An AWS, Azure, VMware vCenter, Google Cloud, or Kubernetes credential |
You keep writing ordinary Ansible. A playbook that runs on enrolled machines runs on agentless ones unchanged.
Credentials
#Choose Credentials > Add a credential, pick its type, and fill in its fields. Admins add, change, and remove credentials.
- Secret fields (passwords, private keys, kubeconfig files, client secrets) are sealed with the vault key and never shown again. Leave one empty when you edit a credential to keep the value already saved.
- Who else may use it: admins can always use a credential. Name anyone else who may run playbooks with it.
- A credential in use by a machine or a device cannot be removed until you change them.
| Type | Fields | What a run gets |
|---|---|---|
| Machine over SSH | User, password or private key, sudo password | SSH sign-in; playbooks run as root through sudo, as they do on enrolled machines |
| Windows over WinRM | User, password, NTLM or Kerberos, HTTPS, certificate check | WinRM sign-in |
| Network device | User, password or key, enable password | Sign-in, and enable mode on Cisco |
| Amazon Web Services | Access key, secret key, session token, region | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION |
| Microsoft Azure | Subscription, tenant, client ID, client secret | AZURE_SUBSCRIPTION_ID, AZURE_TENANT, AZURE_CLIENT_ID, AZURE_SECRET |
| VMware vCenter | Address, user, password, certificate check | VMWARE_HOST, VMWARE_USER, VMWARE_PASSWORD, VMWARE_VALIDATE_CERTS |
| Kubernetes | kubeconfig file, context | K8S_AUTH_KUBECONFIG (a private file), K8S_AUTH_CONTEXT |
| Google Cloud | Service account key, project | GCP_AUTH_KIND, GCP_SERVICE_ACCOUNT_FILE (a private file), GCP_PROJECT |
Agentless machines
#- Choose Agentless machines > Add a machine: a name, Linux or Windows, its address and port, a credential, and tags (optional, they work like groups).
- Choose Test. For Linux, Gardience reads the machine's SSH host key and shows its fingerprint: compare it with the machine (
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub) and trust it. Then Gardience signs in once with Ansible's ping (win_ping on Windows).
A Linux machine runs no playbook until its host key is confirmed. If it later answers with a different key (a rebuilt machine, or someone in the middle), every run to it is refused and Test says so; test again to read the new key and decide.
Names must differ from enrolled machines and network devices: one playbook can reach all of them.
Network devices
#Network devices are added under Machines > Network devices, where Gardience reads them every day with a read-only account. To let playbooks change one, give it a change credential under Network devices here. The daily checks keep their read-only account.
Playbooks run on Cisco IOS and IOS XE, Cisco NX-OS, Arista EOS, and Juniper Junos (over NETCONF on port 830: turn it on with set system services netconf ssh). FortiGate stays read-only for now. The device's SSH host key, kept by the daily check, is pinned for every run.
Fix flagged settings
#A device with a change credential has Fix flagged settings. Gardience writes a playbook from the device's failing checks:
| Check | The fix |
|---|---|
| NET-01 Telnet | SSH only on the management lines (Telnet off on NX-OS, Arista, and Junos) |
| NET-02 Idle sessions | Sessions end after the minutes you choose (15 or less) |
| NET-03 Banner | The login banner you type |
| NET-04 Logging | Logs sent to the server you name |
| NET-05 Time | The time server you name |
| NET-08 HTTP management | The HTTP server, NX-API over HTTP, eAPI over HTTP, or J-Web over HTTP turned off |
| NET-11 Sign-in lockout | Sign-in blocked for 15 minutes after 3 failures |
Passwords (NET-06), SNMP communities (NET-07), central sign-in (NET-09), management access lists (NET-10), and firmware (NET-12) need decisions only you can make, and are listed for you instead.
Preview the playbook shows it. Run in check mode runs it without changing the device and shows what would change. Run it changes the device and saves the running configuration. Each fix playbook is kept, with history, in the network-fixes local project, and each run goes through approvals and the audit log like any other.
Running a playbook beyond the agent
#The Run an Ansible playbook (Windows and Linux, no WinRM) runbook has two more fields:
- Also run on agentless machines or network devices: names, or
tag:NAMEfor every agentless machine with that tag. - Cloud or Kubernetes credentials for tasks on localhost: credential names, one per cloud.
Leave the node group empty to run only on these. Every run, wherever it goes:
- goes through the same runbook path as every other change: approvals, the audit log, and the run's results per host;
- gets its secrets only in the playbook runner, for that run, in a private folder deleted afterwards;
- shows
********in place of any secret value that appears in the output; - reports its tasks on
localhost(cloud and Kubernetes calls) like any host, so a failure there fails the run.
Change windows and locks apply to enrolled machines; for agentless machines, devices, and clouds, the credential decides who may reach them.
Kubernetes and OpenShift
#A Kubernetes credential works with any cluster whose API speaks Kubernetes, OpenShift included: give it a kubeconfig for a service account with only the rights its playbooks need. The demo project's k8s_app.yml creates a namespace, settings, a Deployment, and a Service, and on OpenShift a Route too, then reads the Deployment back. It is tested on Kubernetes 1.37 and on OpenShift (MicroShift 4.19, OKD) with a service account that can edit namespaces and nothing on the cluster as a whole; its token never appears in a run's log.
Shipped with Gardience
#The playbook runner includes, for air-gapped installs too: ansible.netcommon, ansible.utils, cisco.ios, cisco.nxos, arista.eos, junipernetworks.junos, fortinet.fortios, kubernetes.core, amazon.aws, azure.azcollection, community.vmware, vmware.vmware, google.cloud, netbox.netbox, and servicenow.itsm, with the Python libraries they need. A Git project can bring others in its collections/requirements.yml.