Guard: Robust Detection of Hardcoded Secrets in Ansible Playbooks
Matteo Grella, Willem Jonker, Andrea Continella, Luca Mariot
Abstract
The adoption of DevOps practices and Infrastructure as Code (IaC) has transformed IT and cloud infrastructure management, but it also introduces new security challenges, as entire infrastructures are now defined in code. Existing detection tools for security smells are rule-based, matching configuration keys against keyword lists that must be curated and maintained by hand, or are learned models that operate on module-level metadata rather than on the configuration as written. In this paper we present GUARD, a learned classifier for hardcoded secrets that relies only on the key names found in IaC playbook files. Unlike regex-based approaches, GUARD does not depend on a fixed vocabulary, as it identifies variants of known secret key names and continues to flag keys whose tokens never appear in its training set. We compare GUARD against GLITCH, the state-of-the-art regex-based detector for Ansible, and three zero-shot large language models, namely Sonnet 4.6, Fable 5, and Mistral 7B. On F1 and precision, Sonnet 4.6 and Fable 5 significantly outperform GUARD, while GUARD in turn significantly outperforms GLITCH and Mistral 7B; on recall, however, GUARD is statistically indistinguishable from Sonnet 4.6 and Fable 5. Unlike commercial LLMs, GUARD attains this recall parity at a negligible inference cost with fully deterministic predictions, and without transmitting potentially sensitive IaC data to a third-party service. We further conduct an ablation study that incrementally strips the vocabulary GLITCH relies on: GLITCH's detection collapses once the list is exhausted (F1 from 0.662 to 0.000), whereas GUARD, retrained on the remaining key names, retains an F1 of 0.287 at a precision that never leaves [0.783, 0.868]. Losing keyword coverage therefore induces a trade-off for GUARD on recall, but not on reliability.
Create a lesson
Metadata
- Comments
- 25 pages, 10 figures, 5 tables
Related papers
Entropy Bounded Secret Key Generation in a Live 5G NR Stack Guard-Band Extraction and an Emulated Channel Operating Envelope
Shared title terminologycs.CRSachinkumar B. Mallikarjun, Hans D. Schotten
PvP: Intent-Conditioned Anomaly Detection Against Tool Poisoning Attacks in Agentic AI
Shared title terminologycs.CRMax de Leeuw, Cristoffer Leite, Indika Kumara
SteelYourHeart: Catching LLMs Taking Shortcuts in Vulnerability Detection
Shared title terminologycs.CRRun Hao, Zhuoran Tan
Assessing the Robustness of LLM-Based Oracles for Blockchain-Based Services
Shared title terminologycs.CRGianluca Di Paola, Alessandro Vitobello, Elisabetta Di Nitto et al.
SuriTrain: A Platform to Train Network Intrusion Detection Rule Engineers
Shared title terminologycs.CRKoen T. W. Teuwen, Tom Mulders, Emmanuele Zambon et al.
ZeroSphere: Multi-Evidence Open-Set Recognition for Wi-Fi Intrusion Detection
Shared title terminologycs.CRYassine Himeur, Adel Oulefki, Shadi Atalla et al.