github.com/DataDog/datadog-agent/pkg/security/secl@v0.55.0-devel.0.20240517055856-10c4965fea94/validators/ruleid.go (about)

     1  // Unless explicitly stated otherwise all files in this repository are licensed
     2  // under the Apache License Version 2.0.
     3  // This product includes software developed at Datadog (https://www.datadoghq.com/).
     4  // Copyright 2016-present Datadog, Inc.
     5  
     6  // Package validators holds validators related files
     7  package validators
     8  
     9  import (
    10  	"regexp"
    11  )
    12  
    13  // RuleIDPattern represents the regex that `RuleID`s must match
    14  var RuleIDPattern = regexp.MustCompile(`^[a-zA-Z0-9_]*$`)
    15  
    16  // CheckRuleID validates a ruleID
    17  func CheckRuleID(ruleID string) bool {
    18  	return RuleIDPattern.MatchString(ruleID)
    19  }