warding 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/default.yml +35 -0
- data/README.md +38 -38
- data/lib/warding.rb +80 -49
- data/lib/warding/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80f1a448f9e2dca165d0ae31d4d745b2bd6641a768d2455d64086bb04132a098
|
4
|
+
data.tar.gz: d6afdd80c3497c2a6fd39dda60ebdcedb63d02483116c8ee68b0861f079f93a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3baef4c001d534fc9dcb595fb10b4b222121e2a161980c153856bee1365db895055b29b644f14739bba69b59535b9cf84359c7c3df69f52be676f8648916b10f
|
7
|
+
data.tar.gz: 5acd8f21a504566276ad9e54a6407307bca3ea3b9e16f7d2001dadc8f80b60f62615f7fc4fac49f77caec34c6f1cf9c8563d13c80b1d0caed57e8f7301f7f22c
|
@@ -0,0 +1,35 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
on:
|
3
|
+
release:
|
4
|
+
types: [created]
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
name: Build/Publish
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
- name: Set up Ruby 2.6
|
12
|
+
uses: actions/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: 2.6.x
|
15
|
+
- name: Publish to GPR
|
16
|
+
run: |
|
17
|
+
mkdir -p $HOME/.gem
|
18
|
+
touch $HOME/.gem/credentials
|
19
|
+
chmod 0600 $HOME/.gem/credentials
|
20
|
+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
21
|
+
gem build *.gemspec
|
22
|
+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
23
|
+
env:
|
24
|
+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
25
|
+
OWNER: ${{ github.repository_owner }}
|
26
|
+
- name: Publish to RubyGems
|
27
|
+
run: |
|
28
|
+
mkdir -p $HOME/.gem
|
29
|
+
touch $HOME/.gem/credentials
|
30
|
+
chmod 0600 $HOME/.gem/credentials
|
31
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
32
|
+
gem build *.gemspec
|
33
|
+
gem push *.gem
|
34
|
+
env:
|
35
|
+
GEM_HOST_API_KEY: "Bearer ${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
data/README.md
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
# Warding [](https://badge.fury.io/rb/warding)
|
2
|
-
|
3
|
-
> Custom Arch Linux installer designed for security assessments and pentesting.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Install warding by using the `gem install` command.
|
8
|
-
|
9
|
-
```bash
|
10
|
-
gem install warding
|
11
|
-
```
|
12
|
-
|
13
|
-
## Usage
|
14
|
-
|
15
|
-
1. Download Arch Linux.
|
16
|
-
2. Boot from the live ISO.
|
17
|
-
3. Install warding (Ruby may also be required).
|
18
|
-
4. Run the binary executable `warding` and fill in the prompts.
|
19
|
-
5. Enjoy.
|
20
|
-
|
21
|
-
## Tasklist
|
22
|
-
|
23
|
-
*
|
24
|
-
*
|
25
|
-
*
|
26
|
-
* Add
|
27
|
-
* Code missing features.
|
28
|
-
* Add extra checks.
|
29
|
-
* Add GitHub actions.
|
30
|
-
* Publish gem/package on GitHub.
|
31
|
-
|
32
|
-
## Contributing
|
33
|
-
|
34
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/marlospomin/warding.
|
35
|
-
|
36
|
-
## License
|
37
|
-
|
38
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
1
|
+
# Warding [](https://badge.fury.io/rb/warding)
|
2
|
+
|
3
|
+
> Custom Arch Linux installer designed for security assessments and pentesting.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install warding by using the `gem install` command.
|
8
|
+
|
9
|
+
```bash
|
10
|
+
gem install warding
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
1. Download Arch Linux.
|
16
|
+
2. Boot from the live ISO.
|
17
|
+
3. Install warding (Ruby may also be required).
|
18
|
+
4. Run the binary executable `warding` and fill in the prompts.
|
19
|
+
5. Enjoy.
|
20
|
+
|
21
|
+
## Tasklist
|
22
|
+
|
23
|
+
* Add sddm and gdm extra confs.
|
24
|
+
* Refactor.
|
25
|
+
* Suppress outputs.
|
26
|
+
* Add AUR support.
|
27
|
+
* Code missing features.
|
28
|
+
* Add extra checks.
|
29
|
+
* Add GitHub actions.
|
30
|
+
* Publish gem/package on GitHub.
|
31
|
+
|
32
|
+
## Contributing
|
33
|
+
|
34
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/marlospomin/warding.
|
35
|
+
|
36
|
+
## License
|
37
|
+
|
38
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/lib/warding.rb
CHANGED
@@ -38,7 +38,7 @@ module Warding
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def gather
|
41
|
-
locales_list = %w[
|
41
|
+
locales_list = %w[en_US es_ES pt_BR ru_RU fr_FR it_IT de_DE ja_JP ko_KR zh_CN]
|
42
42
|
keymaps_list = %w[us uk br en fr de zh ru it es]
|
43
43
|
|
44
44
|
parsed_input = @@prompt.collect do
|
@@ -81,7 +81,7 @@ module Warding
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
key(:
|
84
|
+
key(:desktop_environment).select("Select your desktop environment:", %w[plasma gnome none])
|
85
85
|
end
|
86
86
|
|
87
87
|
parsed_input
|
@@ -93,13 +93,16 @@ module Warding
|
|
93
93
|
@@prompt.say("Installing, please wait...")
|
94
94
|
|
95
95
|
def setup_mirrors
|
96
|
+
# update mirrorlist
|
96
97
|
`reflector --latest 25 --sort rate --save /etc/pacman.d/mirrorlist`
|
97
98
|
end
|
98
99
|
|
99
100
|
setup_mirrors if data[:update_mirrors]
|
100
101
|
|
101
102
|
def setup_timezone(timezone = false)
|
103
|
+
# set clock
|
102
104
|
`timedatectl set-ntp true`
|
105
|
+
# set timezone
|
103
106
|
if timezone
|
104
107
|
`timedatectl set-timezone #{timezone}`
|
105
108
|
else
|
@@ -110,6 +113,7 @@ module Warding
|
|
110
113
|
data[:update_timezone] ? setup_timezone(data[:update_timezone]) : setup_timezone
|
111
114
|
|
112
115
|
def setup_partitions(boot_size)
|
116
|
+
# create partitions
|
113
117
|
`parted -s -a optimal /dev/sda \
|
114
118
|
mklabel gpt \
|
115
119
|
mkpart primary fat32 0% #{boot_size}Mib \
|
@@ -122,26 +126,33 @@ module Warding
|
|
122
126
|
setup_partitions(data[:system_settings][:boot_size])
|
123
127
|
|
124
128
|
def setup_lvm(scheme, swap_size, home_size = false)
|
129
|
+
# create physical volume
|
125
130
|
`pvcreate /dev/sda2`
|
131
|
+
# create virtual group
|
126
132
|
`vgcreate vg0 /dev/sda2`
|
133
|
+
# create logical volumes
|
127
134
|
`lvcreate -L #{swap_size}Mib vg0 -n swap`
|
128
135
|
if scheme == "/boot, /root and /home"
|
129
136
|
`lvcreate -L #{home_size}Mib vg0 -n home`
|
130
137
|
end
|
131
138
|
`lvcreate -l 100%FREE vg0 -n root`
|
132
|
-
|
139
|
+
# make and mount root fs
|
133
140
|
`mkfs.ext4 /dev/vg0/root`
|
134
141
|
`mount /dev/vg0/root /mnt`
|
135
|
-
|
142
|
+
# make and mount home folder
|
136
143
|
if scheme == "/boot, /root and /home"
|
137
144
|
`mkfs.ext4 /dev/vg0/home`
|
138
145
|
`mount /dev/vg0/home /mnt/home`
|
139
146
|
end
|
140
|
-
|
147
|
+
# make and mount boot partition
|
141
148
|
`mkfs.fat -F32 /dev/sda1`
|
142
149
|
`mkdir /mnt/boot`
|
143
|
-
|
144
|
-
|
150
|
+
if data[:system_settings][:bootloader] == "systemd-boot"
|
151
|
+
`mount /dev/sda1 /mnt/boot`
|
152
|
+
else
|
153
|
+
`mount /dev/sda1 /mnt/boot/efi`
|
154
|
+
end
|
155
|
+
# setup swap
|
145
156
|
`mkswap /dev/vg0/swap`
|
146
157
|
`swapon /dev/vg0/swap`
|
147
158
|
end
|
@@ -152,56 +163,75 @@ module Warding
|
|
152
163
|
setup_lvm(data[:system_settings][:partition], data[:system_settings][:swap_size])
|
153
164
|
end
|
154
165
|
|
155
|
-
# setup encryption
|
156
|
-
|
157
166
|
def setup_packages
|
167
|
+
# update packages list
|
158
168
|
`pacman -Syy`
|
159
|
-
|
169
|
+
# install base system
|
170
|
+
`pacstrap /mnt base base-devel linux linux-firmware lvm2 mkinitcpio dmidecode reflector networkmanager cronie man-db nano vi fuse wget openbsd-netcat dhcpcd samba openssh openvpn unzip vim git zsh`
|
171
|
+
# generate fstab
|
160
172
|
`genfstab -U /mnt >> /mnt/etc/fstab`
|
161
173
|
end
|
162
174
|
|
163
175
|
setup_packages
|
164
176
|
|
165
177
|
def setup_chroot(lang, keymap, password)
|
178
|
+
# set timezone
|
166
179
|
`arch-chroot /mnt ln -sf /usr/share/zoneinfo/"$(curl -s https://ipapi.co/timezone)" /etc/localtime`
|
180
|
+
# update clock
|
167
181
|
`arch-chroot /mnt hwclock --systohc`
|
168
|
-
|
169
|
-
`echo "#{lang}.UTF-8" > /mnt/etc/locale.gen`
|
182
|
+
# set locale
|
183
|
+
`echo "#{lang}.UTF-8 UTF-8" > /mnt/etc/locale.gen`
|
170
184
|
`arch-chroot /mnt locale-gen`
|
171
185
|
`echo "LANG=#{lang}.UTF-8" > /mnt/etc/locale.conf`
|
186
|
+
# set keymap
|
172
187
|
`echo "KEYMAP=#{keymap}" > /mnt/etc/vconsole.conf`
|
188
|
+
# update hostname
|
173
189
|
`echo "warding" > /mnt/etc/hostname`
|
190
|
+
# update hosts
|
174
191
|
`echo "127.0.0.1 localhost\n::1 localhost\n127.0.1.1 warding.localdomain warding" > /mnt/etc/hosts`
|
175
|
-
|
192
|
+
# update root password
|
176
193
|
`echo -e "#{password}\n#{password}" | arch-chroot /mnt passwd`
|
177
|
-
|
194
|
+
# update hooks
|
178
195
|
`sed -i "/^HOOK/s/filesystems/lvm2 filesystems/" /mnt/etc/mkinitcpio.conf`
|
179
|
-
|
196
|
+
# recompile initramfs
|
197
|
+
`arch-chroot /mnt mkinitcpio -p linux`
|
198
|
+
# add intel microcode
|
180
199
|
`arch-chroot /mnt pacman -S intel-ucode --noconfirm`
|
181
200
|
end
|
182
201
|
|
183
202
|
setup_chroot(data[:system_language], data[:keyboard_keymap], data[:root_password])
|
184
203
|
|
185
204
|
def setup_bootloader(loader)
|
205
|
+
# setup systemd-boot
|
186
206
|
if loader == "systemd-boot"
|
187
|
-
`arch-chroot /mnt bootctl install
|
207
|
+
`arch-chroot /mnt bootctl install`
|
188
208
|
`echo "title Warding Linux
|
189
209
|
linux /vmlinuz-linux
|
190
210
|
initrd /intel-ucode.img
|
191
211
|
initrd /initramfs-linux.img
|
192
212
|
options root=/dev/vg0/root rw" > /mnt/boot/loader/entries/warding.conf`
|
193
213
|
else
|
194
|
-
#
|
214
|
+
# setup grub
|
215
|
+
`arch-chroot /mnt pacman -S grub efibootmgr --noconfirm`
|
216
|
+
`arch-chroot /mnt grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB`
|
217
|
+
`arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg`
|
195
218
|
end
|
196
219
|
end
|
197
220
|
|
198
221
|
setup_bootloader(data[:system_settings][:bootloader])
|
199
222
|
|
200
223
|
def setup_usability
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
224
|
+
# enable internet
|
225
|
+
`arch-chroot /mnt systemctl enable NetworkManager`
|
226
|
+
# add cron jobs
|
227
|
+
`echo "#!/bin/bash\nreflector --latest 25 --sort rate --save /etc/pacman.d/mirrorlist" > /mnt/etc/cron.hourly/mirrorlist; chmod +x /mnt/etc/cron.hourly/mirrorlist`
|
228
|
+
`echo "#!/bin/bash\npacman -Sy" > /mnt/etc/cron.weekly/pacman-sync; chmod +x /mnt/etc/cron.weekly/pacman-sync`
|
229
|
+
`echo "#!/bin/bash\npacman -Syu --noconfirm" > /mnt/etc/cron.monthly/system-upgrade; chmod +x /mnt/etc/cron.monthly/system-upgrade`
|
230
|
+
# enable cron jobs
|
231
|
+
`arch-chroot /mnt systemctl enable cronie`
|
232
|
+
# change default shell
|
233
|
+
`arch-chroot /mnt chsh -s $(which zsh)"`
|
234
|
+
# setup blackarch's keyring
|
205
235
|
`wget -q https://blackarch.org/keyring/blackarch-keyring.pkg.tar.xz{,.sig}`
|
206
236
|
`gpg --keyserver hkp://pgp.mit.edu --recv-keys 4345771566D76038C7FEB43863EC0ADBEA87E4E3 > /dev/null 2>&1`
|
207
237
|
`gpg --keyserver-options no-auto-key-retrieve --with-fingerprint blackarch-keyring.pkg.tar.xz.sig > /dev/null 2>&1`
|
@@ -209,43 +239,44 @@ module Warding
|
|
209
239
|
`pacman-key --init`
|
210
240
|
`pacman --config /dev/null --noconfirm -U blackarch-keyring.pkg.tar.xz`
|
211
241
|
`pacman-key --populate`
|
242
|
+
# update package list
|
212
243
|
`pacman -Syy`
|
244
|
+
# check if on VM
|
245
|
+
if `dmidecode -s system-manufacturer`.include?("VMware, Inc.")
|
246
|
+
# install and enable VMware utils
|
247
|
+
`arch-chroot /mnt pacman -S openvpn-vm-tools --noconfirm`
|
248
|
+
`arch-chroot /mnt systemctl enable vmtoolsd`
|
249
|
+
end
|
213
250
|
end
|
214
251
|
|
215
252
|
setup_usability
|
216
253
|
|
217
|
-
def setup_visuals
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
def setup_cron
|
239
|
-
`arch-chroot /mnt pacman -S cronie --noconfirm`
|
240
|
-
`arch-chroot /mnt systemctl enable cronie`
|
241
|
-
`echo "#!/bin/bash\nreflector --latest 25 --sort rate --save /etc/pacman.d/mirrorlist" > /mnt/etc/cron.hourly/mirrorlist; chmod +x /mnt/etc/cron.hourly/mirrorlist`
|
242
|
-
`echo "#!/bin/bash\npacman -Sy" > /mnt/etc/cron.weekly/pacman-sync; chmod +x /mnt/etc/cron.weekly/pacman-sync`
|
243
|
-
`echo "#!/bin/bash\npacman -Syu --noconfirm" > /mnt/etc/cron.monthly/system-upgrade; chmod +x /mnt/etc/cron.monthly/system-upgrade`
|
254
|
+
def setup_visuals(theme = "none")
|
255
|
+
if theme == "none"
|
256
|
+
break
|
257
|
+
elsif theme == "kde"
|
258
|
+
# install packages
|
259
|
+
`arch-chroot /mnt pacman -S xorg-server xf86-video-intel plasma konsole dolphin kmix sddm kvantum-qt5`
|
260
|
+
# create conf dir
|
261
|
+
`mkdir -p /mnt/etc/sddm.conf.d`
|
262
|
+
# fix theme
|
263
|
+
`echo "[Theme]\nCurrent=breeze" > /mnt/etc/sddm.conf.d/theme.conf`
|
264
|
+
# enable autologin
|
265
|
+
`echo "[Autologin]\nUser=root" > /mnt/etc/sddm.conf.d/login.conf`
|
266
|
+
# enable sddm
|
267
|
+
`arch-chroot /mnt systemctl enable sddm`
|
268
|
+
else
|
269
|
+
# install packages
|
270
|
+
`arch-chroot /mnt pacman -S xf86-video-intel gnome`
|
271
|
+
# enable gdm
|
272
|
+
`arch-chroot /mnt systemctl enable gdm`
|
273
|
+
end
|
244
274
|
end
|
245
275
|
|
246
|
-
|
276
|
+
setup_visuals(data[:desktop_environment])
|
247
277
|
|
248
278
|
def finish
|
279
|
+
# end
|
249
280
|
`umount -R /mnt`
|
250
281
|
`reboot`
|
251
282
|
end
|
data/lib/warding/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marlos Pomin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|
@@ -32,6 +32,7 @@ executables:
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
+
- ".github/workflows/default.yml"
|
35
36
|
- ".gitignore"
|
36
37
|
- ".rubocop.yml"
|
37
38
|
- Gemfile
|