Skip to content

Commit d7ce6b1

Browse files
arunpamulapatichriscwmoonandres-zunigaramdaskmdbdleiva04
authored
Release/0.3.3 (#188)
* serverless compatability check * update logger methods for serverless * changes to support serverless - 1 * changes to sat driver to make it serverless compataible * import time from driver * fix logging utils to create file , fix to dbsql client to parse the correct response * fixes related to logger * fix logger regression issues * bug fixes on the left over file -part 1 * bug fixes and code refactor * drop staging database before each run * move drop intermediate schema to initialize * Update TERRAFORM_Azure.md updated Azure terraform instruction with SP requirements * Added dashboard and corrected the name in the setup notebook * Update TERRAFORM_Azure.md more readable format. * updated sdk ,removed local references and minot refactoring * Bug Fixes using sdk * logfile changes * removed stale secrets and moved to variables * utility to dynamically infer json schema from rest response * Terraform changes to support sat run on serverless * New dashboard and code to create * fixed edge case for PAT expiry when only one token meets the condition. * GCP tests completed * Removed internal workspace link in dashboard * Fixed removed changes * Removed logger * Add serverless configuration options for DABs * Refactor job cluster configuration for serverless compatibility * Added detailed instructions to add SP to workspaces * Fixed serverless compute with TF * added run on serverless to the provider * update serverless instructions --------- Co-authored-by: sudharshanraja-db <sudharshanraja-db> Co-authored-by: Chris Moon <chiwoong.moon@gmail.com> Co-authored-by: andres-zuniga <andres.zuniga@databricks.com> Co-authored-by: ramdas.murali <ramdas.murali@databricks.com> Co-authored-by: arunpamulapati <arunpamulapati> Co-authored-by: David Leiva <david.leiva@databricks.com>
1 parent 61b9122 commit d7ce6b1

53 files changed

Lines changed: 611 additions & 5403 deletions

Some content is hidden

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

dabs/dabs_template/databricks_template_schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
"node_type": {
2121
"type": "string",
2222
"description": "Node Type"
23+
},
24+
"serverless": {
25+
"type": "boolean",
26+
"description": "Serverless"
2327
}
2428
},
2529
"success_message": ""

dabs/dabs_template/template/tmp/resources/sat_driver_job.yml.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ resources:
77
timezone_id: "America/New_York"
88
tasks:
99
- task_key: "sat_initializer"
10+
{{- if eq .serverless false }}
1011
job_cluster_key: job_cluster
1112
libraries:
1213
- pypi:
1314
package: dbl-sat-sdk
15+
{{- end }}
1416
notebook_task:
1517
notebook_path: "../notebooks/security_analysis_driver.py"
1618

19+
{{- if eq .serverless false }}
1720
job_clusters:
1821
- job_cluster_key: job_cluster
1922
new_cluster:
@@ -26,3 +29,4 @@ resources:
2629
gcp_attributes:
2730
google_service_account: {{.google_service_account}}
2831
{{- end }}
32+
{{- end }}

dabs/dabs_template/template/tmp/resources/sat_initiliazer_job.yml.tmpl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ resources:
55

66
tasks:
77
- task_key: "sat_initializer"
8+
9+
{{- if eq .serverless false }}
810
job_cluster_key: job_cluster
11+
912
libraries:
1013
- pypi:
1114
package: dbl-sat-sdk
15+
{{- end }}
1216
notebook_task:
1317
notebook_path: "../notebooks/security_analysis_initializer.py"
14-
18+
19+
{{- if eq .serverless false }}
1520
job_clusters:
1621
- job_cluster_key: job_cluster
1722
new_cluster:
@@ -23,4 +28,5 @@ resources:
2328
{{- if eq .cloud "gcp" }}
2429
gcp_attributes:
2530
google_service_account: {{.google_service_account}}
26-
{{- end }}
31+
{{- end }}
32+
{{- end }}

dabs/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def install(client: WorkspaceClient, answers: dict, profile: str):
2525
photon_driver_capable=True,
2626
photon_worker_capable=True,
2727
),
28+
"serverless": answers.get("enable_serverless", False),
2829
}
2930

3031
config_file = "tmp_config.json"

dabs/sat/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ def form():
4848
message="Schema name for SAT",
4949
default="security_analysis",
5050
),
51+
Confirm(
52+
name="enable_serverless",
53+
message="Run on serverless?",
54+
default=True,
55+
),
5156
List(
5257
name="warehouse",
5358
message="Select warehouse",

dashboards/SAT_Dashboard_definition.json

Lines changed: 1 addition & 4863 deletions
Large diffs are not rendered by default.

docs/deprecated_old_setup.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Note: The manual setup is out dates and is deprecated. Please use [Terraform or Standard](https://github.com/databricks-industry-solutions/security-analysis-tool/tree/main?tab=readme-ov-file#security-analysis-tool-sat) setup.
12
## Checklist to prepare for SAT setup
23

34
**Note**: SAT creates a new **security_analysis** databses and Delta tables.

docs/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> **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.
44
5-
> **Note**: SAT requires at least one SAT set up in a workspace per **account** in AWS or GCP and at least one SAT set up in a workspace per Azure **subscription**.
5+
> **Note**: SAT requires at least one SAT set up in a workspace per **account** in AWS or GCP and at least one SAT set up in a workspace per Azure **subscription**. SAT uses the Service Principal configured with SAT to access and analyze configurations by calling account and workspace APIs. Please make sure to add the Service Principal to the workspaces you wish to analyze as instructed in the setup guides below. SAT running on serverless or classic compute can't analyze account and destination workspaces with IP ACLs configured unless the ACLs are updated to allow access from the SAT workspace. SAT running on Serverless compute can't access other workspaces if the SAT workspace has serverless egress controls configured. In these scenarios, a separate SAT can be configured to analyze the respective target workspace by setting up SAT in that workspace.
66
77
> Please make sure to review the SAT report with your business stakeholders, administrators, security team and auditors about SAT report and assess your organizational security requirements before making any security improvements bases on the report, not all deviations required to be mitigated. Some of the recommendations may have cost implications, some of the security features recommended may have dependency feature limitations, please thoroughly review individual feature documentation before making changes to your security configurations.
88

docs/setup/aws.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The first step is to create a Service Principal in Databricks. This will allow S
3232

3333
![AWS_SP_Workspace](../images/gcp_ws.png)
3434

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
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. Please [add this Service Princple](https://docs.databricks.com/en/admin/users-groups/service-principals.html#assign-a-service-principal-to-a-workspace-using-the-account-console) to **each workspace** so that SAT can access the APIs for analysis.
3636
3737
## Installation
3838

docs/setup/azure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ After creating the App Registration and client secret, you will need to add the
6363

6464
See the [Databricks documentation](https://learn.microsoft.com/en-us/azure/databricks/admin/users-groups/service-principals#--databricks-and-microsoft-entra-id-formerly-azure-active-directory-service-principals) for more information on adding service principals.
6565

66-
> The Service Principle requires an [Accounts Admin role](https://learn.microsoft.com/en-us/azure/databricks/admin/users-groups/service-principals#--assign-account-admin-roles-to-a-service-principal), [Admin role](https://learn.microsoft.com/en-us/azure/databricks/admin/users-groups/service-principals#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://learn.microsoft.com/en-us/azure/databricks/data-governance/unity-catalog/manage-privileges/admin-privileges#who-has-metastore-admin-privileges) is required to analyze many of the APIs.
66+
> The Service Principle requires an [Accounts Admin role](https://learn.microsoft.com/en-us/azure/databricks/admin/users-groups/service-principals#--assign-account-admin-roles-to-a-service-principal), [Admin role](https://learn.microsoft.com/en-us/azure/databricks/admin/users-groups/service-principals#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://learn.microsoft.com/en-us/azure/databricks/data-governance/unity-catalog/manage-privileges/admin-privileges#who-has-metastore-admin-privileges) is required to analyze many of the APIs. Please [add this Service Princple](https://learn.microsoft.com/en-us/azure/databricks/admin/users-groups/service-principals) to **each workspace** so that SAT can access the APIs for analysis.
6767
6868
## Installation
6969

0 commit comments

Comments
 (0)