Polycrate API for Teams: Centralized Monitoring and Remote Triggering
TL;DR The Polycrate API transforms individual workspaces into a team platform: all workspaces, …
Diese Serie zeigt Schritt für Schritt, wie Ansible mit Polycrate zu einer strukturierten, teilbaren und compliance-fähigen Automatisierungsplattform wird – von den Grundlagen bis zu Enterprise-Szenarien.
Both NIS-2 and GDPR increase the pressure for traceable, documented IT operational behavior:
For orientation on regulatory frameworks and how to operationalize them, see the Compliance Compass landing page.
In security incidents, one of the first questions that almost always arises is:
Who accessed which server via SSH and when?
With a classic tool mix – a bit of Ansible, some manual SSH, local ~/.bash_history, scattered syslog entries – this question is often only answerable with great effort, sometimes not at all.
Polycrate addresses this precisely: It makes Ansible, SSH access, and workspace synchronization auditable – without your team having to deploy additional agents or special tools on all servers. Everything runs through the Polycrate CLI and the Polycrate API, see API documentation and SSH integration.
Before diving into the details of the audit trail, let’s briefly outline what Polycrate generally offers:
kubectl, Helm & Co. run in a container managed by Polycrate. You don’t need to install Ansible locally, juggle Python versions, and face fewer supply chain risks. Everyone on the team works with the same, reproducible toolchain – a core principle of good platform engineering.On this basis, Polycrate adds an additional layer: a central audit trail for all operational actions, accessible and integrable via the Polycrate API.
In many teams, the day-to-day looks like this:
git pull or distributed via copy/paste.With plain Ansible, at best you have:
Polycrate fills these gaps:
This creates a complete operations history, where automated and manual interventions appear equally.
SSH is the classic for incident response questions – and one of the biggest blind spots in many environments.
With Polycrate, an SSH session typically runs like this:
polycrate ssh server01.acme-corp.comDetails on the SSH function can be found in the SSH documentation.
When you use SSH via Polycrate, the following happens in the background:
Typical dataset in the API (simplified example):
{
"type": "ssh_session",
"id": "c5f4411d-641a-4b0a-8ee6-291d1c725c20",
"workspace": "acme-corp-automation",
"user": "alice",
"cli_instance_id": "cli-8f3891b2",
"host": {
"inventory_name": "server01.acme-corp.com",
"ansible_host": "10.0.12.34",
"hostname_reported": "srv-web-01"
},
"started_at": "2026-03-24T10:12:03Z",
"ended_at": "2026-03-24T10:27:45Z",
"duration_seconds": 942,
"exit_code": 0
}This allows you to specifically ask in an incident:
server01.acme-corp.com during period X–Y?Important:
The SSH connection itself still runs via SSH client, not through an API tunnel. Polycrate uses the API only for the audit event – no additional agent installation on the target systems.
In comparison, with plain Ansible you would have to:
With Polycrate, a consistent entry point (polycrate ssh) is sufficient – the rest happens automatically.
Polycrate workspaces are the unit in which you manage blocks, inventories, and configuration, see workspaces documentation.
Typical workflow:
polycrate workspace syncThis usually involves a Git pull/push or a sync against a central repository. Polycrate logs via the API, among other things:
Example of an API entry:
{
"type": "workspace_sync",
"id": "0c19e60f-9d4f-4f3b-b9fb-909cb7ab2f37",
"workspace": "acme-corp-automation",
"user": "bob",
"git": {
"branch": "main",
"before_sha": "dc3a1f7",
"after_sha": "a42b9e1"
},
"encryption": {
"enabled": true,
"key_id": "age1qg4...",
"status": "ok"
},
"result": "success",
"timestamp": "2026-03-24T08:02:11Z"
}This is invaluable for compliance and audit security:
With plain Ansible, you would have to correlate external Git logs, CI logs, and manual documentation.
A frequently underestimated question in audits is:
Which version of the operations tools is in use – and where?
Polycrate answers this by having each CLI instance regularly report to the API, e.g., when starting an action, a sync, or an SSH session. A dataset includes, among other things:
cli_instance_idcli_version)Example:
{
"type": "cli_instance",
"id": "cli-8f3891b2",
"user": "alice",
"cli_version": "0.8.4",
"os": "linux",
"arch": "amd64",
"hostname": "alice-laptop",
"first_seen": "2026-03-22T09:00:00Z",
"last_seen": "2026-03-24T10:27:45Z"
}This allows you to:
Polycrate encrypts workspace secrets with age, see workspace encryption. Instead of managing each workspace individually, you can use the API to:
In NIS-2 and GDPR contexts, this is crucial:
To make this tangible, let’s look at a small but complete workflow:
acme-corp-automationlinux-patch that executes an Ansible playbookinventory.yml)# workspace.poly
name: acme-corp-automation
organization: acme
config:
api_base_url: "https://polycrate-api.acme-corp.com"
blocks:
- name: linux-patch
from: linux-patch
config:
target_hosts: "all"Further details on workspaces can be found in the workspaces documentation and best practices in the Polycrate best practices.
# blocks/linux-patch/block.poly
name: linux-patch
version: 0.1.0
kind: generic
config:
target_hosts: "all"
actions:
- name: patch
description: "Install security updates on Linux servers"
type: ansible
playbook: patch.ymlThe block is located locally in the workspace (./blocks/linux-patch). In real setups, you could also source this block from a registry or PolyHub – always with explicit versioning, see registry documentation.
# inventory.yml (workspace root)
all:
hosts:
server01.acme-corp.com:
ansible_host: 10.0.12.34
ansible_user: ubuntu
server02.acme-corp.com:
ansible_host: 10.0.12.35
ansible_user: ubuntuPolycrate automatically sets ANSIBLE_INVENTORY to this YAML inventory, see Ansible integration.
Important: We do not use hosts: localhost with connection: local, because that would only apply inside the Polycrate container.
# blocks/linux-patch/patch.yml
- name: Install security patches
hosts: "{{ block.config.target_hosts }}"
become: true
gather_facts: false
tasks:
- name: Update package lists (APT)
ansible.builtin.apt:
update_cache: true
when: ansible_facts.os_family == "Debian"
- name: Install security updates (APT)
ansible.builtin.apt:
upgrade: dist
when: ansible_facts.os_family == "Debian"
- name: Update all packages (YUM/DNF)
ansible.builtin.yum:
name: "*"
state: latest
when: ansible_facts.os_family in ["RedHat", "Rocky", "AlmaLinux"]The variable block.config.target_hosts comes directly from block.poly and is injected into the Ansible context by Polycrate, see Actions documentation.
Start the patch run with:
polycrate run linux-patch patchWhat happens from an audit perspective?
If the admin additionally connects via SSH to server01.acme-corp.com:
polycrate ssh server01.acme-corp.com…additional SSH session events are created that you can later correlate with the patch run and the commit SHA from the last polycrate workspace sync.
In the Polycrate API backend, this yields a coherent picture:
linux-patch/patch → rolled-out changeMore on how blocks, workflows, and actions interact can be found in the Blocks documentation and Workflows.
Polycrate helps you address core requirements from NIS-2 and GDPR:
It is equally important to state what is not in scope:
ssh from a terminal without the Polycrate wrapper).In practice, Polycrate is thus an important building block in a comprehensive audit and monitoring stack integrated with SIEM or GRC systems.
With plain Ansible you could rebuild much of this:
ansible-playbook.All of that is feasible – but it requires:
Polycrate brings these capabilities integrated:
You do not need to build extra infrastructure – only run your existing workflows consistently through Polycrate.
Polycrate captures all SSH sessions started through Polycrate (e.g. polycrate ssh host). If an admin runs ssh host directly in a terminal without Polycrate, the API does not see that session.
In practice you therefore establish a process:
That makes Polycrate the natural entry point for operations – and the audit trail becomes complete.
The Polycrate API offers structured JSON events for Action Runs, SSH sessions, workspace syncs, and more, see API documentation. Typical integration paths are:
Because of the clear structure, Polycrate fits well into existing use cases such as “Privileged Access Monitoring” or “Change Tracking”.
The Polycrate API stores usernames, hostnames, and CLI version information, among other things, to ensure auditability. How “personal” these data are depends on context (e.g. mapping to real individuals).
For GDPR-aligned use we recommend:
ayedo can help you configure and integrate Polycrate so your data protection officer’s requirements are met.
More questions? See our FAQ
With Polycrate and its API you get more than “just” an automation tool: you get an operations layer that combines technical excellence with auditability.
In this post you have seen:
ayedo supports teams at exactly this intersection of automation and compliance: from shaping your platform engineering approach through introducing Polycrate to integrating the Polycrate API with your existing SIEM and GRC systems.
If you want to see what the audit trail could look like in your environment, good next steps are:
TL;DR The Polycrate API transforms individual workspaces into a team platform: all workspaces, …
TL;DR The Model Context Protocol (MCP) is an open standard: AI clients talk to helper programs over …
TL;DR You build a reusable Polycrate block that automates the deployment of Nginx and Let’s …