microsoft/SdnDiagnostics

[Validation] X509Certificate credential object referenced by server resource have correct certificate found on NCs

luyaof opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
Validation scenario. The Server resource have credential object referenced by its connection. Example:

{
  "resourceRef": "/servers/xxxxxxx",
  "resourceId": "xxxxx",
  "resourceMetadata": {
    "client": "xxx",
    "resourceName": "xxx"
  },
  "etag": "W/\"xxxx\"",
  "instanceId": "xxx",
  "properties": {
    "provisioningState": "Succeeded",
    "connections": [
      {
        "managementAddresses": [
          "server1.contoso.com"
        ],
        "credential": {
          "resourceRef": "/credentials/xxxxx"
        },
        "credentialType": "usernamePassword"
      },
      {
        "managementAddresses": [
          "server1.contoso.com"
        ],
        "credential": {
          "resourceRef": "/credentials/xxxx"
        },
        "credentialType": "X509Certificate"
      }
    ],


{
  "resourceRef": "/credentials/xxxx",
  "resourceId": "xxx",
  "etag": "W/\"xxx\"",
  "instanceId": "xxx",
  "properties": {
    "provisioningState": "Succeeded",
    "type": "X509Certificate",
    "value": "thumbprint",
    "networks": []
  }
}

The X509Certificate credential resource have value pointed to certificate on NC by thumbprint. The cert need to be exist, otherwise will cause connection problem from NC To Hosts.

Describe the solution you'd like

  • Read all credential resource of type certificate referenced by server.
  • Check each of the credential resource to confirm if certificate match the thumbprint found or not.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.