Grok + xCloud

Secure sites and servers with Grok on xCloud

Securing sites and servers with Grok Build means typing short commands to xAI's terminal agent and letting it read xCloud's vulnerability findings, firewall rules and Fail2Ban bans, then change the perimeter only after you confirm.

  • Skill: xcloud:servers
  • Toolsets: vulnerabilities, servers, sites, wordpress-actions
  • Free with every xCloud account

Youunban 203.0.113.10 on Frankfurt. say what it does first

servers_fail2ban_banned-ipsread-only

Agent203.0.113.10 is banned on frankfurt-1. Unbanning lets that address reach SSH and the sites on that server again until Fail2Ban bans it for new failures. Go ahead?

Youyes

servers_fail2ban_unbanneeds approval

AgentUnbanned. The list now shows 13 addresses, and 203.0.113.10 is not among them.

. Keep a human in the loop: xCloud stops and asks before anything that creates, deploys, updates, reboots, deletes or buys.

Setup

How Do You Set Up Grok to Secure sites and servers on xCloud?

Connect Grok once; every job on this account uses the same connection. Then ask in plain words.

  1. Add the xCloud MCP server

    Run this in your terminal, then start grok. The first time it calls xCloud, a browser opens on the xCloud approval screen, where you tick the teams and choose Read-only or Full access. Add --scope project to save the entry in .grok/config.toml for one repository instead.

    Terminal
    grok mcp add --transport http xcloud https://app.xcloud.host/mcp
  2. Or edit ~/.grok/config.toml

    Add this table to ~/.grok/config.toml, then run grok mcp doctor xcloud to check the connection. The url key is the one for HTTP servers.

    TOML
    [mcp_servers.xcloud]
    url = "https://app.xcloud.host/mcp"
  3. No browser? Use an API key

    For a headless machine, create a token with the mcp:invoke scope plus the read abilities for the areas it will use (read:servers and read:sites, with read:billing and read:addons for billing and add-on tools) and the matching write: abilities if it should change things in Settings, Developers, API Tokens. Put it in an environment variable the machine starts Grok with, such as XCLOUD_TOKEN in a systemd EnvironmentFile or your shell profile, and pass a reference to it with --header. Keep the single quotes so the shell leaves ${XCLOUD_TOKEN} alone: Grok expands ${VAR} in headers when it loads the config, so the token itself never lands in your shell history or in config.toml. Run grok mcp doctor xcloud to confirm it works.

    Terminal
    grok mcp add --transport http --header 'Authorization: Bearer ${XCLOUD_TOKEN}' xcloud https://app.xcloud.host/mcp
  4. Check it worked

    Then ask Grok for the job itself, for example:

    Prompt
    audit shop.example.com: vulnerabilities by severity, top three findings

In practice

How Does Security Work from Grok?

Grok Build runs in the same shell where you keep SSH sessions and tail logs, which suits a security pass that is mostly reading. Once grok mcp add has registered the server, /mcps shows xcloud in the MCP tab of a session, and grok mcp doctor xcloud tells you if the connection is not healthy before you waste a prompt. A terse line is enough: audit shop.example.com, vulnerabilities by severity. Grok Build calls sites_vulnerabilities_count and then sites_vulnerabilities_list, and prints the counts and the findings with the plugin or theme each one names. For a fleet question you ask for the whole team instead, and it makes one call to vulnerabilities_index and sorts the result worst first.

The project scope gives you a tidy way to separate security work from everything else. Add the entry with --scope project and it is saved in .grok/config.toml for one repository, so a repo that holds the notes and scripts for one client can carry xcloud, while your other repositories never see firewall tools. OAuth tokens stay under ~/.grok, not in that file, so the project config carries only the URL and is safe to commit. In the session you then ask for the perimeter: list the firewall rules on the Frankfurt server, is SSH restricted to trusted IPs, show the banned IPs. Grok Build reads them through servers_firewallRules, servers_firewall_ssh-restriction-status and servers_fail2ban_banned-ips without a prompt.

When you tell it to unban 203.0.113.10, it names the server and the effect and waits for your yes before calling servers_fail2ban_unban. The same holds for a new rule, a ban or a sudo-user change, and the SSH lockout risk gets spelled out before a rule can touch port 22. Items that are dashboard switches, such as the AI bot blocker and the 8G firewall, come back as a dashboard path. Grok Build can still read the 7G and 8G logs through the site's nginx access log to show you what they block, and it proposes the plugin update, with a backup first, for any finding that a newer version fixes.

Grok specific: Remote servers need --transport http on grok mcp add. Without it Grok Build treats the URL as a local command and no security tools appear. Grok Build also loads MCP servers from ~/.claude.json, .cursor/mcp.json and a project .mcp.json, so check grok mcp list before you add a second entry. Otherwise you may be reviewing firewall rules through a connection that was authorized with a different access level than you think. A Read-only sign-in is a good default for audits: it lets Grok Build list findings, rules and bans, and xCloud refuses any tool that would change something. This page covers the terminal agent. Grok at grok.com has its own connector settings.

What xCloud does for security

xCloud reads vulnerability findings for one site or across your whole team, starts rescans and ignores or restores a finding. On servers it manages firewall rules, Fail2Ban bans, the SSH restriction state and sudo users. Protections such as the AI bot blocker, the 7G and 8G firewall and per-site IP rules stay dashboard switches.

  1. Start with the team-wide rollup. For a fleet question the agent reads the vulnerability rollup across every site on the team in one call and sorts it worst first. For one site it reads the findings and the counts by severity instead.
  2. Rescan and triage findings. A rescan runs without a confirmation stop and finishes asynchronously, so the agent checks the count again afterwards. Findings carry a severity and a source, and severity is the triage key. A false positive can be ignored with a reason and restored later.
  3. Fix what the finding points to. Most findings are fixed by updating a plugin, a theme or WordPress core. The agent proposes the updates, takes a backup first if you want one, and waits for your approval, because updating plugins or themes always stops for confirmation.
  4. Review the server's perimeter. The agent reads firewall rules, the Fail2Ban banned IP list, the SSH restriction status and the sudo users. It can add or disable a rule, ban or unban an address and whitelist xCloud's own IPs after you confirm the server and the effect.
  5. Report what is dashboard-only. AI bot blocking, the 7G and 8G firewall and a single site's IP allow and block list are dashboard switches. The agent reads what it can, such as the 7G and 8G logs, and gives you the dashboard path and the site's dashboard link for the rest.

Reference

Security Settings and Limits on xCloud

The facts Grok works within when it secures sites and servers. Where a row names the dashboard, that step stays yours to take there.

Setting or limitWhat applies
Vulnerability findingsPer-site list and counts by severity (critical, high, medium, low), plus a team-wide rollup across every site you can reach
RescansTriggering a rescan is a routine action that runs without a confirmation stop. It is asynchronous, so the agent polls the count or the site events
Ignore and restoreA finding can be ignored with a reason and un-ignored later. Both are changes to the finding, not to the site
Firewall rulesList, create, enable, disable and delete server rules by name, protocol (tcp or udp), traffic (allow or deny), port and optional source IP
Fail2BanList banned IPs, ban one or more addresses and unban an address. Adding addresses to Fail2Ban's own ignore list is an SSH step described in the Fail2Ban guide
WhitelistingxCloud's infrastructure IPs and the caller's IP can be whitelisted. The SSH restriction status says whether SSH is limited to trusted addresses
Sudo usersList, create or update, and delete OS-level privileged accounts. Private keys are never returned, and a temporary account is available for short jobs
7G and 8G firewallSwitched on in the dashboard. Their logs are readable through the nginx log type of the site's access log read
AI bot blockerA dashboard toggle: Site, Tools, Nginx and Security on Nginx, Tools, Security on OpenLiteSpeed
Per-site IP rulesDashboard-only: Site, Tools, IP Management. The API lists a site's rules but does not change them; server-wide blocks are on the API
Automated security updatesxCloud installs security updates on servers it provisions, and Automatic Reboot restarts the server only when a reboot is required. Both are configured in the dashboard
Security headersThe API lists a site's custom Nginx configuration. Adding headers is a dashboard or SSH step, described in the security headers guide

Rules Grok has to follow

  • Firewall, Fail2Ban and sudo-user changes name the exact server and the effect before they run, and they wait for your yes. Locking out SSH is the risk the agent explains first.
  • The agent never disables SSH or a database service to tidy up a ruleset, and it does not delete the default SSH rule on its own.
  • Updating a plugin or theme to fix a finding stops for your approval, and the agent offers a backup first.
  • Ignoring a finding needs a reason you give. The agent records it and tells you how to restore it.
  • AI bot blocking, the 7G and 8G firewall, per-site IP rules and automated update settings are dashboard steps. The agent says so, gives the path and the dashboard link, and never claims it changed them.
  • A temporary sudo user is for a specific job and is removed when the job ends.

Example prompts

What Can You Ask Grok to Do for Security?

Type these as written and swap in your own repository, site and server names. Reads and routine actions such as backups, cache purges, PageSpeed scans and vulnerability scans run straight away; creating, deploying, updating, rebooting, deleting, buying or starting a broken-link scan stops and asks first.

Prompt
audit shop.example.com: vulnerabilities by severity, top three findings
Prompt
list firewall rules and banned IPs on Frankfurt. is ssh restricted to trusted IPs?
Prompt
unban 203.0.113.10 on Frankfurt. say what it does first
Prompt
Show the vulnerability count for every site on this team, sorted worst first, and name the top three findings.
Prompt
Run a vulnerability scan on the shop site and tell me what it finds.
Prompt
List the findings on the blog site and ignore the false positive in the contact form plugin, with the reason.
Prompt
Update every plugin on the shop site, then run a vulnerability scan, and stop if anything is still open.
Prompt
List the firewall rules on the Frankfurt server and tell me whether SSH is restricted to trusted IPs.
Prompt
Show the IPs Fail2Ban has banned on the Frankfurt server, and unban 203.0.113.10.
Prompt
Whitelist the xCloud IPs on the Frankfurt server.
Prompt
Which sudo users exist on the Frankfurt server? Flag any that look temporary or unused.

Grok and Security: Frequently Asked Questions

What people ask before they let Grok secure sites and servers through xCloud.

Can Grok Build change my xCloud firewall rules?

Yes, if you signed in with Full access. It can create, enable, disable and delete server rules, but it names the server and the effect first and waits for your yes. With Read-only access it can list the rules and nothing else.

Should I add xCloud to Grok Build per project or globally for security checks?

Per project keeps firewall and Fail2Ban tools out of unrelated repositories. Add the entry with --scope project in the repository you use for operations, or keep it in ~/.grok/config.toml if you want it everywhere. OAuth tokens live under ~/.grok either way.

Can an agent show vulnerabilities across all my sites at once?

Yes. xCloud has a team-wide rollup that lists findings for every site you can reach, which the agent sorts worst first. For one site it reads the findings and the counts by severity, and it can start a rescan.

Can the agent ban an IP address on my server?

Yes. It can ban addresses in Fail2Ban, list the banned IPs and unban one, and it can create, disable and delete server firewall rules. It confirms the server and the effect first, so you do not lock yourself out.

Can the agent turn on the 8G firewall or the AI bot blocker?

No. Both are dashboard switches. The agent can read the 7G and 8G firewall logs through the site's nginx logs, and it tells you where the switches are: the site's Tools section. It does not claim to have changed them.

Can the agent block an IP for just one site?

Not from here. Per-site IP allow and block lists are managed in the dashboard under Site, Tools, IP Management, and the agent can only list what is there. Server-wide blocks, through firewall rules and Fail2Ban, are on the API.

Does the agent fix a vulnerability on its own?

No. It reports the finding and proposes the update that remediates it, usually a plugin, theme or core update. Updates always stop for your approval, and the agent can take a backup first and rescan afterwards to confirm the finding is gone.

Other agents

Security with Other Agents

The same job, the same xCloud tools, a guide for each client.

Run Your Hosting from Grok

xCloud MCP, the Agent Skills and the Public API are free with every account. Connect once and ask.