Skip to content

Commit 793f5d4

Browse files
authored
Merge pull request #91 from cisagov/improvement/add-back-cdm-tools
Add back CDM agents
2 parents 8a0b290 + a91369a commit 793f5d4

File tree

5 files changed

+144
-2
lines changed

5 files changed

+144
-2
lines changed

src/cdm.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@
44
become: yes
55
become_method: ansible.builtin.sudo
66
tasks:
7-
- name: Install CrowdStrike
7+
- name: Install CDM Tanium client
8+
ansible.builtin.include_role:
9+
name: cdm_tanium
10+
vars:
11+
cdm_tanium_server_name: "{{ lookup('aws_ssm', '/cdm/tanium_hostname') }}"
12+
cdm_tanium_third_party_bucket_name: "{{ build_bucket }}"
13+
- name: Install CDM Nessus agent
14+
ansible.builtin.include_role:
15+
name: cdm_nessus_agent
16+
vars:
17+
cdm_nessus_agent_third_party_bucket_name: "{{ build_bucket }}"
18+
# The Python code that will be run by cloud-init to link the
19+
# Nessus Agent will require boto3
20+
- name: Install boto3
21+
ansible.builtin.package:
22+
name:
23+
- python3-boto3
24+
- name: Install CDM CrowdStrike
825
ansible.builtin.include_role:
926
name: crowdstrike
1027
vars:
@@ -25,3 +42,24 @@
2542
- direction: out
2643
port: 443
2744
proto: tcp
45+
# Tanium
46+
- direction: in
47+
port: 17472
48+
proto: tcp
49+
- direction: out
50+
port: 17472
51+
proto: tcp
52+
# Tanium threat response
53+
- direction: in
54+
port: 17475
55+
proto: tcp
56+
- direction: out
57+
port: 17475
58+
proto: tcp
59+
# Tenable
60+
- direction: in
61+
port: 8834
62+
proto: tcp
63+
- direction: out
64+
port: 8834
65+
proto: tcp

src/requirements.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ roles:
88
src: https://github.com/cisagov/ansible-role-automated-security-updates
99
- name: banner
1010
src: https://github.com/cisagov/ansible-role-banner
11+
- name: cdm_nessus_agent
12+
src: https://github.com/cisagov/ansible-role-cdm-nessus-agent
13+
- name: cdm_tanium
14+
src: https://github.com/cisagov/ansible-role-cdm-tanium-client
1115
- name: chrony_aws
1216
src: https://github.com/cisagov/ansible-role-chrony-aws
1317
- name: clamav

src/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.6"
1+
__version__ = "0.3.7"

terraform-build-user/main.tf

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,74 @@ module "iam_user" {
1010
}
1111

1212
ssm_parameters = [
13+
"/cdm/tanium_hostname",
1314
"/cyhy/dev/users",
1415
"/openvpn/server/*",
1516
"/ssh/public_keys/*",
1617
]
1718
user_name = "build-openvpn-packer"
1819
}
1920

21+
# Attach 3rd party S3 bucket read-only policy from
22+
# cisagov/ansible-role-cdm-tanium-client to the production
23+
# EC2AMICreate role
24+
resource "aws_iam_role_policy_attachment" "thirdpartybucketread_tanium_production" {
25+
provider = aws.images-production-ami
26+
27+
policy_arn = data.terraform_remote_state.ansible_role_cdm_tanium_client.outputs.production_bucket_policy.arn
28+
role = module.iam_user.ec2amicreate_role_production.name
29+
}
30+
31+
# Attach 3rd party S3 bucket read-only policy from
32+
# cisagov/ansible-role-cdm-tanium-client to the staging EC2AMICreate
33+
# role
34+
resource "aws_iam_role_policy_attachment" "thirdpartybucketread_tanium_staging" {
35+
provider = aws.images-staging-ami
36+
37+
policy_arn = data.terraform_remote_state.ansible_role_cdm_tanium_client.outputs.staging_bucket_policy.arn
38+
role = module.iam_user.ec2amicreate_role_staging.name
39+
}
40+
41+
# Attach 3rd party S3 bucket read-only policy from
42+
# cisagov/ansible-role-cdm-nessus-agent to the production
43+
# EC2AMICreate role
44+
resource "aws_iam_role_policy_attachment" "thirdpartybucketread_nessus_production" {
45+
provider = aws.images-production-ami
46+
47+
policy_arn = data.terraform_remote_state.ansible_role_cdm_nessus_agent.outputs.production_bucket_policy.arn
48+
role = module.iam_user.ec2amicreate_role_production.name
49+
}
50+
51+
# Attach 3rd party S3 bucket read-only policy from
52+
# cisagov/ansible-role-cdm-nessus-agent to the staging EC2AMICreate
53+
# role
54+
resource "aws_iam_role_policy_attachment" "thirdpartybucketread_nessus_staging" {
55+
provider = aws.images-staging-ami
56+
57+
policy_arn = data.terraform_remote_state.ansible_role_cdm_nessus_agent.outputs.staging_bucket_policy.arn
58+
role = module.iam_user.ec2amicreate_role_staging.name
59+
}
60+
61+
# Attach 3rd party S3 bucket read-only policy from
62+
# cisagov/ansible-role-cdm-certificates to the production EC2AMICreate
63+
# role
64+
resource "aws_iam_role_policy_attachment" "thirdpartybucketread_certificates_production" {
65+
provider = aws.images-production-ami
66+
67+
policy_arn = data.terraform_remote_state.ansible_role_cdm_certificates.outputs.production_bucket_policy.arn
68+
role = module.iam_user.ec2amicreate_role_production.name
69+
}
70+
71+
# Attach 3rd party S3 bucket read-only policy from
72+
# cisagov/ansible-role-cdm-certificates to the staging EC2AMICreate
73+
# role
74+
resource "aws_iam_role_policy_attachment" "thirdpartybucketread_certificates_staging" {
75+
provider = aws.images-staging-ami
76+
77+
policy_arn = data.terraform_remote_state.ansible_role_cdm_certificates.outputs.staging_bucket_policy.arn
78+
role = module.iam_user.ec2amicreate_role_staging.name
79+
}
80+
2081
# Attach 3rd party S3 bucket read-only policy from
2182
# cisagov/ansible-role-crowdstrike to the production EC2AMICreate role
2283
resource "aws_iam_role_policy_attachment" "thirdpartybucketread_crowdstrike_production" {

terraform-build-user/remote_states.tf

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,45 @@ data "terraform_remote_state" "images_staging" {
6464
workspace = "staging"
6565
}
6666

67+
data "terraform_remote_state" "ansible_role_cdm_certificates" {
68+
backend = "s3"
69+
70+
config = {
71+
encrypt = true
72+
bucket = "cisa-cool-terraform-state"
73+
dynamodb_table = "terraform-state-lock"
74+
profile = "cool-terraform-backend"
75+
region = "us-east-1"
76+
key = "ansible-role-cdm-certificates/terraform.tfstate"
77+
}
78+
}
79+
80+
data "terraform_remote_state" "ansible_role_cdm_nessus_agent" {
81+
backend = "s3"
82+
83+
config = {
84+
encrypt = true
85+
bucket = "cisa-cool-terraform-state"
86+
dynamodb_table = "terraform-state-lock"
87+
profile = "cool-terraform-backend"
88+
region = "us-east-1"
89+
key = "ansible-role-cdm-nessus-agent/terraform.tfstate"
90+
}
91+
}
92+
93+
data "terraform_remote_state" "ansible_role_cdm_tanium_client" {
94+
backend = "s3"
95+
96+
config = {
97+
encrypt = true
98+
bucket = "cisa-cool-terraform-state"
99+
dynamodb_table = "terraform-state-lock"
100+
profile = "cool-terraform-backend"
101+
region = "us-east-1"
102+
key = "ansible-role-cdm-tanium-client/terraform.tfstate"
103+
}
104+
}
105+
67106
data "terraform_remote_state" "ansible_role_crowdstrike" {
68107
backend = "s3"
69108

0 commit comments

Comments
 (0)