Gardience Documentation gardience.com →
Docs / Using Gardience

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:

TargetHow Gardience reaches itWhat it needs
Agentless Linux machineSSHA Machine over SSH credential, and its host key confirmed once
Agentless Windows machineWinRM (HTTP 5985 or HTTPS 5986)A Windows over WinRM credential
Network deviceAnsible's network connection (NETCONF for Juniper)The device under Machines > Network devices, and a change credential
Cloud and Kubernetes APIsTasks on localhost with the credential in their environmentAn 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.

TypeFieldsWhat a run gets
Machine over SSHUser, password or private key, sudo passwordSSH sign-in; playbooks run as root through sudo, as they do on enrolled machines
Windows over WinRMUser, password, NTLM or Kerberos, HTTPS, certificate checkWinRM sign-in
Network deviceUser, password or key, enable passwordSign-in, and enable mode on Cisco
Amazon Web ServicesAccess key, secret key, session token, regionAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION
Microsoft AzureSubscription, tenant, client ID, client secretAZURE_SUBSCRIPTION_ID, AZURE_TENANT, AZURE_CLIENT_ID, AZURE_SECRET
VMware vCenterAddress, user, password, certificate checkVMWARE_HOST, VMWARE_USER, VMWARE_PASSWORD, VMWARE_VALIDATE_CERTS
Kuberneteskubeconfig file, contextK8S_AUTH_KUBECONFIG (a private file), K8S_AUTH_CONTEXT
Google CloudService account key, projectGCP_AUTH_KIND, GCP_SERVICE_ACCOUNT_FILE (a private file), GCP_PROJECT

Agentless machines

#
  1. Choose Agentless machines > Add a machine: a name, Linux or Windows, its address and port, a credential, and tags (optional, they work like groups).
  2. 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:

CheckThe fix
NET-01 TelnetSSH only on the management lines (Telnet off on NX-OS, Arista, and Junos)
NET-02 Idle sessionsSessions end after the minutes you choose (15 or less)
NET-03 BannerThe login banner you type
NET-04 LoggingLogs sent to the server you name
NET-05 TimeThe time server you name
NET-08 HTTP managementThe HTTP server, NX-API over HTTP, eAPI over HTTP, or J-Web over HTTP turned off
NET-11 Sign-in lockoutSign-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:

Leave the node group empty to run only on these. Every run, wherever it goes:

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.

Gardience by Bouziden Management LLC.