-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add type8 and type9 password hashes
This requires the-bastion-mkhash-helper v1.1.0+
- Loading branch information
Showing
26 changed files
with
288 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#! /usr/bin/env bash | ||
# vim: set filetype=sh ts=4 sw=4 sts=4 et: | ||
set -e | ||
|
||
PROGRAM_NAME=the-bastion-mkhash-helper | ||
RELEASE_API_URL="https://api.github.com/repos/ovh/$PROGRAM_NAME/releases" | ||
|
||
basedir=$(readlink -f "$(dirname "$0")"/../..) | ||
# shellcheck source=lib/shell/install.inc | ||
. "$basedir"/lib/shell/install.inc | ||
|
||
set_download_url_package() { | ||
case "$1" in | ||
rpm) set_download_url "/${PROGRAM_NAME}-.+\\.$archre\\.rpm$";; | ||
deb) set_download_url "/${PROGRAM_NAME}_.+_$archre\\.deb$";; | ||
*) exit 1;; | ||
esac | ||
} | ||
|
||
action_static() { | ||
set_archre | ||
os=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
|
||
set_download_url "/${PROGRAM_NAME}.*_${os}_${archre}\\.tar\\.gz$" | ||
prepare_temp_folder | ||
|
||
_download "$url" | ||
# we have just one archive file in the current temp directory | ||
# shellcheck disable=SC2035 | ||
tar xzf *.tar.gz | ||
action_done | ||
|
||
action_doing "Installing files" | ||
for file in $PROGRAM_NAME; do | ||
action_detail "/usr/local/bin/$file" | ||
install -m 0755 "$file" /usr/local/bin/ | ||
done | ||
action_done | ||
|
||
cd / | ||
} | ||
|
||
# only used when/if the API is down and we're in CI mode | ||
default_urls() { | ||
local ver="1.0.0" | ||
local list=" | ||
-${ver}.aarch64.rpm | ||
-${ver}.armv7hnl.rpm | ||
-${ver}.armv6l.rpm | ||
-${ver}.i386.rpm | ||
-${ver}.mips64el.rpm | ||
-${ver}.ppc64le.rpm | ||
-${ver}.s390x.rpm | ||
-${ver}.x86_64.rpm | ||
_${ver}_amd64.deb | ||
_${ver}_arm64.deb | ||
_${ver}_armel.deb | ||
_${ver}_armhf.deb | ||
_${ver}_darwin_amd64.tar.gz | ||
_${ver}_freebsd_386.tar.gz | ||
_${ver}_freebsd_amd64.tar.gz | ||
_${ver}_freebsd_arm64.tar.gz | ||
_${ver}_freebsd_armv5.tar.gz | ||
_${ver}_freebsd_armv7.tar.gz | ||
_${ver}_i386.deb | ||
_${ver}_linux_386.tar.gz | ||
_${ver}_linux_amd64.tar.gz | ||
_${ver}_linux_arm64.tar.gz | ||
_${ver}_linux_armv5.tar.gz | ||
_${ver}_linux_armv7.tar.gz | ||
_${ver}_linux_mips64le_hardfloat.tar.gz | ||
_${ver}_linux_ppc64le.tar.gz | ||
_${ver}_linux_s390x.tar.gz | ||
_${ver}_mips64el.deb | ||
_${ver}_netbsd_386.tar.gz | ||
_${ver}_netbsd_amd64.tar.gz | ||
_${ver}_netbsd_armv5.tar.gz | ||
_${ver}_netbsd_armv7.tar.gz | ||
_${ver}_openbsd_386.tar.gz | ||
_${ver}_openbsd_amd64.tar.gz | ||
_${ver}_openbsd_arm64.tar.gz | ||
_${ver}_openbsd_armv5.tar.gz | ||
_${ver}_openbsd_armv7.tar.gz | ||
_${ver}_ppc64le.deb | ||
_${ver}_s390x.deb | ||
_${ver}_windows_amd64.tar.gz" | ||
for suffix in $list | ||
do | ||
echo "https://github.com/ovh/$PROGRAM_NAME/releases/download/v${ver}/$PROGRAM_NAME${suffix}" | ||
done | ||
} | ||
|
||
install_main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,16 @@ FROM centos:7 | |
LABEL maintainer="[email protected]" | ||
|
||
# cache builds efficiently: just copy the scripts to install packages first | ||
COPY bin/admin/install-ttyrec.sh bin/admin/install-yubico-piv-checker.sh bin/admin/packages-check.sh /opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
COPY bin/admin/install-ttyrec.sh \ | ||
bin/admin/install-yubico-piv-checker.sh \ | ||
bin/admin/install-mkhash-helper.sh \ | ||
bin/admin/packages-check.sh \ | ||
/opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
RUN ["/opt/bastion/bin/admin/packages-check.sh","-i","-d","-s"] | ||
RUN ["/opt/bastion/bin/admin/install-ttyrec.sh","-r"] | ||
RUN ["/opt/bastion/bin/admin/install-yubico-piv-checker.sh","-r"] | ||
RUN ["/opt/bastion/bin/admin/install-mkhash-helper.sh","-r"] | ||
|
||
# disable /dev/kmsg handling by syslog-ng and explicitly enable /dev/log | ||
RUN test -e /etc/syslog-ng/syslog-ng.conf && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,16 @@ FROM debian:buster | |
LABEL maintainer="[email protected]" | ||
|
||
# cache builds efficiently: just copy the scripts to install packages first | ||
COPY bin/admin/install-ttyrec.sh bin/admin/install-yubico-piv-checker.sh bin/admin/packages-check.sh /opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
COPY bin/admin/install-ttyrec.sh \ | ||
bin/admin/install-yubico-piv-checker.sh \ | ||
bin/admin/install-mkhash-helper.sh \ | ||
bin/admin/packages-check.sh \ | ||
/opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
RUN ["/opt/bastion/bin/admin/packages-check.sh","-i","-d","-s"] | ||
RUN ["/opt/bastion/bin/admin/install-ttyrec.sh","-d"] | ||
RUN ["/opt/bastion/bin/admin/install-yubico-piv-checker.sh","-d"] | ||
RUN ["/opt/bastion/bin/admin/install-mkhash-helper.sh","-d"] | ||
|
||
# handle locales | ||
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,16 @@ FROM debian:bullseye | |
LABEL maintainer="[email protected]" | ||
|
||
# cache builds efficiently: just copy the scripts to install packages first | ||
COPY bin/admin/install-ttyrec.sh bin/admin/install-yubico-piv-checker.sh bin/admin/packages-check.sh /opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
COPY bin/admin/install-ttyrec.sh \ | ||
bin/admin/install-yubico-piv-checker.sh \ | ||
bin/admin/install-mkhash-helper.sh \ | ||
bin/admin/packages-check.sh \ | ||
/opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
RUN ["/opt/bastion/bin/admin/packages-check.sh","-i","-d","-s"] | ||
RUN ["/opt/bastion/bin/admin/install-ttyrec.sh","-d"] | ||
RUN ["/opt/bastion/bin/admin/install-yubico-piv-checker.sh","-d"] | ||
RUN ["/opt/bastion/bin/admin/install-mkhash-helper.sh","-d"] | ||
|
||
# handle locales | ||
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,16 @@ FROM debian:bookworm | |
LABEL maintainer="[email protected]" | ||
|
||
# cache builds efficiently: just copy the scripts to install packages first | ||
COPY bin/admin/install-ttyrec.sh bin/admin/install-yubico-piv-checker.sh bin/admin/packages-check.sh /opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
COPY bin/admin/install-ttyrec.sh \ | ||
bin/admin/install-yubico-piv-checker.sh \ | ||
bin/admin/install-mkhash-helper.sh \ | ||
bin/admin/packages-check.sh \ | ||
/opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
RUN ["/opt/bastion/bin/admin/packages-check.sh","-i","-d","-s"] | ||
RUN ["/opt/bastion/bin/admin/install-ttyrec.sh","-d"] | ||
RUN ["/opt/bastion/bin/admin/install-yubico-piv-checker.sh","-d"] | ||
RUN ["/opt/bastion/bin/admin/install-mkhash-helper.sh","-d"] | ||
|
||
# handle locales | ||
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,19 @@ FROM opensuse/leap:15 | |
LABEL maintainer="[email protected]" | ||
|
||
# cache builds efficiently: just copy the scripts to install packages first | ||
COPY bin/admin/install-ttyrec.sh bin/admin/install-yubico-piv-checker.sh bin/admin/packages-check.sh /opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
COPY bin/admin/install-ttyrec.sh \ | ||
bin/admin/install-yubico-piv-checker.sh \ | ||
bin/admin/install-mkhash-helper.sh \ | ||
bin/admin/packages-check.sh \ | ||
/opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
RUN ["/opt/bastion/bin/admin/packages-check.sh","-i","-d","-s"] | ||
RUN ["/usr/bin/chmod","u+s","/usr/bin/ping","/usr/sbin/fping"] | ||
RUN ["/opt/bastion/bin/admin/install-ttyrec.sh","-r"] | ||
RUN ["/opt/bastion/bin/admin/install-yubico-piv-checker.sh","-r"] | ||
RUN ["/opt/bastion/bin/admin/install-mkhash-helper.sh","-r"] | ||
|
||
# disable /dev/kmsg handling by syslog-ng and explicitely enable /dev/log | ||
# disable /dev/kmsg handling by syslog-ng and explicitly enable /dev/log | ||
RUN test -e /etc/syslog-ng/syslog-ng.conf && \ | ||
sed -i -re 's=system\(\);=unix-stream("/dev/log");=' /etc/syslog-ng/syslog-ng.conf | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,16 @@ FROM rockylinux:8 | |
LABEL maintainer="[email protected]" | ||
|
||
# cache builds efficiently: just copy the scripts to install packages first | ||
COPY bin/admin/install-ttyrec.sh bin/admin/install-yubico-piv-checker.sh bin/admin/packages-check.sh /opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
COPY bin/admin/install-ttyrec.sh \ | ||
bin/admin/install-yubico-piv-checker.sh \ | ||
bin/admin/install-mkhash-helper.sh \ | ||
bin/admin/packages-check.sh \ | ||
/opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
RUN ["/opt/bastion/bin/admin/packages-check.sh","-i","-d","-s"] | ||
RUN ["/opt/bastion/bin/admin/install-ttyrec.sh","-r"] | ||
RUN ["/opt/bastion/bin/admin/install-yubico-piv-checker.sh","-r"] | ||
RUN ["/opt/bastion/bin/admin/install-mkhash-helper.sh","-r"] | ||
|
||
# disable /dev/kmsg handling by syslog-ng and explicitly enable /dev/log | ||
RUN test -e /etc/syslog-ng/syslog-ng.conf && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,16 @@ FROM rockylinux:9 | |
LABEL maintainer="[email protected]" | ||
|
||
# cache builds efficiently: just copy the scripts to install packages first | ||
COPY bin/admin/install-ttyrec.sh bin/admin/install-yubico-piv-checker.sh bin/admin/packages-check.sh /opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
COPY bin/admin/install-ttyrec.sh \ | ||
bin/admin/install-yubico-piv-checker.sh \ | ||
bin/admin/install-mkhash-helper.sh \ | ||
bin/admin/packages-check.sh \ | ||
/opt/bastion/bin/admin/ | ||
COPY lib/shell /opt/bastion/lib/shell/ | ||
RUN ["/opt/bastion/bin/admin/packages-check.sh","-i","-d","-s"] | ||
RUN ["/opt/bastion/bin/admin/install-ttyrec.sh","-r"] | ||
RUN ["/opt/bastion/bin/admin/install-yubico-piv-checker.sh","-r"] | ||
RUN ["/opt/bastion/bin/admin/install-mkhash-helper.sh","-r"] | ||
|
||
# disable /dev/kmsg handling by syslog-ng and explicitly enable /dev/log | ||
RUN test -e /etc/syslog-ng/syslog-ng.conf && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.