diff --git a/pkg/aa/variables.go b/pkg/aa/variables.go index 31356ffd1..6105cc302 100644 --- a/pkg/aa/variables.go +++ b/pkg/aa/variables.go @@ -105,7 +105,11 @@ func (p *AppArmorProfile) ResolveAttachments() { for _, variable := range p.Variables { if variable.Name == "exec_path" { for _, value := range variable.Values { - p.Attachments = append(p.Attachments, p.resolve(value)...) + attachments := p.resolve(value) + if len(attachments) == 0 { + panic("Variable not defined in: " + value) + } + p.Attachments = append(p.Attachments, attachments...) } } }