-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase-image.pkr.hcl
71 lines (63 loc) · 1.5 KB
/
base-image.pkr.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
packer {
required_plugins {
amazon = {
version = ">= 1.1.1"
source = "github.com/hashicorp/amazon"
}
}
}
source "amazon-ebs" "ubuntu" {
ami_name = "osquery-scale-packer-image-{{timestamp}}"
instance_type = "t2.micro"
region = "us-east-1"
source_ami_filter {
filters = {
name = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["099720109477"]
}
ssh_username = "ubuntu"
## share with entire org
#ami_org_arns = [
# "arn:aws:organizations::<account_id_root>:organization/<org-id>"
#]
}
build {
#remove if not using hcp packer
hcp_packer_registry {
bucket_name = "osquery-at-scale-packer-image"
description = <<EOT
Golden image process with visibility baked into ubuntu for Osquery@scale
EOT
bucket_labels = {
"team" = "[email protected]",
"os" = "ubuntu - focal"
}
build_labels = {
"build-time" = timestamp()
"build-source" = basename(path.cwd)
}
}
name = "packer-base-osquery"
sources = [
"source.amazon-ebs.ubuntu"
]
provisioner "shell" {
scripts = [
"./scripts/fluent-bit.sh",
"./scripts/osquery.sh"
]
}
#copy local configs
provisioner "file" {
source = "./root/etc"
destination = "/tmp"
}
#Configure osquery, logrotate & fluent-bit
provisioner "shell" {
script = "./scripts/post_install.sh"
}
}