rules/findings/Azure/KeyVault/CIS3.0/azure-expiration-date-for-all-secrets-in-rbac-keyvault-disabled.json

{
  "args": [
     
  ],
  "provider": "Azure",
  "serviceType": "Azure KeyVault",
  "serviceName": "Storage",
  "displayName": "Ensure that the Expiration Date is set for all Secrets in RBAC Key Vaults",
  "description": "Ensure that all Secrets in Role Based Access Control (RBAC) Azure Key Vaults have an expiration date set.",
  "rationale": "The Azure Key Vault enables users to store and keep secrets within the Microsoft Azure environment. Secrets in the Azure Key Vault are octet sequences with a maximum size of 25k bytes each. The exp (expiration date) attribute identifies the expiration date on or after which the secret MUST NOT be used. By default, secrets never expire. It is thus recommended to rotate secrets in the key vault and set an explicit expiration date for all secrets. This ensures that the secrets cannot be used beyond their assigned lifetimes.",
  "impact": "Secrets cannot be used beyond their assigned expiry date respectively. Secrets need to be rotated periodically wherever they are used.",
  "remediation": {
    "text": "###### From Azure Portal\r\n\t\t\t\t\t1. Go to `Key vaults`\r\n\t\t\t\t\t2. For each Key vault, click on `Secrets`.\r\n\t\t\t\t\t3. Under the `Settings` section, Make sure `Enabled?` is set to Yes\r\n\t\t\t\t\t4. Set an appropriate **expiration date** on all keys.",
    "code": {
      "powerShell": null,
      "iac": null,
      "terraform": null,
      "other": null
    }
  },
  "recommendation": null,
  "references": [
    "https://docs.microsoft.com/en-us/azure/key-vault/about-keys-secrets-and-certificates"
  ],
  "compliance": [
    {
      "name": "CIS Microsoft Azure Foundations",
      "version": "3.0.0",
      "reference": "3.3.3",
      "profile":"Level 1"
    }
  ],
  "level": "medium",
  "tags": [
     
  ],
  "rule": {
    "path": "az_keyvault",
    "subPath": null,
    "selectCondition": {
       
    },
    "query": [
      {
        "filter": [
          {
            "conditions": [
              [
                "enableRbacAuthorization",
                "eq",
                "true"
              ],
              [
                "objects.secrets.attributes.exp",
                "ne"
              ]
            ],
            "operator": "and"
          }
        ]
      }
    ],
    "shouldExist": null,
    "returnObject": null,
    "removeIfNotExists": null
  },
  "output": {
    "html": {
      "data": {
        "properties": {
          "name": "Key Vault Name",
          "location": "Location",
          "enableRbacAuthorization": "RBAC Enabled"
        },
        "expandObject": null
      },
      "table": "Normal",
      "decorate": [
         
      ],
      "emphasis": [
      ],
      "actions": {
        "objectData": {
          "properties": [
             
          ],
          "expandObject": null,
          "limit": null
        },
        "showGoToButton": "true",
        "showModalButton": "true",
        "directLink": null
      }
    },
    "text": {
      "data": {
        "properties": {
           
        },
        "expandObject": null
      },
      "status": {
        "keyName": [
           
        ],
        "message": "",
        "defaultMessage": null
      },
      "properties": {
        "resourceName": null,
        "resourceId": null,
        "resourceType": null
      },
      "onlyStatus": false
    }
  },
  "idSuffix": "azure_rbac_key_vault_secrets_notexpire",
  "notes": [
     
  ],
  "categories": [
     
  ]
}