File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed 
compliance/controls/azure Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1+ 
12id : azure_mandatory_sql_subscription_resource_group_mandatory 
23title : Resource groups should have mandatory tags 
34description : Check if Resource groups have mandatory tags. 
45integration_type :
56  - azure_subscription 
67parameters :
78  - key : azureMandatoryTags 
8-     value : ' ["name","environment"] ' 
9+     value : $global.mandatory_tags 
910policy :
1011  language : sql 
1112  primary_resource : azure_resource_group 
@@ -16,8 +17,9 @@ policy:
1617        platform_resource_id, 
1718        id, 
1819        title, 
19-         tags ?& '{{.azureMandatoryTags}}'::text[] AS has_mandatory_tags, 
20-         TO_JSONB('{{.azureMandatoryTags}}'::text[]) - ARRAY( 
20+         -- Use the $global.mandatory_tags reference in the SQL 
21+         tags ?& $global.mandatory_tags::text[] AS has_mandatory_tags, 
22+         TO_JSONB($global.mandatory_tags::text[]) - ARRAY( 
2123          SELECT jsonb_object_keys(tags) 
2224        ) AS missing_tags, 
2325        subscription_id 
@@ -37,7 +39,8 @@ policy:
3739        ELSE title || ' is missing tags: ' || array_to_string( 
3840          ARRAY( 
3941            SELECT jsonb_array_elements_text(missing_tags) 
40-           ), ', ') || '.' 
42+           ), ', ' 
43+         ) || '.' 
4144      END AS reason, 
4245      subscription_id 
4346    FROM 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments