-
Notifications
You must be signed in to change notification settings - Fork 36
/
tlosint.yaml
182 lines (151 loc) · 5.01 KB
/
tlosint.yaml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# playbook that dictates the installation of the TLOSINT VM
# This playbook is based on the Kali Linux playbook from debos
# each action is a step in the installation process
# this playbook will create a bare bones kali linux installation
# most of our additions will be happening in the overlay section of the playbook
# in the overaly section we will add in browser bookmarks, custom scripts, and other customizations
{{ $arch := .arch }}
{{ $branch := .branch }}
{{ $format := .format }}
{{ $imagename := .imagename }}
{{ $keep := .keep }}
{{ $mirror := .mirror }}
{{ $size := .size }}
{{ $variant := .variant }}
{{ $zip := .zip }}
{{ $desktop := .desktop }}
{{ $locale := .locale }}
{{ $password := .password }}
{{ $packages := .packages }}
{{ $timezone := .timezone }}
{{ $toolset := .toolset }}
{{ $username := .username }}
{{ $hostname := or .hostname "tlosint" }}
architecture: {{ $arch }}
actions:
- action: debootstrap
mirror: {{ $mirror }}
suite: {{ $branch }}
components: [ main, contrib, non-free ]
keyring-file: kali-archive-keyring.gpg
- description: "Install usr-is-merged (cf. debos #361 and #362)"
action: apt
packages: [ usr-is-merged ]
- description: "Preseed package configuration"
action: run
chroot: true
script: scripts/preseed.sh
- description: "Install standard packages"
action: run
chroot: true
script: scripts/install-standard-packages.sh
- description: "Set default locale {{ $locale }}"
action: run
chroot: true
script: scripts/setup-locale.sh {{ $locale }}
- description: "Set default timezone {{ $timezone }}"
action: run
chroot: true
script: scripts/setup-timezone.sh {{ $timezone }}
- description: "Set hostname to {{ $hostname }}"
action: run
chroot: false
command: echo {{ $hostname }} > $ROOTDIR/etc/hostname
- description: "Install core and desktop {{ $desktop }}"
action: apt
recommends: true
packages:
- kali-linux-core
- kali-desktop-xfce
# this action "layers" a lot of extra stuff on to the installed filesystem
# this is where we can add things to the desktop or other parts of the filesystem
# note: the user's home directory does not yet exist at this point
- action: overlay
source: overlays/tl-overlays
{{ if ne $packages "" }}
- description: "Install extra packages: {{ $packages }}"
action: apt
recommends: true
packages: [ {{ $packages }} ]
{{ end }}
- action: overlay
source: overlays/loopback-interface
- description: "Create user {{ $username }}"
action: run
chroot: true
script: scripts/create-user.sh {{ $username }} "{{ $password }}"
# pull down the Obsidian for note taking
- description: "Install obsidian"
action: run
chroot: true
script: scripts/tl/install-obsidian.sh {{ $username }}
- description: "chmod +x files that need it"
action: run
chroot: true
script: scripts/tl/change-mod.sh
- description: "Disable tmpfiles.d/systemd-resolve.conf, cf. #1007018"
action: run
chroot: false
command: ln -s /dev/null $ROOTDIR/etc/tmpfiles.d/systemd-resolve.conf
- description: "Finish installation"
action: run
chroot: true
script: scripts/finish-install.sh debconf etc-hosts usergroups zsh
- description: "Setup the disk image"
action: image-partition
imagename: {{ $imagename }}.raw
imagesize: {{ $size }}
partitiontype: msdos
partitions:
- name: root
fs: ext4
start: 2048s
end: 100%
flags: [ boot ]
mountpoints:
- mountpoint: /
partition: root
options: [ errors=remount-ro ]
- action: filesystem-deploy
setup-kernel-cmdline: false
- description: "Create a swap file"
action: run
chroot: true
script: scripts/create-swapfile.sh
- description: "Install the kernel & bootloader"
action: apt
recommends: true
packages: [ grub-pc, linux-image-generic ]
- description: "Setup GRUB"
action: run
chroot: true
command: grub-install "$IMAGE" && update-grub
- action: overlay
source: overlays/grub-install-devices
- description: "Install virtualization support for {{ $variant }}"
action: run
chroot: true
script: scripts/install-virt-support.sh {{ $variant }}
{{ if eq $variant "vmware" }}
- description: "Finish install for {{ $variant }}"
action: run
chroot: true
script: scripts/finish-install-vmware.sh
{{ end }}
- description: "Configure apt sources.list"
action: run
chroot: true
script: scripts/finish-install.sh apt-sources debconf usergroups
- description: "Final cleanup (from within)"
action: run
chroot: true
script: scripts/cleanup-in.sh
- description: "Final cleanup (from outside)"
action: run
chroot: false
script: scripts/cleanup-out.sh
- description: "Export to a {{ $format }} image"
label: "export-{{ $format }}"
action: run
postprocess: true
script: scripts/export-{{ $format }}.sh {{ if eq $keep "true" }}-k{{ end }} {{ if eq $zip "true" }}-z{{ end }} {{ $imagename }}