Skip to content

Commit 39cd947

Browse files
authored
Merge branch 'develop' into dlpx/pr/dbshah12/acdec8ee-f597-451f-bf30-f6ad642718ee
2 parents 7365dc7 + 3980f5f commit 39cd947

File tree

5 files changed

+82
-1
lines changed

5 files changed

+82
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# During upgrade verification, the root filesystem will be booted as a
3+
# container using systemd-nspawn. We don't "sandbox" the container, so
4+
# when zfs-import-cache.service runs, it could potentially try to import
5+
# a pool, which is not desired.
6+
#
7+
# To prevent this behavior, we explicitly disable this service from
8+
# running when inside of the container.
9+
#
10+
[Unit]
11+
ConditionVirtualization=!container
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# During upgrade verification, the root filesystem will be booted as a
3+
# container using systemd-nspawn. We don't "sandbox" the container, so
4+
# when zfs-import-scan.service runs, it could potentially try to import
5+
# a pool, which is not desired.
6+
#
7+
# To prevent this behavior, we explicitly disable this service from
8+
# running when inside of the container.
9+
#
10+
[Unit]
11+
ConditionVirtualization=!container
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# During upgrade verification, the root filesystem will be booted as a
3+
# container using systemd-nspawn. We don't "sandbox" the container, so
4+
# when zfs-mount.service runs, it'll automatically mount all "domain0"
5+
# mountpoints (or "dcenter" mountpoints for our DCenter systems). These
6+
# mounts in the container can then impact software running outside of
7+
# the container; e.g. "zfs destroy" can fail with EBUSY.
8+
#
9+
# Thus, to workaround this problem, we explicitly disable this service
10+
# from running when inside of the container.
11+
#
12+
[Unit]
13+
ConditionVirtualization=!container
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# During upgrade verification, the root filesystem will be booted as a
3+
# container using systemd-nspawn. We don't "sandbox" the container, so
4+
# when zfs-share.service runs, it'll automatically mount all "domain0"
5+
# mountpoints (or "dcenter" mountpoints for our DCenter systems). These
6+
# mounts in the container can then impact software running outside of
7+
# the container; e.g. "zfs destroy" can fail with EBUSY.
8+
#
9+
# Thus, to workaround this problem, we explicitly disable this service
10+
# from running when inside of the container.
11+
#
12+
[Unit]
13+
ConditionVirtualization=!container

files/common/var/lib/delphix-platform/ansible/10-delphix-platform/roles/delphix-platform/tasks/main.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@
246246
- { key: "AllowStreamLocalForwarding", value: "no" }
247247
- { key: "AllowTcpForwarding", value: "no" }
248248
- { key: "X11Forwarding", value: "no" }
249+
- { key: "HostKeyAlgorithms", value: "-ssh-rsa*" }
250+
notify: "sshd config changed"
249251

250252
#
251253
# The CRA project mandated a 30 minute timeout for any idle connections.
@@ -300,12 +302,18 @@
300302
#
301303
- variant is regex("external-.*")
302304
#
303-
# Harden the appliance by disabling SFTP.
305+
# Harden the appliance by disabling SFTP on external variants.
304306
#
305307
- replace:
306308
path: /etc/ssh/sshd_config
307309
regexp: '^(Subsystem.*sftp.*)'
308310
replace: '#\1'
311+
when:
312+
#
313+
# Disable sftp on external variants and leave it enabled on internal
314+
# variants for developer convenience and to facilitate test automation.
315+
#
316+
- variant is regex("external-.*")
309317

310318
#
311319
# Ssh leads to the CLI, not bash, so let's remove all the linuxy shell goodies,
@@ -321,6 +329,15 @@
321329
regexp: '^(session[\s]+optional[\s]+pam_motd\.so.*)$'
322330
replace: '#\1'
323331

332+
#
333+
# Restrict su access to users that are part of the root group (gid 0).
334+
# On a Delphix engine, this is restricted to the delphix user.
335+
#
336+
- replace:
337+
dest: /etc/pam.d/su
338+
regexp: '^#?[\s]*(auth[\s]+required[\s]+pam_wheel\.so.*)$'
339+
replace: '\1'
340+
324341
#
325342
# Prevent sshd from offering weak message authentication codes to clients.
326343
#
@@ -681,3 +698,19 @@
681698
when:
682699
- variant == "internal-buildserver"
683700
- not ansible_is_chroot
701+
702+
- name: Add systemctl bash completion
703+
copy:
704+
dest: "/etc/bash_completion.d/systemctl"
705+
content: |
706+
if [[ -r /usr/share/bash-completion/completions/systemctl ]]; then
707+
. /usr/share/bash-completion/completions/systemctl && complete -F _systemctl systemctl
708+
fi
709+
710+
- name: Source bash completion
711+
blockinfile:
712+
dest: "/export/home/delphix/.bashrc"
713+
block: |
714+
. /etc/bash_completion.d/systemctl
715+
. /etc/bash_completion.d/zfs
716+
PATH=$PATH:/opt/delphix/server/bin

0 commit comments

Comments
 (0)