> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec-aws-306.md).

# AWS SageMaker notebook instance is not placed in VPC misconfiguration detected in code

## Rule Details

|                        |                                      |
| ---------------------- | ------------------------------------ |
| Cortex AppSec Rule ID  | APPSEC\_AWS\_306                     |
| Category - Subcategory | Public Exposure - VPC VCN VNet       |
| Provider               | AWS                                  |
| Severity               | LOW                                  |
| Framework              | Terraform, Terraform Plan            |
| Mapped CSPM/KSPM Rule  | e776dc78-2f1a-4b19-b86f-79eeec8c90c0 |

## Impact

If a SageMaker notebook instance is not launched into a custom VPC, it might be exposed to security vulnerabilities. This exposure could arise from traffic not being restricted to a confined, secure environment. An instance launched outside of a custom VPC might also be at risk of unwanted access from unknown entities, which could lead to potential data breaches or unauthorized changes.

Therefore, launching instances into a custom VPC helps in the prevention of unauthorized access, minimizes attack surface, and provides a more secure and controlled environment. It helps safeguard valuable data and promotes safe business practices.

## How to Fix

*Resource:* aws\_sagemaker\_notebook\_instance

* *Arguments:* subnet\_id

## To fix this issue, you need to specify a `subnet_id` to create your SageMaker Notebook instance within a pre-defined VPC. Here is an example: \[source,go]

resource "aws\_sagemaker\_notebook\_instance" "notebook" { name = "notebook" role\_arn = aws\_iam\_role.role.arn

* subnet\_id = aws\_subnet.example.id # This launches it within a custom VPC instance\_type = "ml.t2.medium"

## lifecycle\_config\_name = aws\_sagemaker\_notebook\_instance\_lifecycle\_configuration.lifecycle\_configuration.name }


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec-aws-306.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
