You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57-5Lines changed: 57 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,20 +12,34 @@ Before using this module, make sure you have the following:
12
12
## Usage
13
13
14
14
To use this module in your Terraform configuration, add the following code in your existing Terraform code:
15
+
15
16
```hcl
17
+
# First we need to define the proper roles for our scanners. It consists of two different modules that have a two way bindings between them.
18
+
19
+
# 1. The "scanning delegate role" defines all the policies and IAM roles necessary for the scanner to interact and scan some specific account resources.
20
+
# It shall be created for every account that the agentless scanner will be able scan. These roles are meant to be assumed by the "agentless scanner role".
# 2. The "agentless scanner role" creates an EC2 instance profile along with an IAM role allowing the EC2 instance scanner to assume the scanning delegate role(s).
28
+
# It shall be created in the same account as the agentless scanner instance.
# As you can see there is a two way binding between these two "role" modules.
37
+
# - the scanner role requires the list of delegate role ARNs for the scanner to assume.
38
+
# - the delegate role(s) require the scanner role ARN as input in order to define the trust relationship between the EC2 scanner role and the delegate role to be assumed.
28
39
40
+
# Finally we can create the agentless scanner instance. It requires the instance profile name that was created by the scanner_role.
41
+
# This module will define the VPC, subnets, network and compute resources required for the agentless scanner.
42
+
# See the documentation of each module for more information or our examples for a complete setup.
@@ -54,6 +68,44 @@ To uninstall, remove the Agentless scanner module from your Terraform code. Remo
54
68
> [!WARNING]
55
69
> Exercise caution when deleting Terraform resources. Review the plan carefully to ensure everything is in order.
56
70
71
+
## Architecture
72
+
73
+
The Agentless Scanner deployment is split into different modules to allow for more flexibility and customization. The following modules are available:
74
+
75
+
-[scanning-delegate-role](./modules/scanning-delegate-role/): Creates the necessary IAM role and policies for the scanning delegate. It creates an IAM role in a specific account that the scanner can then assume to scan the account. This role allows read access to many different resources (EBS snapshots, Lambdas etc.) in the account to be able to scan them.
76
+
-[agentless-scanner-role](./modules/agentless-scanner-role/): Creates the necessary IAM role and policies for the agentless scanner instance. It creates an IAM role that allows the scanner to assume the role of the scanning delegate.
77
+
-[instance](./modules/instance/): Creates the EC2 instance that runs the agentless scanner. This instance is launched as part of an Auto Scaling group to ensure high availability.
78
+
-[user_data](./modules/user_data/): Creates the user data script that installs and configures the agentless scanner on the EC2 instance.
79
+
-[vpc](./modules/vpc/): Creates the VPC, subnets and all network resources required for the agentless scanner.
80
+
81
+
The main module provided at the root of this repository is a thin wrapper around the vpc, user_data and instance modules, with simplified inputs. The scanning-delegate-role and agentless-scanner-role modules are intended to be used in conjunction with this module, as they define the proper IAM permissions for the scanner.
82
+
83
+
```mermaid
84
+
flowchart TD
85
+
subgraph "Account A"
86
+
subgraph "Main module"
87
+
UD[user_data]
88
+
VPC[vpc]
89
+
I[instance]
90
+
UD-->I
91
+
VPC-->I
92
+
end
93
+
94
+
SR[agentless-scanner-role]
95
+
SR-->I
96
+
97
+
DRA[scanning-delegate-role A]
98
+
DRA-- trusts -->SR
99
+
SR-- assumes -->DRA
100
+
end
101
+
102
+
subgraph "Account B"
103
+
DRB[scanning-delegate-role B]
104
+
DRB-- trusts -->SR
105
+
SR-- assumes -->DRB
106
+
end
107
+
```
108
+
57
109
## Examples
58
110
59
111
For complete examples, refer to the [examples](./examples/) directory in this repository.
Copy file name to clipboardExpand all lines: examples/README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,3 +20,7 @@ To scan across accounts, see the [example](cross_account/README.md)
20
20
# Custom VPC Example
21
21
22
22
If you want to avoid creating a new VPC for the Agentless scanners, and you want to reuse one of your own, see the [example](custom_vpc/README.md)
23
+
24
+
# Custom Agent Configurations Example
25
+
26
+
If you want to add custom configurations for our Datadog Agent running alongside our scanners, see the [example](custom_agent_configurations/README.md)
Copy file name to clipboardExpand all lines: modules/agentless-scanner-role/README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
## Description
2
+
3
+
The agentless-scanner-role module creates the proper role and policies for the agentless scanner instance to be able to assume the scanning delegate roles.
4
+
5
+
It exports the role and instance profile that should be attached to the agentless scanner instance.
Copy file name to clipboardExpand all lines: modules/scanning-delegate-role/README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
## Description
2
+
3
+
The scanning-delegate-role module creates the proper role and policies to allow the agentless scanner to interact with AWS services of a specific account.
4
+
5
+
It should be installed in every account that the agentless scanner will scan.
Copy file name to clipboardExpand all lines: modules/user_data/README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
## Description
2
+
3
+
The user_data module exports a script that can be used to install the Datadog agentless scanner on a target instance. This script can be configured to install the scanner.
4
+
5
+
It is then used to create the launch template for the agentless scanner instance.
Copy file name to clipboardExpand all lines: modules/vpc/README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
## Description
2
+
3
+
The vpc module can be used to spawn a dedicated VPC specifically crafted for running the agentless scanner instance.
4
+
5
+
It provides dedicated private subnet, associated with the proper private endpoints to AWS services in order to reduce the network cost induced by scanning resources.
6
+
1
7
<!-- BEGIN_TF_DOCS -->
2
8
## Requirements
3
9
@@ -61,4 +67,4 @@ No modules.
61
67
| <aname="output_public_subnets"></a> [public\_subnets](#output\_public\_subnets)| The public subnets of the created VPC |
62
68
| <aname="output_routing_ready"></a> [routing\_ready](#output\_routing\_ready)| Indicates whether routing resources have been successfully provisioned |
63
69
| <aname="output_vpc"></a> [vpc](#output\_vpc)| The VPC created for the Datadog agentless scanner |
0 commit comments