|
32 | 32 | OID_ESXI_AUTH = "1.3.6.1.4.1.25623.1.0.105058" |
33 | 33 | OID_SNMP_AUTH = "1.3.6.1.4.1.25623.1.0.105076" |
34 | 34 | OID_PING_HOST = "1.3.6.1.4.1.25623.1.0.100315" |
| 35 | +# TODO: check me, check me, check me |
| 36 | +OID_KRB5_AUTH = "1.3.6.1.4.1.25623.1.81.0" |
35 | 37 |
|
36 | 38 | BOREAS_ALIVE_TEST = "ALIVE_TEST" |
37 | 39 | BOREAS_ALIVE_TEST_PORTS = "ALIVE_TEST_PORTS" |
@@ -589,6 +591,9 @@ def build_credentials_as_prefs(self, credentials: Dict) -> List[str]: |
589 | 591 | for credential in credentials.items(): |
590 | 592 | service = credential[0] |
591 | 593 | cred_params = credentials.get(service) |
| 594 | + if not cred_params: |
| 595 | + logger.warning("No credentials parameter found for service %s", service) |
| 596 | + continue |
592 | 597 | cred_type = cred_params.get('type', '') |
593 | 598 | username = cred_params.get('username', '') |
594 | 599 | password = cred_params.get('password', '') |
@@ -665,6 +670,28 @@ def build_credentials_as_prefs(self, credentials: Dict) -> List[str]: |
665 | 670 | cred_prefs_list.append( |
666 | 671 | f'{OID_SMB_AUTH}:2:password:SMB password:|||{password}' |
667 | 672 | ) |
| 673 | + elif service == 'krb5': |
| 674 | + realm = cred_params.get('realm', '') |
| 675 | + if not realm: |
| 676 | + self.errors.append("Missing realm for Kerberos authentication.") |
| 677 | + continue |
| 678 | + kdc = cred_params.get('kdc', '') |
| 679 | + if not kdc: |
| 680 | + self.errors.append("Missing KDC for Kerberos authentication.") |
| 681 | + continue |
| 682 | + cred_prefs_list.append( |
| 683 | + f'{OID_KRB5_AUTH}:1:entry:KRB5 login:|||{username}' |
| 684 | + ) |
| 685 | + cred_prefs_list.append( |
| 686 | + f'{OID_KRB5_AUTH}:2:password:KRB5 password:|||{password}' |
| 687 | + ) |
| 688 | + cred_prefs_list.append( |
| 689 | + f'{OID_KRB5_AUTH}:3:entry:KRB5 realm:|||{realm}' |
| 690 | + ) |
| 691 | + #TODO: add multiple kdcs |
| 692 | + cred_prefs_list.append( |
| 693 | + f'{OID_KRB5_AUTH}:4:entry:KRB5 kdc:|||{kdc}' |
| 694 | + ) |
668 | 695 | # Check service esxi |
669 | 696 | elif service == 'esxi': |
670 | 697 | cred_prefs_list.append( |
|
0 commit comments