Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add security_alert_policies column in azure_mssql_managed_instance table. Closes #291 #333

Merged
merged 5 commits into from
Sep 29, 2021

Conversation

c0d3r-arnab
Copy link
Contributor

Example query results

Results
> select
  name,
  id,
  state,
  license_type,
  minimal_tls_version
from
  azure_mssql_managed_instance;
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------
| name                  | id                                                                                                                                                          | state | license_type
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------
| test-managed-instance | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.Sql/managedInstances/test-managed-instance | Ready | LicenseInclu
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------
> select
  name,
  id,
  state,
  license_type,
  minimal_tls_version
from
  azure_mssql_managed_instance
where
  public_data_endpoint_enabled;
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------
| name                  | id                                                                                                                                                          | state | license_type
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------
| test-managed-instance | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.Sql/managedInstances/test-managed-instance | Ready | LicenseInclu
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------
> select
  name,
  id,
  state,
  license_type,
  minimal_tls_version
from
  azure_mssql_managed_instance
where
  public_data_endpoint_enabled;
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------
| name                  | id                                                                                                                                                          | state | license_type
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------
| test-managed-instance | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.Sql/managedInstances/test-managed-instance | Ready | LicenseInclu
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------
> select
  name,
  id,
  policy -> 'creationTime' as policy_creation_time,
  jsonb_pretty(policy -> 'disabledAlerts') as policy_disabled_alerts,
  policy -> 'emailAccountAdmins' as policy_email_account_admins,
  jsonb_pretty(policy -> 'emailAddresses') as policy_email_addresses,
  policy ->> 'id' as policy_id,
  policy ->> 'name' as policy_name,
  policy -> 'retentionDays' as policy_retention_days,
  policy ->> 'state' as policy_state,
  policy ->> 'storageAccountAccessKey' as policy_storage_account_access_key,
  policy ->> 'storageEndpoint' as policy_storage_endpoint,
  policy ->> 'type' as policy_type
from
  azure_mssql_managed_instance,
  jsonb_array_elements(security_alert_policies) as policy;
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------
| name                  | id                                                                                                                                                          | policy_creation_time
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------
| test-managed-instance | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.Sql/managedInstances/test-managed-instance | "2021-09-23T10:03:48
|                       |                                                                                                                                                             |                     
|                       |                                                                                                                                                             |                     
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------
> 

@bigdatasourav bigdatasourav changed the title Add Managed Server Security Alert Policies in table azure_mssql_managed_instance. Closes #291 Add security_alert_policies column in azure_mssql_managed_instance table. Closes #291 Sep 29, 2021
Copy link
Contributor

@bigdatasourav bigdatasourav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bigdatasourav bigdatasourav merged commit e00484d into main Sep 29, 2021
@bigdatasourav bigdatasourav deleted the issue-291 branch September 29, 2021 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Managed Server Security Alert Policies in table azure_mssql_managed_instance
3 participants