Skip to content

Commit bf5478f

Browse files
authored
Merge pull request #36 Adding PreventDirectInternetAccessSageMakerNotebook
Adding PreventDirectInternetAccessSageMakerNotebook
2 parents 33934f4 + 395651a commit bf5478f

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

service_control_policies/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,10 @@ Services such as Lambda, AWS Glue, CloudShell, App Runner, and SageMaker support
248248
### "Sid": "PreventNonVpcOnlySageMakerDomain"
249249

250250
This statement is included in the [data_perimeter_governance_policy_2.json](data_perimeter_governance_policy_2.json) and prevents users from creating [Amazon SageMaker domains](https://docs.aws.amazon.com/sagemaker/latest/dg/sm-domain.html) that can access the internet through a VPC managed by SageMaker, or updating SageMaker domains to allow access to the internet through a VPC managed by SageMaker.
251-
For more details, see the definition of the parameter [`AppNetworkAccessType`](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateDomain.html#sagemaker-UpdateDomain-request-AppNetworkAccessType) in the Amazon SageMaker API Reference.
251+
For more details, see the definition of the parameter [`AppNetworkAccessType`](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateDomain.html#sagemaker-UpdateDomain-request-AppNetworkAccessType) in the Amazon SageMaker API Reference.
252+
253+
254+
### "Sid": "PreventDirectInternetAccessSageMakerNotebook"
255+
256+
This statement is included in the [data_perimeter_governance_policy_2.json](data_perimeter_governance_policy_2.json) and prevents users from creating [Amazon SageMaker Notebooks Instances](https://docs.aws.amazon.com/sagemaker/latest/dg/nbi.html) that can access the internet through a VPC managed by SageMaker.
257+
For more details, see [Connect a Notebook Instance in a VPC to External Resources](https://docs.aws.amazon.com/sagemaker/latest/dg/appendix-notebook-and-internet-access.html) in the Amazon SageMaker documentation.

service_control_policies/data_perimeter_governance_policy_2.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,28 @@
108108
],
109109
"Resource": "*",
110110
"Condition": {
111-
"StringNotEquals": {
111+
"StringNotEqualsIfExists": {
112+
"aws:PrincipalTag/dp:exclude": "true",
112113
"sagemaker:AppNetworkAccessType": "VpcOnly"
113114
}
114115
}
115116
},
117+
{
118+
"Sid": "PreventDirectInternetAccessSageMakerNotebook",
119+
"Effect": "Deny",
120+
"Action": [
121+
"sagemaker:CreateNotebookInstance"
122+
],
123+
"Resource": "*",
124+
"Condition": {
125+
"StringEquals": {
126+
"sagemaker:DirectInternetAccess": "Enabled"
127+
},
128+
"StringNotEqualsIfExists": {
129+
"aws:PrincipalTag/dp:exclude": "true"
130+
}
131+
}
132+
},
116133
{
117134
"Sid":"PreventNonVPCDeploymentLambda",
118135
"Effect":"Deny",

0 commit comments

Comments
 (0)