Beispiel #1
0
 /// <summary>
 /// Extracts the storage account requested key
 /// </summary>
 private string ExtractStorageAccountKey(string storageName, BaseTableAuditingPolicyModel model, string storageAccountResourceGroup, StorageKeyKind keyType)
 {
     if (!IgnoreStorage && (model.StorageKeyType == keyType))
     {
         return(AzureCommunicator.GetStorageKeys(storageAccountResourceGroup, storageName)[keyType]);
     }
     return(null);
 }
        private void PopulateStoragePropertiesInPolicy(BaseThreatDetectionPolicyModel model, BaseSecurityAlertPolicyProperties properties, string storageEndpointSuffix)
        {
            if (string.IsNullOrEmpty(model.StorageAccountName)) // can happen if the user didn't provide account name for a policy that lacked it
            {
                throw new Exception(string.Format(Properties.Resources.NoStorageAccountWhenConfiguringThreatDetectionPolicy));
            }

            properties.StorageEndpoint         = string.Format("https://{0}.blob.{1}", model.StorageAccountName, storageEndpointSuffix);
            properties.StorageAccountAccessKey = AzureCommunicator.GetStorageKeys(model.StorageAccountName)[StorageKeyKind.Primary];
        }
Beispiel #3
0
 /// <summary>
 /// Extracts the storage account requested key
 /// </summary>
 private string ExtractStorageAccountKey(string storageName)
 {
     return(AzureCommunicator.GetStorageKeys(storageName)[StorageKeyKind.Primary]);
 }
 /// <summary>
 /// Extracts the storage account requested key
 /// </summary>
 private string ExtractStorageAccountKey(string storageName, StorageKeyKind storageKeyKind)
 {
     return(AzureCommunicator.GetStorageKeys(storageName)[storageKeyKind]);
 }