Skip to content

Commit c9da49f

Browse files
Release/0.3.0 (#144)
* Feature/sfe 3067 proxy (#140) * Fixed data type (#132) Co-authored-by: arunpamulapati <arunpamulapati> * Updated the SBP content to make sure the checks are clearly noted with mutual exclusive nature (#133) Co-authored-by: arunpamulapati <arunpamulapati> --------- Co-authored-by: Arun Pamulapati <[email protected]> * Sfe 3029 remove dependency on pat dashboards (#141) * Fixed data type (#132) Co-authored-by: arunpamulapati <arunpamulapati> * Updated the SBP content to make sure the checks are clearly noted with mutual exclusive nature (#133) Co-authored-by: arunpamulapati <arunpamulapati> * Removed dependency on PAT token * Added proxies to config --------- Co-authored-by: Arun Pamulapati <[email protected]> Co-authored-by: arunpamulapati <arunpamulapati> * Feature/sfe 3028 configure schema through setup (#142) * Made schema configurable * fixed catalog name doc --------- Co-authored-by: arunpamulapati <arunpamulapati> * Update SAT configuration to include proxy support DABs, WIP TF * Update TF code * Add proxy support to SAT configuration * delete previous initialize.py * added condition to check if database already has security_best_practices * update SAT configuration to include catalog and security analysis schema * Change proxy type for TF * removed comments cell. * Updated to not use PAT for testing * removed PAT in the print * Updated TF to make sure we have analysis_schema_name working * updated to not use PAT for testing * Update README.md to fix borken terrform links * Add analysis_schema_name variable to GCP provider configuration * moved away from PATs for GCP to use temp tokens * Made GCP TF to go with the current code * Update setup documentation and remove PAT references * Update setup.md added note about SAT install rule for a given account and subscription. * Updated best practices file * Update setup.md Added dashboard new location for the legacy dashboards. * Update setup documentation to include support for Unity Catalog and proxies * Update security_best_practices.csv merged from main --------- Co-authored-by: David Leiva <[email protected]> Co-authored-by: arunpamulapati <arunpamulapati>
1 parent 1e294f7 commit c9da49f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+520
-489
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99

1010
Refer to specific use-case:
1111
- [Standard setup guide](./docs/setup.md)
12-
- [Terraform](./terraform/README.md)
12+
- Terraform
13+
- [AWS](./terraform/aws/TERRAFORM_AWS.md)
14+
- [Azure](./terraform/azure/TERRAFORM_Azure.md)
15+
- [GCP](./terraform/gcp/TERRAFORM_GCP.md)
1316
- [Deprecated: Manual setup](./docs/deprecated_old_setup.md)
1417

1518
## Introduction

configs/security_best_practices.csv

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

dabs/dabs_template/initialize.py.tmpl

Lines changed: 0 additions & 139 deletions
This file was deleted.

dabs/sat/config.py

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,37 @@ def form():
4343
ignore=lambda x: not x["enable_uc"],
4444
default="hive_metastore",
4545
),
46+
Text(
47+
name="security_analysis_schema",
48+
message="Schema name for SAT",
49+
default="security_analysis",
50+
),
4651
List(
4752
name="warehouse",
4853
message="Select warehouse",
4954
choices=loading(get_warehouses, client=client),
5055
),
5156
]
52-
questions = questions + cloud_specific_questions(client)
57+
proxies = [
58+
Confirm(
59+
name="use_proxy",
60+
message="Want to use a proxy?",
61+
default=False,
62+
),
63+
Text(
64+
name="http",
65+
message="HTTP Proxy",
66+
ignore=lambda x: not x["use_proxy"],
67+
default="",
68+
),
69+
Text(
70+
name="https",
71+
message="HTTPS Proxy",
72+
ignore=lambda x: not x["use_proxy"],
73+
default="",
74+
),
75+
]
76+
questions = questions + cloud_specific_questions(client) + proxies
5377
return client, prompt(questions), profile
5478

5579

@@ -116,15 +140,6 @@ def generate_secrets(client: WorkspaceClient, answers: dict, cloud_type: str):
116140

117141
client.secrets.create_scope(scope_name)
118142

119-
token = client.tokens.create(
120-
lifetime_seconds=86400 * 90,
121-
comment="Security Analysis Tool",
122-
)
123-
client.secrets.put_secret(
124-
scope=scope_name,
125-
key=f"sat-token-{client.get_workspace_id()}",
126-
string_value=token.token_value,
127-
)
128143
client.secrets.put_secret(
129144
scope=scope_name,
130145
key="account-console-id",
@@ -135,6 +150,29 @@ def generate_secrets(client: WorkspaceClient, answers: dict, cloud_type: str):
135150
key="sql-warehouse-id",
136151
string_value=answers["warehouse"]["id"],
137152
)
153+
client.secrets.put_secret(
154+
scope=scope_name,
155+
key="analysis_schema_name",
156+
string_value=f'{answers["catalog"]}.{answers["security_analysis_schema"]}',
157+
)
158+
159+
if answers["use_proxy"]:
160+
client.secrets.put_secret(
161+
scope=scope_name,
162+
key="proxies",
163+
string_value=json.dumps(
164+
{
165+
"http": answers["http"],
166+
"https": answers["https"],
167+
}
168+
),
169+
)
170+
else:
171+
client.secrets.put_secret(
172+
scope=scope_name,
173+
key="proxies",
174+
string_value="{}",
175+
)
138176

139177
if cloud_type == "aws":
140178
client.secrets.put_secret(

dabs/setup.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ config_file=$3
66

77

88
cp -r ../configs ../notebooks ../dashboards ./dabs_template/template/tmp
9-
rm ./dabs_template/template/tmp/notebooks/Utils/initialize.py
10-
cp ./dabs_template/initialize.py.tmpl ./dabs_template/template/tmp/notebooks/Utils/initialize.py.tmpl
119

1210
databricks bundle init ./dabs_template -p $profile --config-file $config_file
1311
rm -rf $config_file

docs/deprecated_old_setup.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ Please gather the following information before you start setting up:
206206
* Set the PAT token value for the workspace_id
207207
* Set the value for the account_id
208208
* Set the value for the sql_warehouse_id
209+
* Set the value for the analysis_schema_name to store SAT analysis results (for UC use catalog.schema name , for hive use schema name)
209210
210211
211212
```
@@ -219,6 +220,10 @@ Please gather the following information before you start setting up:
219220
```
220221
databricks --profile e2-sat secrets put-secret sat_scope sql-warehouse-id
221222
```
223+
224+
```
225+
databricks --profile e2-sat secrets put-secret sat_scope analysis_schema_name
226+
```
222227
223228
224229
* In your environment where you imported SAT project from git (Refer to Step 4 in Prerequisites) Open the \<SATProject\>/notebooks/Utils/initialize notebook and modify the JSON string with :
@@ -230,7 +235,8 @@ Please gather the following information before you start setting up:
230235
```
231236
{
232237
"account_id": dbutils.secrets.get(scope="sat_scope", key="account-console-id"),
233-
"sql_warehouse_id": dbutils.secrets.get(scope="sat_scope", key="sql-warehouse-id")
238+
"sql_warehouse_id": dbutils.secrets.get(scope="sat_scope", key="sql-warehouse-id"),
239+
"analysis_schema_name": dbutils.secrets.get(scope="sat_scope", key="analysis_schema_name"),
234240
"verbosity":"info"
235241
}
236242

docs/images/gcp_ws.png

148 KB
Loading

docs/setup.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Setup Guide
22

3+
> **SAT v0.2.0 or higher** brings full support for Unity Catalog. Now you can pick your catalog instead of hive_metastore. Plus, you get to choose your own schema name.
4+
35
Follow this guide to setup the Security Analysis Tool (SAT) on your Databricks workspace.
46

57
## Prerequisites
@@ -27,12 +29,13 @@ SAT creates a new security_analysis database and Delta tables. If you are an exi
2729
### Unity Catalog based schema
2830

2931
```sql
30-
drop database <uc_catalog_name>.security_analysis cascade;
32+
drop database <uc_catalog_name>.<schema_name> cascade;
3133
```
3234

3335
## Setup
3436

35-
> SAT is a productivity tool to help verify security configurations of Databricks deployments, it's not meant to be used as certification or attestation of your deployments. SAT project is regularly updated to improve the correctness of checks, add new checks, and fix bugs. Please send your feedback and comments to [email protected].
37+
> SAT is a productivity tool to help verify security configurations of Databricks deployments, it's not meant to be used as certification or attestation of your deployments. SAT project is regularly updated to improve the correctness of checks, add new checks, and fix bugs. You will need a single SAT install per Databricks account in AWS and GCP and a single install per azure subscription in Azure. Add the Service principle as mentioned in the detailed steps to analyze the rest of the workspaces from the workspace where SAT is installed. You can choose not to add SP to a given workspace if you wish to ignore a given workspace.
38+
> Please send your feedback and comments to [email protected].
3639
3740
SAT can be setup on any of the cloud providers where Databricks is hosted. Follow the setup guide for the cloud provider you are using:
3841

@@ -70,10 +73,10 @@ You now have two jobs (SAT Initializer Notebook & SAT Driver Notebook). Run SAT
7073

7174
### 2. Access Databricks SQL Dashboards
7275

73-
> **Note:** You can also use Lakeview Dashboards to view the results, instead of classic Dashboards.
76+
> **Note:** You can also use Lakeview Dashboards to view the results.
7477
7578

76-
In DBSQL find "SAT - Security Analysis Tool" dashboard to see the report. You can filter the dashboard by **SAT** tag.
79+
In DBSQL find "SAT - Security Analysis Tool" dashboard to see the report. You can filter the dashboard by **SAT** tag. (The old classic legacy dashboard can be found in Workspace -> Home -> SAT_dashboard)
7780

7881
<img src="./images/sat_dashboard_loc.png" width="70%" height="70%">
7982

docs/setup/aws.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ The first step is to create a Service Principal in Databricks. This will allow S
3030
- Save the `Secret` and `Client ID`
3131
- To deploy SAT in a workspace, you must add the Service Principal to the workspace.
3232

33-
![AWS_SP_Workspace](../images/aws_ws.png)
33+
![AWS_SP_Workspace](../images/gcp_ws.png)
3434

35-
> The Service Principle requires an [Accounts Admin role](https://docs.databricks.com/en/admin/users-groups/service-principals.html#assign-account-admin-roles-to-a-service-principal), [Admin role](https://docs.databricks.com/en/admin/users-groups/service-principals.html#assign-a-service-principal-to-a-workspace-using-the-account-console) for **each workspace** and needs to be a member of the [metastore admin group](https://docs.databricks.com/en/data-governance/unity-catalog/manage-privileges/admin-privileges.html#who-has-metastore-admin-privileges) is required to analyze many of the APIs
35+
> The Service Principle requires an [Accounts Admin role](https://docs.gcp.databricks.com/en/admin/users-groups/service-principals.html#assign-account-admin-roles-to-a-service-principal), [Admin role](https://docs.gcp.databricks.com/en/admin/users-groups/service-principals.html#assign-a-service-principal-to-a-workspace-using-the-account-console) for **each workspace** and needs to be a member of the [metastore admin group](https://docs.gcp.databricks.com/en/data-governance/unity-catalog/manage-privileges/admin-privileges.html#who-has-metastore-admin-privileges) is required to analyze many of the APIs
3636
3737
## Installation
3838

@@ -61,6 +61,7 @@ To execute the SAT follow these steps on your workstation or a compatible VM tha
6161
./install.sh
6262
```
6363

64+
> **Proxies are now supported as part of SAT. You can add your HTTP and HTTPS links to use your proxies.**
6465
6566
![](../gif/terminal-aws.gif)
6667

docs/setup/faqs_and_troubleshooting.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ We created diagnosis notebooks for respective clouds to help troubleshoot your S
1616
* [SAT Azure troubleshooting notebook](https://github.com/databricks-industry-solutions/security-analysis-tool/blob/main/notebooks/diagnosis/sat_diagnosis_azure.py)
1717
* [SAT GCP troubleshooting notebook](https://github.com/databricks-industry-solutions/security-analysis-tool/blob/main/notebooks/diagnosis/sat_diagnosis_gcp.py)
1818

19-
### 1. Incorrectly configured secrets
19+
### Incorrectly configured secrets
2020

2121
* **Error:**
2222

@@ -31,19 +31,7 @@ We created diagnosis notebooks for respective clouds to help troubleshoot your S
3131
databricks --profile e2-sat secrets list-secrets sat_scope
3232
```
3333
34-
### 2. Invalid access token
35-
36-
* **Error:**
37-
38-
```
39-
Error 403 Invalid access token.
40-
```
41-
42-
* **Resolution:**
43-
44-
Check your PAT token configuration for the `workspace_pat_token` key.
45-
46-
### 3. Firewall blocking Databricks accounts console
34+
### Firewall blocking Databricks accounts console
4735
4836
* **Error:**
4937
@@ -86,7 +74,7 @@ We created diagnosis notebooks for respective clouds to help troubleshoot your S
8674
8775
If you don’t see a JSON with a clean listing of workspaces, you are likely having a firewall issue that is blocking calls to the accounts console. Please have your infrastructure team add `accounts.cloud.databricks.com` to the allow-list. Ensure that the private IPv4 address from the NAT gateway is added to the IP allow list.
8876
89-
### 4. Offline install of libraries in case of no PyPI access
77+
### Offline install of libraries in case of no PyPI access
9078
9179
* **Steps:**
9280

0 commit comments

Comments
 (0)