Subscribe to the Non-Human & AI Identity Journal

Host-scoped account

A host-scoped account is a MySQL user tied to a specific hostname or IP pattern. It limits where the account can connect from, but wildcard patterns can quickly widen access if they are used for convenience instead of explicit governance.

Expanded Definition

A host-scoped account is a MySQL identity whose login rights are constrained by the client host, IP address, or hostname pattern recorded with the account. In practice, this makes the account both an identity and a network boundary control, but only when the host match is specific enough to be meaningful.

Definitions vary across vendors and teams because host scoping is often treated as a convenience feature rather than a governance control. In NHI management, the key question is not whether the account can connect, but whether the host rule expresses an intentional trust boundary. The difference between a precise host entry and a broad wildcard is operationally significant, especially when the account also carries privileged database permissions. The OWASP Non-Human Identity Top 10 treats overbroad service identity exposure as a recurring risk pattern, and that maps directly to host-scoped accounts that are left loose for expediency.

The most common misapplication is using wildcard host patterns as a shortcut for deployment convenience, which occurs when teams need fast connectivity across environments and do not revisit the access rule after release.

Examples and Use Cases

Implementing host-scoped accounts rigorously often introduces operational friction, requiring organisations to weigh deployment flexibility against tighter access boundaries and more frequent account maintenance.

  • A database account is limited to one application server’s IP so that only that workload can authenticate, rather than any internal host.
  • A maintenance account is scoped to a small set of bastion hosts, reducing exposure if developer laptops or ephemeral compute nodes are compromised.
  • A legacy application uses a hostname pattern for regional failover, but the pattern is reviewed because broad DNS matching can quietly expand reach.
  • During NHI review, the team compares host-scoped MySQL accounts against broader service-account inventory guidance in the Ultimate Guide to NHIs to identify where network-based trust is standing in for real governance.
  • A migration pipeline temporarily grants access from a CI runner host, then removes the rule after cutover to avoid leaving transient infrastructure as a permanent trust anchor.

When identity teams compare this pattern with standards-based service identity guidance such as the OWASP Non-Human Identity Top 10, the practical lesson is that host restriction helps only if it is explicit, reviewed, and removed when no longer justified.

Why It Matters in NHI Security

Host-scoped accounts matter because they can create a false sense of containment. A MySQL account that appears limited to a host pattern may still be broadly reachable if the pattern is wide, if DNS is not controlled, or if infrastructure is reused across applications. That becomes especially dangerous when the account is tied to a privileged database role, since host scope is not a substitute for least privilege, rotation, or secret hygiene.

This is not a theoretical concern. NHI Mgmt Group reports that 97% of NHIs carry excessive privileges, and 80% of identity breaches involved compromised non-human identities such as service accounts and API keys. In other words, weak scoping often compounds already overpowered credentials. Host-scoped accounts should therefore be treated as one control in a larger governance model that includes secret rotation, inventory, and offboarding, not as a standalone security boundary. The operational takeaway aligns with OWASP Non-Human Identity Top 10 and the broader NHI guidance in the Ultimate Guide to NHIs — Key Challenges and Risks.

Organisations typically encounter the danger only after a compromised service account is reused from an unexpected host, at which point the account scope becomes operationally unavoidable to investigate and narrow.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-02 Host-scoped accounts can become overbroad non-human identities when wildcarded.
NIST CSF 2.0 PR.AC-4 Access permissions should be restricted to intended hosts and managed as least privilege.
NIST Zero Trust (SP 800-207) SC-7 Network path restrictions support zero trust when host trust is explicit and verified.

Review host patterns and remove wildcard trust that expands service account reach.