# Get Started

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2FUrcSqiRaeuHE7qdCJ5sD%2Fimage.png?alt=media&#x26;token=84ed0a62-dbb2-4679-815e-246ea59f39f6" alt=""><figcaption></figcaption></figure>

## Linking Accounts

To get started, you will deploy our CloudFormation stack into the first AWS account which you would like to us to ingest data from, confirm the stack creation in DataDefender, and we'll begin ingesting data. You can link as many AWS accounts as you would like using the following method.

Linking an Account is a 4-5 step process. This page will detail how to complete each step.

* Initiate Deployment from DataDefender
* Configure and deploy CloudFormation stack from AWS
* Add SQS Permissions and set up Event Notification (If using Activity Monitor)
* Link the stack to DataDefender
* Confirm Deployment

### 1. Initiate Deployment from DataDefender&#x20;

In order to do this, navigate to Settings > **Linked Accounts** and click the "Link New Account" button.&#x20;

The following form will assist in linking an AWS Account.

#### Account Details

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2FlTafzjyjtW3iH3XhKl8G%2Fimage.png?alt=media&#x26;token=52862e36-b4ce-4eee-9b1b-a0c38024ede6" alt=""><figcaption></figcaption></figure>

* Enter the Account ID of your AWS account. &#x20;
  1. To find your account id, sign in to the AWS Management Console, click your account name in the top-right corner. Your 12-digit Account ID will display within this dropdown.
* Optionally, add an Account Name.
  1. We recommend you add the friendly name of your account, but this can be whatever you would like that will help you identify this account later. &#x20;
  2. This name can be changed at any time if you’d like.

#### Inventory Selection

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2F1lEXVTI47bCSU1vaGkw7%2Fimage.png?alt=media&#x26;token=12dd8bbd-d004-4caa-9547-c62693cc7ea6" alt=""><figcaption></figcaption></figure>

* Select the AWS Services that you would like us to collect and protect.
  1. Selecting a service will ensure the required permissions are deployed by the CloudFormation stack for us to retrieve its data. These permissions can be modified at any time.
  2. Selecting 'Security Checks' allows us to run configuration checks against your account to identify misconfigurations and compare your account against data security best practices.

#### File Scanning

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2FfvxBZ8xbpESKVkW1rEPg%2Fimage.png?alt=media&#x26;token=a9e938aa-cfbb-45c5-8ea2-5bf1d2b80f24" alt=""><figcaption></figcaption></figure>

* File Scanning allows DataDefender to scan and classify your data to find sensitive files. DataDefender will be granted ECS deployment permissions into select regions. Data scanned will never leave the region where it resides in.

#### Activity Monitoring

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2F2jLvmdyrFGWA2iyMP0lD%2Fimage.png?alt=media&#x26;token=dc3ccf9d-4962-40b9-80cb-4d27ba9a26ce" alt=""><figcaption></figcaption></figure>

* Activity Monitoring allows DataDefender to ingest CloudTrail and/or S3 Server Access Logs. For each type of activity monitor (CloudTrail, S3 Server Access Logs) we require one S3 bucket already set up with logs directed into them for the Application to ingest logs. DataDefender uses this information in its [Monitoring](https://help.datadefender.io/broken-reference) and [File Access Report](https://help.datadefender.io/broken-reference) features. Please refer to the [Configuring CloudTrail Log Bucket](#configuring-cloudtrail-log-bucket) and [Configuring Server Access Log Bucket](#configuring-server-access-log-bucket) sections for more details.
* Copy the full S3 bucket ARN for your desired log repository buckets and paste into the appropriate field.

### 2. Configure and deploy CloudFormation stack in AWS

Select 'Launch CloudFormation'. It will bring you to an AWS Login where you will need to sign in to the account where you wish to deploy our stack.

Once signed in, you'll be brought to CloudFormation's 'Quick create stack' menu.

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2FzwAwXcDZM9kgNOI2FZDm%2Fimage.png?alt=media&#x26;token=4a4e9b9a-c4d4-40da-80ee-7370b428449d" alt=""><figcaption><p>CSS CloudFormation Stack</p></figcaption></figure>

Linked Account Stack Parameters

Currently, we have 13 parameters that you can configure to deploy our stack. Most settings are already created from the form from the previous step. Here is each parameter and its function:

<table><thead><tr><th width="233">Parameter</th><th>Function</th><th>Example Values</th></tr></thead><tbody><tr><td>Stack Name</td><td>What your stack will be named</td><td>my-stack</td></tr><tr><td>ActivityMonitoringCloudTrailQueueName</td><td>Optional; name to give the created Activity Monitoring SQS queue.</td><td>datadefender-activity-monitoring-ct</td></tr><tr><td>ActivityMonitoringCloudTrailS3BucketArn</td><td>The ARN of the S3 bucket that CloudTrail events are logged to.</td><td>arn:aws:s3:::example</td></tr><tr><td>ActivityMonitoringS3ServerAccessLogsBucketArn</td><td>The ARN of the S3 bucket that S3 server access logs are logged to.</td><td>arn:aws:s3:::example</td></tr><tr><td>ActivityMonitoringS3ServerAccessLogsQueueName</td><td>Optional; name to give the created Activity Monitoring S3 Server Access Logs SQS queue.</td><td>datadefender-activity-monitoring-sal</td></tr><tr><td>ConnectionManagementType</td><td>Whether the connection is self-managed or is a manager of other connections.</td><td>Self, Managed</td></tr><tr><td>EnableActivityMonitoringCloudTrailFeatureSet</td><td>Pick Yes if you would like to enable the activity monitoring feature set for a CloudTrail event source.</td><td>Yes, No</td></tr><tr><td>EnableActivityMonitoringS3ServerAccessLogsFeatureSet</td><td>Pick Yes if you would like to enable the activity monitoring feature set for a S3 Server Access Logs event source.</td><td>Yes, No</td></tr><tr><td>EnableEBSInventoryFeatureSet</td><td>Pick Yes if you would like to enable the EBS Inventory feature set.</td><td>Yes, No</td></tr><tr><td>EnableFileSystemsInventoryFeatureSet</td><td>Pick Yes if you would like to enable the File Systems Inventory feature set.</td><td>Yes, No</td></tr><tr><td>EnableS3InventoryFeatureSet</td><td>Pick Yes if you would like to enable the S3 Inventory feature set.</td><td>Yes, No</td></tr><tr><td>EnableSecurityChecksFeatureSet</td><td>Pick Yes if you would like to enable the security checks feature set.</td><td>Yes, No</td></tr><tr><td>IamRoleNameSuffix</td><td>Optional; suffix to include in the created IAM role. May be required if there are IAM role name conflicts.</td><td>CloudStorageSec</td></tr><tr><td>IdentityProviderUrl</td><td>The URL of the Cloud Storage Security identity provider to verify the identity when assuming the role. Do not include https:// in the URL. This does not have to be modified.</td><td>auth.datadefender.io/realms/datadefender</td></tr></tbody></table>

After you are satisfied with your parameters, select '**I acknowledge that AWS CloudFormation might create IAM resources with custom names.**' and deploy the stack.

### 3. Add SQS Permissions and set up Event Notification

{% hint style="info" %}
This section only applies if you are using the Server Access Logs or CloudTrail functionality.
{% endhint %}

#### SQS Permissions

Go to the deployed CloudFormation stack and locate the SQS queues that the stack created. For each queue created, permissions must be added for SQS queues for the S3 buckets to forward event notifications to them. Keep any existing policy statements that exist, just **add** the snippet.

In the snippet, two pieces need to be replaced: {queue-arn}, and {s3-bucket-arn}.

For the CloudTrail queue, substitute the {s3-bucket-arn} value for the CloudTrail Bucket, and for the Server Access Logs queue, substitute the {s3-bucket-arn} value for the Server Access Logs.

In the Queue Access Policy, add the following snippet to the existing Policy. :

```
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "sqs:SendMessage",
      "Resource": "{queue-arn}",
      "Condition": {
        "ArnLike": {
          "aws:SourceArn": "{s3-bucket-arn}"
        }
      }
    }
```

#### Event Notification

For each type of bucket you've set up (Server Access Logs bucket, CloudTrail bucket):

Ensure that the previous step has been completed. S3 Bucket requires permissions prior to creating an Event Notification  for an SQS Queue.

Go to the S3 Bucket that the SQS Queue corresponds to and navigate to Properties. Under 'Event Notifications', click 'Create Event Notification'.&#x20;

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2FKH0KWQPOYsWUYultwSu1%2Fimage.png?alt=media&#x26;token=9b053989-58f1-46b4-afd2-214344920058" alt=""><figcaption></figcaption></figure>

In the settings:

1. &#x20;Set an Event name of your choosing.
2. &#x20;Ensure that 'All object create events' are checked.
3. Set destination as SQS queue, and specify the corresponding SQS queue that was created.
4. Select 'Save changes'.

### 4. Link the Stack to DataDefender

Go to the deployed CloudFormation stack and open the **Outputs** tab. You should see three outputs if you are using both the Activity Monitoring and Server Access Logs features. Otherwise, you'll just see one output.

* For all deployments, copy the **ARN of the Cross-Account IAM Role**.
* If you also enabled **Activity Monitoring – S3 Server Access Logs** and **Activity Monitoring – CloudTrail Feature Set**, copy the values of the respective queues as well.

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2F6BBlOb5D826wct6DIZLi%2FData%20Defender%201.png?alt=media&#x26;token=1637d501-791b-4431-8ac5-30e5f50771a1" alt=""><figcaption><p>Cross-Account Role ARN</p></figcaption></figure>

Now, return to the **DataDefender portal** and complete the following steps:

1. Leave the CloudFormation stack name and region as they appear (these are the stack name and region used in the previous deployment).
2. Paste the **Cross-Account IAM Role ARN** into the **AWS Role ARN** field.

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2FEj21ZHTTKOEDFQLdAUzB%2Fimage.png?alt=media&#x26;token=70d40c73-20d8-4e40-af4d-634c6663a34c" alt=""><figcaption></figcaption></figure>

If you enabled Activity Monitoring with CloudTrail or S3 Access Logging, complete **Configure Activity Monitoring**. (Otherwise, disable both CloudTrail and S3 Server Access Logs checkboxes and skip this step.)

* Paste the **CloudTrail Queue** value from the Outputs into the *CloudTrail queue name* field, and select the region where the queue resides.
* Paste the **S3 Access Logging Queue** value from the Outputs into the *S3 queue name* field, and select the region where the queue resides.

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2F9IvDOQ0CtCyQ83nYIRa9%2Fimage.png?alt=media&#x26;token=8f61785e-2c53-4604-8a08-0d0d39a42eab" alt=""><figcaption></figcaption></figure>

Click 'Complete Setup' to finalize your account linkage.

### 5. Confirm Deployment

Your stack should now be linked. Verify in the 'Linked Accounts' section for the green check symbol under 'Credential Status' alongside your alias.

<figure><img src="https://3802454275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FobDf5vJfItiNrkno1uJc%2Fuploads%2FvQe20m03KVju1ePRY8de%2Fimage.png?alt=media&#x26;token=81c2f08c-8f8a-4581-8fad-0562c867c011" alt=""><figcaption></figcaption></figure>

## Using the Product

Now that you have data flowing into your account, you are free to start using DataDefender! For explanations of the DataDefender Portal, head on over to the [Portal Overview](https://help.datadefender.io/portal-overview) page.
