|
| 1 | +--- |
| 2 | +title: Enable Defender for open-source relational databases on AWS |
| 3 | +description: Learn how to enable Microsoft Defender for open-source relational databases to detect potential security threats on AWS environments. |
| 4 | +ms.date: 05/01/2024 |
| 5 | +ms.topic: how-to |
| 6 | +ms.author: dacurwin |
| 7 | +author: dcurwin |
| 8 | +#customer intent: As a reader, I want to learn how to configure Microsoft Defender for open-source relational databases to enhance the security of my AWS databases. |
| 9 | +--- |
| 10 | + |
| 11 | +# Enable Defender for open-source relational databases on AWS (Preview) |
| 12 | + |
| 13 | +Microsoft Defender for Cloud detects anomalous activities in your AWS environment indicating unusual and potentially harmful attempts to access or exploit databases for the following RDS instance types: |
| 14 | + |
| 15 | +- Aurora PostgreSQL |
| 16 | +- Aurora MySQL |
| 17 | +- PostgreSQL |
| 18 | +- MySQL |
| 19 | +- MariaDB |
| 20 | + |
| 21 | +To get alerts from the Microsoft Defender plan, you need to follow the instructions on this page to enable Defender for open-source relational databases on AWS. |
| 22 | + |
| 23 | +The Defender for open-source relational databases on AWS plan also includes the ability to discover sensitive data within your account and enrich the Defender for Cloud experience with the findings. This is feature is also included with Defender CSPM. |
| 24 | + |
| 25 | +Learn more about this Microsoft Defender plan in [Overview of Microsoft Defender for open-source relational databases](defender-for-databases-introduction.md). |
| 26 | + |
| 27 | +## Prerequisites |
| 28 | + |
| 29 | +- You need a Microsoft Azure subscription. If you don't have an Azure subscription, you can [sign up for a free subscription](https://azure.microsoft.com/pricing/free-trial/). |
| 30 | + |
| 31 | +- You must [enable Microsoft Defender for Cloud](get-started.md#enable-defender-for-cloud-on-your-azure-subscription) on your Azure subscription. |
| 32 | + |
| 33 | +- At least one connected [AWS account](quickstart-onboard-aws.md) with the required access and permissions. |
| 34 | + |
| 35 | +- Region availability: All public AWS regions (excluding Tel Aviv, Milan, Jakarta, Spain and Bahrain). |
| 36 | + |
| 37 | +## Enable Defender for open-source relational databases |
| 38 | + |
| 39 | +1. Sign in to [the Azure portal](https://portal.azure.com) |
| 40 | + |
| 41 | +1. Search for and select **Microsoft Defender for Cloud**. |
| 42 | + |
| 43 | +1. Select **Environment settings**. |
| 44 | + |
| 45 | +1. Select the relevant AWS account. |
| 46 | + |
| 47 | +1. Locate the Databases plan and select **Settings**. |
| 48 | + |
| 49 | + :::image type="content" source="media/enable-defender-for-databases-aws/databases-settings.png" alt-text="Screenshot of the AWS environment settings page that shows where the settings button is located." lightbox="media/enable-defender-for-databases-aws/databases-settings.png"::: |
| 50 | + |
| 51 | +1. Toggle open-source relation databases to **On**. |
| 52 | + |
| 53 | + :::image type="content" source="media/enable-defender-for-databases-aws/toggle-open-source-on.png" alt-text="Screenshot that shows how to toggle the open-source relational databases to on." lightbox="media/enable-defender-for-databases-aws/toggle-open-source-on.png"::: |
| 54 | + |
| 55 | + > [!NOTE] |
| 56 | + > Toggling the open-source relational databases to on will also enable sensitive data discovery to on, which is a shared feature with Defender CSPM's sensitive data discovery for relation database service (RDS). |
| 57 | + > |
| 58 | + > :::image type="content" source="media/enable-defender-for-databases-aws/cspm-shared.png" alt-text="Screenshot that shows the settings page for Defender CSPM and the sensitive data turned on with the protected resources." lightbox="media/enable-defender-for-databases-aws/cspm-shared.png"::: |
| 59 | + > |
| 60 | + > Learn more about [sensitive data discovery in AWS RDS instances](concept-data-security-posture-prepare.md#discovering-aws-rds-instances). |
| 61 | +
|
| 62 | +1. Select **Configure access**. |
| 63 | + |
| 64 | +1. In the deployment method section, select **Download**. |
| 65 | + |
| 66 | +1. Follow the update stack in AWS instructions. This process will create or update the CloudFormation template with the [required permissions](#required-permissions-for-defenderforcloud-datathreatprotectiondb-role). |
| 67 | + |
| 68 | +1. Check the box confirming the CloudFormation template has been updated on AWS environment (Stack). |
| 69 | + |
| 70 | +1. Select **Review and generate**. |
| 71 | + |
| 72 | +1. Review the presented information and select **Update**. |
| 73 | + |
| 74 | +Defender for Cloud will automatically [make changes to your parameter and option group settings](#affected-parameter-and-option-group-settings). |
| 75 | + |
| 76 | +### Required permissions for DefenderForCloud-DataThreatProtectionDB Role |
| 77 | + |
| 78 | +The following table shows a list of the required permissions that were given to the role that was created or updated, when you downloaded the CloudFormation template and updated the AWS Stack. |
| 79 | + |
| 80 | +| Permission added | Description | |
| 81 | +|--|--| |
| 82 | +| rds:AddTagsToResource | to add tag on option group and parameter group created | |
| 83 | +| rds:DescribeDBClusterParameters | describe the parameters inside the cluster group | |
| 84 | +| rds:CreateDBParameterGroup | create database parameter group | |
| 85 | +| rds:ModifyOptionGroup | modify option inside the option group | |
| 86 | +| rds:DescribeDBLogFiles | describe the log file | |
| 87 | +| rds:DescribeDBParameterGroups | describe the database parameter group | |
| 88 | +| rds:CreateOptionGroup | create option group | |
| 89 | +| rds:ModifyDBParameterGroup | modify parameter inside the databases parameter group | |
| 90 | +| rds:DownloadDBLogFilePortion | download log file | |
| 91 | +| rds:DescribeDBInstances | describe the database | |
| 92 | +| rds:ModifyDBClusterParameterGroup | modify cluster parameter inside the cluster parameter group | |
| 93 | +| rds:ModifyDBInstance | modify databases to assign parameter group or option group if needed | |
| 94 | +| rds:ModifyDBCluster | modify cluster to assign cluster parameter group if needed | |
| 95 | +| rds:DescribeDBParameters | describe the parameters inside the database group | |
| 96 | +| rds:CreateDBClusterParameterGroup | create cluster parameter group | |
| 97 | +| rds:DescribeDBClusters | describe the cluster | |
| 98 | +| rds:DescribeDBClusterParameterGroups | describe the cluster parameter group | |
| 99 | +| rds:DescribeOptionGroups | describe the option group | |
| 100 | + |
| 101 | +## Affected parameter and option group settings |
| 102 | + |
| 103 | +When you enable Defender for open-source relational databases on your RDS instances, Defender for Cloud automatically enables auditing by using audit logs in order to be able to consume and analyze access patterns to your database. |
| 104 | + |
| 105 | +Each relational database management system or service type has its own requirements. The following table describes the requirements for each type. |
| 106 | + |
| 107 | +| Type | Parameter | Value | |
| 108 | +|--|--|--| |
| 109 | +| PostgreSQL and Aurora PostgreSQL | log_connections | 1| |
| 110 | +| PostgreSQL and Aurora PostgreSQL | log_disconnections | 1 | |
| 111 | +| Aurora MySQL instance and cluster parameter group | server_audit_logging | 1 | |
| 112 | +| Aurora MySQL instance and cluster parameter group | server_audit_events | - If it exists, expand the value to include CONNECT, QUERY, <br> - If it doesn't exist, add it with the value CONNECT, QUERY. | |
| 113 | +| Aurora MySQL instance and cluster parameter group | server_audit_excl_users | If it exists, expand it to include rdsadmin. | |
| 114 | +| Aurora MySQL instance and cluster parameter group | server_audit_incl_users | - If it exists with a value and rdsadmin as part of the include, then it won't be present in SERVER_AUDIT_EXCL_USER, and the value of include is empty. | |
| 115 | + |
| 116 | +An option group is required for MySQL and MariaDB with the following options for the MARIADB_AUDIT_PLUGIN (If the option doesn’t exist, add the option. If the option exists expand the values in the option): |
| 117 | + |
| 118 | +| Option name | Value | |
| 119 | +|--|--| |
| 120 | +| SERVER_AUDIT_EVENTS | If it exists, expand the value to include CONNECT <br> If it doesn't exist, add it with value CONNECT. | |
| 121 | +| SERVER_AUDIT_EXCL_USER | If it exists, expand it to include rdsadmin. | |
| 122 | +| SERVER_AUDIT_INCL_USERS | If it exists with a value and rdsadmin is part of the include, then it won't be present in SERVER_AUDIT_EXCL_USER, and the value of include is empty. | |
| 123 | + |
| 124 | +> [!IMPORTANT] |
| 125 | +> You may need to reboot your instances to apply the changes. |
| 126 | +> |
| 127 | +> If you are using the default parameter group, a new parameter group will be created that includes the required parameter changes with the prefix `defenderfordatabases*`. |
| 128 | +> |
| 129 | +> If a new parameter group was created or if static parameters were updated, they won't take effect until the instance is restarted. |
| 130 | +
|
| 131 | +> [!NOTE] |
| 132 | +> - If a parameter group already exists it will be updated accordingly. |
| 133 | +> |
| 134 | +> - MARIADB_AUDIT_PLUGIN is supported in MariaDB 10.2 and higher, MySQL 8.0.25 and higher 8.0 versions and All MySQL 5.7 versions. |
| 135 | +> |
| 136 | +> - Changes to [MARIADB_AUDIT_PLUGIN are added to the next maintenance window](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MySQL.Options.AuditPlugin.html#Appendix.MySQL.Options.AuditPlugin.Add). |
| 137 | +
|
| 138 | +## Related content |
| 139 | + |
| 140 | +- [What's supported in Sensitive Data Discovery](concept-data-security-posture-prepare.md#whats-supported). |
| 141 | +- [Discovering sensitive data on AWS RDS instances](concept-data-security-posture-prepare.md#discovering-aws-rds-instances). |
| 142 | + |
| 143 | +## Next step |
| 144 | + |
| 145 | +> [!div class="nextstepaction"] |
| 146 | +> [Respond to Defender OSS alerts](defender-for-databases-usage.md) |
0 commit comments