MCPcopy Create free account
hub / github.com/cyberark/KubiScan / get_pretty_rules

Function get_pretty_rules

KubiScan.py:363–383  ·  view source on GitHub ↗
(rules)

Source from the content-addressed store, hash-verified

361 print('Total number: %s' % len(subjects))
362
363def get_pretty_rules(rules):
364 pretty = ''
365 if rules is not None:
366 for rule in rules:
367 verbs_string = '('
368 for verb in rule.verbs:
369 verbs_string += verb + ','
370 verbs_string = verbs_string[:-1]
371 verbs_string += ')->'
372
373 resources_string = '('
374 if rule.resources is None:
375 resources_string += 'None'
376 else:
377 for resource in rule.resources:
378 resources_string += resource + ','
379
380 resources_string = resources_string[:-1]
381 resources_string += ')\n'
382 pretty += verbs_string + resources_string
383 return pretty
384
385def print_rolebinding_rules(rolebinding_name, namespace):
386 role = engine.utils.get_rolebinding_role(rolebinding_name, namespace)

Callers 4

generic_printFunction · 0.85
print_rolebinding_rulesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected