> 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/cortex-xsiam/cloud-security/serverless-function-posture-security/serverless-function-posture-policies/create-serverless-function-policies.md).

# Create serverless function policies

Create serverless function policies with rules and cloud account scopes in Cortex XSIAM.

The following procedure describes how to create policies for serverless functions.

1. Under **Posture Management**, select **Rules & Policies** → **Cloud Security (under Policies)** → **click Create Policy**.
2. On the **Details** step of the wizard:
   1. Fill in these fields:
      * **Policy Name** (required): An alias you provide to identify the policy
      * **Description** (required): A description of the policy
      * **Labels** (optional): Assign labels to categorize and organize the policy based on specific criteria or attributes. Labels help in easily identifying and filtering policies
   2. Click Next.
3. On the **Rules** step of the wizard.
   1. Select rules that check for violations when scanning serverless functions: Options:

      * **All Matching Filter Criteria**: Allows you to filter for rules according to criteria
      * **From Rules List**. Filter the rues list by the type of serverless function.
        1. Select From Rules List
        2. Select **Asset Type** from the **Select Field** menu of the query.
        3. Filter for the following serverless functions, depending on the target cloud provider for the rule. Options:
           * Azure Cloud Function
           * Google Cloud Function: Google Cloud Functions - 1st gen and 2nd gen (Cloud Functions API and Cloud Run Admin API.
           * Lambda Function

             <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><h3>Note</h3><p>You can select multiple options.</p></div>
        4. Select a rule or multiple rules from the resulting list.
      * **All Rules**: This option is not recommended as it will probably create a large number of issues/

      <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><h3>Note</h3><p>For more information about rules, refer to <a href="/cortex-xsiam/cloud-security/serverless-function-posture-security/serverless-function-posture-rules/manage-serverless-function-rules.md">Manage serverless function rules</a>.</p></div>
   2. Click Next.
4. On the **Scope** step of the of the wizard:
   1. Define the scope of the policy by selecting the assets it will apply to. Options:
      * **From Cloud Accounts** (recommended): Select one or more accounts to which this policy applies
      * **All Cloud Accounts** (not recommended): Selecting this option will likely result in a large volume of issues. For more relevant and higher fidelity results, select the **From Cloud Accounts** option
   2. Click Done.


---

# 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/cortex-xsiam/cloud-security/serverless-function-posture-security/serverless-function-posture-policies/create-serverless-function-policies.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.
