RELATED_LIST_HAS_NO
RELATED_LIST_HAS_NO:
status: { status } # required, string (enum: "DISAPPEARED", "INAPPLICABLE", "COMPLIANT", "INCOMPLIANT", "UNDETERMINED")
relationshipName: { relationshipName } # required, string
Description
The RELATED_LIST_HAS_NO operation checks if no related objects in the specified relationshipName satisfy the conditions defined in the corresponding relatedLists section of the logic file, matching the given status. It returns a Boolean value: true if no related objects have the specified status (including when no related objects exist), and false if at least one does.
This operation is ideal for ensuring the absence of specific compliance states in related objects, such as verifying no unrestricted security group rules or no attached policies. See the Object Relationships section for details on configuring related lists.
Parameters
-
status(string, required):- The compliance status to check for absence among related objects.
- Valid values:
"DISAPPEARED","INAPPLICABLE","COMPLIANT","INCOMPLIANT","UNDETERMINED". - Matches the
statusassigned by the nested logic in therelatedListssection for the specifiedrelationshipName.
-
relationshipName(string, required):- The name of the relationship to the related objects, as defined in the Cloudaware CMDB schema for the parent
inputType. - Examples:
CA10__AWS_EC2_Security_Group_Rules__r,CA10__AWS_IAM_Policy_User_Links__r. - Must correspond to a
relationshipNameentry in therelatedListssection of the logic file. - Supports chained relationships (e.g.,
CA10__parent__r.CA10__child__r).
- The name of the relationship to the related objects, as defined in the Cloudaware CMDB schema for the parent
Return Type
Examples
-
Ensuring No Unrestricted Security Group Rules:
- Logic Snippet:
inputType: "CA10__CaAwsSecurityGroup__c"
conditions:
- status: "COMPLIANT"
currentStateMessage: "No unrestricted rules in Security Group."
check:
RELATED_LIST_HAS_NO:
status: "INCOMPLIANT"
relationshipName: "CA10__AWS_EC2_Security_Group_Rules__r"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "Security Group has unrestricted rules."
remediationMessage: "Restrict rule sources."
relatedLists:
- relationshipName: "CA10__AWS_EC2_Security_Group_Rules__r"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "Rule allows all IPs."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__sourceIpRange__c"
right:
TEXT: "0.0.0.0/0"
otherwise:
status: "COMPLIANT"
currentStateMessage: "Rule is restricted."- Result:
trueif no rules haveCA10__sourceIpRange__cequal to"0.0.0.0/0",falseotherwise. - Explanation:
RELATED_LIST_HAS_NOconfirms the absence ofINCOMPLIANTrules, ensuring compliance.
-
Verifying No Attached IAM Policies for a User:
- Logic Snippet:
inputType: "CA10__CaAwsUser__c"
conditions:
- status: "COMPLIANT"
currentStateMessage: "No attached policies for user."
check:
RELATED_LIST_HAS_NO:
status: "INCOMPLIANT"
relationshipName: "CA10__AWS_IAM_Policy_User_Links__r"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "User has attached policies."
remediationMessage: "Use IAM groups instead."
relatedLists:
- relationshipName: "CA10__AWS_IAM_Policy_User_Links__r"
conditions: []
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "This is an attached policy."- Result:
trueif no policy links areINCOMPLIANT(i.e., no links exist),falseif any do. - Explanation: With no conditions, all related objects are
INCOMPLIANT.RELATED_LIST_HAS_NOreturnstruewhen the list is empty (noINCOMPLIANTobjects), ensuring compliance.
-
Confirming No Role Attachments for a Policy:
- Logic Snippet:
inputType: "CA10__CaAwsIamPolicy__c"
conditions:
- status: "COMPLIANT"
currentStateMessage: "Policy is not attached to any role."
check:
RELATED_LIST_HAS_NO:
status: "INCOMPLIANT"
relationshipName: "CA10__AWS_IAM_Role_Policy_Attachments__r"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "Policy is attached to a role."
remediationMessage: "Detach the policy."
relatedLists:
- relationshipName: "CA10__AWS_IAM_Role_Policy_Attachments__r"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "Attached to a role."
check:
NOT_EMPTY_LOOKUP: "CA10__role__r"
otherwise:
status: "COMPLIANT"
currentStateMessage: "Not attached."- Result:
trueif no attachments areINCOMPLIANT(no roles linked),falseotherwise. - Explanation:
RELATED_LIST_HAS_NOverifies noINCOMPLIANTrole attachments exist, indicating compliance.