# Creating an Environment

Follow this guide to install P0 for data collection in your cloud provider, and to run your first posture and inventory scans.

## Install for IAM data collection

First, you'll need to connect P0 to your cloud service provider.

{% hint style="warning" %}
If you have P0 installed for just-in-time access, you'll still need to follow this step, as data collection requires different permissions in your cloud provider.
{% endhint %}

Begin by navigating to your provider's integration page on the P0 app (after login to [p0.app](https://p0.app), select "Integrations", then your cloud provider):

Choose "IAM assessment", then follow the steps on the app to install P0.

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-29d50c676431e937d5821f3d83bbec2b4a41cde3%2Fcreating-an-environment.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
Make sure you have the ability to create custom roles and assign privileges in your cloud provider before beginning.
{% endhint %}

{% hint style="info" %}
To augment the usage data available to P0, you may also install "Access logging"
{% endhint %}

## Running your first scan

Navigate to "Dashboard", then select "Create" under "Create an environment to get started":

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-6f618ab93dff19733ba11c6740171e4beaebea48%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Choose a useful name, an assessment frequency, and the targets to assess (this will be the resources you installed in the previous step), then select "Create Environment".

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-a78be2ba60b5f79d179941f0d556d1d42076f4e9%2Fimage.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
If you select "start scheduling assessments immediately", the first scan will run as soon as the environment is created. If you would rather trigger the scan manually, you may uncheck this setting, and navigate to "Settings" to run a scan once the environment is created.
{% endhint %}

Within a few moments P0 will start collecting data from your project:

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-4cc5b5c82f5680dd7f2c8f132586fbb60423c882%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

Once the data-collection job completes, click "Dashboard" to see your results.

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-79d6cbae1ab5af84bb4b79aff4ad978f467b701a%2Fimage%20(150).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

Congratulations, you've run your first environment scan with P0!

For information on how to view and use the results, see [access-inventory](https://docs.p0.dev/inventory/access-inventory "mention") and [posture-overview](https://docs.p0.dev/posture/posture-overview "mention").
