Skip to content

Commit 7815b67

Browse files
committed
Merge branch '3.2' into mac_runner
2 parents d0143b1 + 242256b commit 7815b67

File tree

5 files changed

+96
-59
lines changed

5 files changed

+96
-59
lines changed

.github/workflows/docker-3.2.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ env:
1515
GIT_BRANCH: "3.2"
1616

1717
jobs:
18-
1918
deploy:
2019
runs-on: ubuntu-24.04
21-
2220
steps:
2321
- name: lowercase the repository name
2422
run: echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}"
@@ -59,7 +57,6 @@ jobs:
5957
context: .
6058
file: Dockerfile.alpine
6159
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le
62-
build-args: GIT_BRANCH
6360
cache-from: type=gha, scope=${{ github.workflow }}
6461
cache-to: type=gha, scope=${{ github.workflow }}
6562
labels: ${{ steps.docker_meta.outputs.labels }}

Dockerfile

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,61 @@ ARG INSTALL_ROOT=/rootfs
66
FROM opensuse/leap:${LEAP_VERSION} AS builder
77
ARG CACHE_ZYPPER=/tmp/cache/zypper
88
ARG INSTALL_ROOT
9-
RUN \
10-
# /etc/os-release provides ${VERSION_ID} for usage in ZYPPER_OPTIONS:
11-
source /etc/os-release \
12-
# We don't need the openh264.repo and the non-oss repos, just costs build time (repo caches).
13-
&& zypper removerepo repo-openh264 repo-non-oss repo-update-non-oss \
14-
&& export ZYPPER_OPTIONS=( --releasever "${VERSION_ID}" --installroot "${INSTALL_ROOT}" --cache-dir "${CACHE_ZYPPER}" ) \
15-
&& zypper "${ZYPPER_OPTIONS[@]}" --gpg-auto-import-keys refresh \
16-
&& zypper "${ZYPPER_OPTIONS[@]}" --non-interactive install --download-in-advance --no-recommends \
17-
bash procps grep gawk sed coreutils busybox ldns libidn2-0 socat openssl curl \
18-
&& zypper "${ZYPPER_OPTIONS[@]}" clean --all \
19-
## Cleanup (reclaim approx 13 MiB):
9+
RUN <<HEREDOC
10+
# Remove the `openh264` the `non-oss` repos to save on sync time, they're not needed:
11+
zypper removerepo repo-openh264 repo-non-oss repo-update-non-oss
12+
# `/etc/os-release` provides the `VERSION_ID` variable for usage in `ZYPPER_OPTIONS`:
13+
source /etc/os-release
14+
export ZYPPER_OPTIONS=( --releasever "${VERSION_ID}" --installroot "${INSTALL_ROOT}" --cache-dir "${CACHE_ZYPPER}" )
15+
16+
# Install packages to a custom root-fs location (defined in `ZYPPER_OPTIONS`):
17+
zypper "${ZYPPER_OPTIONS[@]}" --gpg-auto-import-keys refresh
18+
zypper "${ZYPPER_OPTIONS[@]}" --non-interactive install --download-in-advance --no-recommends \
19+
bash procps grep gawk sed coreutils busybox ldns libidn2-0 socat openssl curl
20+
21+
# Optional - Avoid `CACHE_ZYPPER` from being redundantly cached in this RUN layer:
22+
# (doesn't improve `INSTALL_ROOT` size thanks to `--cache-dir`)
23+
zypper "${ZYPPER_OPTIONS[@]}" clean --all
24+
25+
# Cleanup (reclaim approx 13 MiB):
2026
# None of this content should be relevant to the container:
21-
&& rm -r "${INSTALL_ROOT}/usr/share/"{licenses,man,locale,doc,help,info} \
22-
"${INSTALL_ROOT}/usr/share/misc/termcap" \
23-
"${INSTALL_ROOT}/usr/lib/sysimage/rpm"
27+
rm -r "${INSTALL_ROOT}/usr/share/"{licenses,man,locale,doc,help,info} \
28+
"${INSTALL_ROOT}/usr/share/misc/termcap" \
29+
"${INSTALL_ROOT}/usr/lib/sysimage/rpm"
30+
HEREDOC
2431

2532

2633
# Create a new image with the contents of ${INSTALL_ROOT}
2734
FROM scratch AS base-leap
2835
ARG INSTALL_ROOT
2936
COPY --link --from=builder ${INSTALL_ROOT} /
30-
RUN \
37+
RUN <<HEREDOC
3138
# Creates symlinks for any other commands that busybox can provide that
3239
# aren't already provided by coreutils (notably hexdump + tar, see #2403):
3340
# NOTE: `busybox --install -s` is not supported via the leap package, manually symlink commands.
34-
ln -s /usr/bin/busybox /usr/bin/tar \
35-
&& ln -s /usr/bin/busybox /usr/bin/hexdump \
36-
&& ln -s /usr/bin/busybox /usr/bin/xxd \
41+
ln -s /usr/bin/busybox /usr/bin/tar
42+
ln -s /usr/bin/busybox /usr/bin/hexdump
43+
ln -s /usr/bin/busybox /usr/bin/xxd
44+
3745
# Add a non-root user `testssl`, this is roughly equivalent to the `useradd` command:
3846
# useradd --uid 1000 --user-group --create-home --shell /bin/bash testssl
39-
&& echo 'testssl:x:1000:1000::/home/testssl:/bin/bash' >> /etc/passwd \
40-
&& echo 'testssl:x:1000:' >> /etc/group \
41-
&& echo 'testssl:!::0:::::' >> /etc/shadow \
42-
&& install --mode 2755 --owner testssl --group testssl --directory /home/testssl \
43-
# The home directory will install a copy of `testssl.sh`, symlink the script to be used as a command:
44-
&& ln -s /home/testssl/testssl.sh /usr/local/bin/testssl.sh
47+
echo 'testssl:x:1000:1000::/home/testssl:/bin/bash' >> /etc/passwd
48+
echo 'testssl:x:1000:' >> /etc/group
49+
echo 'testssl:!::0:::::' >> /etc/shadow
50+
install --mode 2755 --owner testssl --group testssl --directory /home/testssl
51+
52+
# A copy of `testssl.sh` will be added to the home directory,
53+
# symlink to that file so it can be treated as a command:
54+
ln -s /home/testssl/testssl.sh /usr/local/bin/testssl.sh
55+
HEREDOC
4556

4657
# Runtime config:
4758
USER testssl
4859
ENTRYPOINT ["testssl.sh"]
4960
CMD ["--help"]
5061

5162
# Final image stage (add `testssl.sh` project files)
52-
# Choose either one as the final stage (defaults to last stage, `dist-local`)
63+
# Choose either one as the final stage (defaults to the last stage, `dist-local`)
5364

5465
# 62MB Image (Remote repo clone, cannot filter content through `.dockerignore`):
5566
FROM base-leap AS dist-git

Dockerfile.alpine

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
1+
# syntax=docker.io/docker/dockerfile:1
2+
13
FROM alpine:3.21 AS base-alpine
2-
RUN apk add --no-cache bash procps drill coreutils libidn curl socat openssl xxd \
3-
&& addgroup testssl \
4-
&& adduser -G testssl -g "testssl user" -s /bin/bash -D testssl \
5-
&& ln -s /home/testssl/testssl.sh /usr/local/bin/testssl.sh
4+
RUN <<HEREDOC
5+
apk add --no-cache bash procps drill coreutils libidn curl socat openssl xxd
6+
7+
# Add a non-root user `testssl`, this is roughly equivalent to the `adduser` command:
8+
# addgroup testssl && adduser -G testssl -g "testssl user" -s /bin/bash -D testssl
9+
echo 'testssl:x:1000:1000::/home/testssl:/bin/bash' >> /etc/passwd
10+
echo 'testssl:x:1000:' >> /etc/group
11+
echo 'testssl:!::0:::::' >> /etc/shadow
12+
install --mode 2755 --owner testssl --group testssl --directory /home/testssl
13+
14+
# A copy of `testssl.sh` will be added to the home directory,
15+
# symlink to that file so it can be treated as a command:
16+
ln -s /home/testssl/testssl.sh /usr/local/bin/testssl.sh
17+
HEREDOC
618

719
# Runtime config:
820
USER testssl
921
ENTRYPOINT ["testssl.sh"]
1022
CMD ["--help"]
1123

1224
# Final image stage (add `testssl.sh` project files)
13-
# Choose either one as the final stage (defaults to last stage, `dist-git`)
14-
15-
# 27MB Image (Local repo copy from build context, uses `.dockerignore`):
16-
FROM base-alpine AS dist-local
17-
COPY --chown=testssl:testssl . /home/testssl/
25+
# Choose either one as the final stage (defaults to the last stage, `dist-local`)
1826

1927
# 35MB Image (Remote repo clone, cannot filter content through `.dockerignore`):
2028
FROM base-alpine AS dist-git
2129
ARG GIT_URL=https://github.com/testssl/testssl.sh.git
2230
ARG GIT_BRANCH
2331
ADD --chown=testssl:testssl ${GIT_URL}#${GIT_BRANCH?branch-required} /home/testssl
32+
33+
# 27MB Image (Local repo copy from build context, uses `.dockerignore`):
34+
FROM base-alpine AS dist-local
35+
COPY --chown=testssl:testssl . /home/testssl/

Dockerfile.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Usage
22

3-
Run the image with `testssl.sh` options appended (default is `--help`). The container entrypoint is already set to `testsl.sh` as the command for convenience.
3+
Run the image with `testssl.sh` options appended (default is `--help`). The container entrypoint is already set to `testsl.sh` for convenience.
44

55
```bash
66
docker run --rm -it ghcr.io/testssl/testssl.sh:3.2 --fs github.com
@@ -19,19 +19,19 @@ docker run --rm -it -v /tmp:/data --workdir /data ghcr.io/testssl/testssl.sh:3.2
1919

2020
> [!NOTE]
2121
> - The UID/GID ownership of the file will be created by the container user `testssl` (`1000:1000`), with permissions `644`.
22-
> - Your host directory must permit the `testssl` container user or group to write to that host volume. You could alternatively use [`docker cp`](https://docs.docker.com/reference/cli/docker/container/cp/).
22+
> - Your host directory must permit the `testssl` container user or group to write to that host volume. You could alternatively use [`docker cp`][docker-docs::cli::cp].
2323
2424
## Images
2525

2626
### Available at DockerHub and GHCR
2727

2828
You can pull the image from either of these registries:
29-
- DockerHub: [`drwetter/testssl.sh`](https://hub.docker.com/r/drwetter/testssl.sh)
30-
- GHCR: [`ghcr.io/testssl/testssl.sh`](https://github.com/testssl/testssl.sh/pkgs/container/testssl.sh)
29+
- DockerHub: [`drwetter/testssl.sh`][image-registry::dockerhub]
30+
- GHCR: [`ghcr.io/testssl/testssl.sh`][image-registry::ghcr]
3131

3232
Supported tags:
3333
- `3.2` / `latest`
34-
- `3.0` is the old stable version ([soon to become EOL](https://github.com/testssl/testssl.sh/tree/3.0#status))
34+
- `3.0` is the old stable version ([soon to become EOL][testssl::v3p0-eol])
3535

3636
### Building the `testssl.sh` container image
3737

@@ -47,7 +47,9 @@ There are two base images supported:
4747
- openSUSE Leap ([`Dockerfile`](./Dockerfile)), glibc-based + faster.
4848
- Alpine ([`Dockerfile`](./Dockerfile.alpine)), musl-based + half the size.
4949

50-
The Alpine variant is made available if you need broarder platform support, or an image about 30MB smaller at the expense of slightly slower performance.
50+
The Alpine variant is made available if you need broader platform support, or an image about 30MB smaller at the expense of [slightly slower performance][testssl::base-image-performance].
51+
52+
For contributors, if needing context on the [package selection has been documented][testssl::base-image-packages] for each base image.
5153

5254
#### Tip - Remote build context + `Dockerfile`
5355

@@ -58,7 +60,7 @@ docker build --tag localhost/testssl.sh:3.2 https://github.com/testssl/testssl.s
5860
```
5961

6062
> [!NOTE]
61-
> This will produce a slightly larger image as [`.dockerignore` is not supported with remote build contexts](https://github.com/docker/buildx/issues/3169).
63+
> This will produce a slightly larger image as [`.dockerignore` is not supported with remote build contexts][build::dockerignore-remote-context].
6264
6365
---
6466

@@ -70,3 +72,11 @@ docker build \
7072
--file https://raw.githubusercontent.com/testssl/testssl.sh/3.2/Dockerfile.alpine \
7173
https://github.com/testssl/testssl.sh.git#3.2
7274
```
75+
76+
[docker-docs::cli::cp]: https://docs.docker.com/reference/cli/docker/container/cp/
77+
[image-registry::dockerhub]: https://hub.docker.com/r/drwetter/testssl.sh
78+
[image-registry::ghcr]: https://github.com/testssl/testssl.sh/pkgs/container/testssl.sh
79+
[testssl::v3p0-eol]: https://github.com/testssl/testssl.sh/tree/3.0#status
80+
[testssl::base-image-performance]: https://github.com/testssl/testssl.sh/issues/2422#issuecomment-2841822406
81+
[testssl::base-image-packages]: https://github.com/testssl/testssl.sh/issues/2422#issuecomment-2841822406
82+
[build::dockerignore-remote-context]: https://github.com/docker/buildx/issues/3169

Readme.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11

22
## Intro
3-
4-
[![CI tests](https://github.com/testssl/testssl.sh/actions/workflows/unit_tests_ubuntu.yml/badge.svg)](https://github.com/testssl/testssl.sh/actions/workflows/unit_tests_ubuntu.yml)
5-
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/testssl/testssl.sh?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3+
![GitHub Tag](https://img.shields.io/github/v/tag/testssl/testssl.sh)
4+
![Static Badge](https://img.shields.io/badge/%2Fbin%2Fbash_-blue)
5+
![Static Badge](https://img.shields.io/badge/OpenSSL_-blue)
66
[![License](https://img.shields.io/github/license/testssl/testssl.sh)](https://github.com/testssl/testssl.sh/LICENSE)
7+
![GitHub Created At](https://img.shields.io/github/created-at/testssl/testssl.sh)
8+
![GitHub last commit](https://img.shields.io/github/last-commit/testssl/testssl.sh)
9+
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/testssl/testssl.sh)
10+
[![CI tests](https://github.com/testssl/testssl.sh/actions/workflows/unit_tests_ubuntu.yml/badge.svg)](https://github.com/testssl/testssl.sh/actions/workflows/unit_tests_ubuntu.yml)
711
[![Docker](https://img.shields.io/docker/pulls/drwetter/testssl.sh)](https://github.com/testssl/testssl.sh/blob/3.2/Dockerfile.md)
8-
12+
![Mastodon Follow](https://img.shields.io/mastodon/follow/109319848143024146?domain=infosec.exchange)
13+
[![Bluesky](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpublic.api.bsky.app%2Fxrpc%2Fapp.bsky.actor.getProfile%2F%3Factor%3Dtestssl.bsky.social&query=%24.followersCount&style=social&logo=bluesky&label=Follow%20%40testssl.sh)
14+
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/testssl/testssl.sh?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
915

1016
`testssl.sh` is a free command line tool which checks a server's service on
1117
any port for the support of TLS/SSL ciphers, protocols as well as some
@@ -23,7 +29,7 @@ cryptographic flaws.
2329
* Reliability: features are tested thoroughly.
2430
* Privacy: It's only you who sees the result, not a third party.
2531
* Freedom: It's 100% open source. You can look at the code, see what's going on.
26-
* The development is open @ GitHub and participation is welcome.
32+
* The development is free and open @ GitHub and participation is welcome.
2733

2834
### License
2935

@@ -37,14 +43,14 @@ to get bugfixes, other feedback and more contributions.
3743

3844
### Compatibility
3945

40-
Testssl.sh is working on every Linux/BSD distribution out of the box. Latest by 2.9dev
46+
Testssl.sh is working on every Linux/BSD distribution and MacOS out of the box. Latest by 2.9dev
4147
most of the limitations of disabled features from the openssl client are gone
4248
due to bash-socket-based checks. An old OpenSSL-bad version is supplied but
4349
but you can also use any LibreSSL or OpenSSL version.
4450
testssl.sh also works on other unixoid systems out of the box, supposed they have
4551
`/bin/bash` >= version 3.2 and standard tools like sed and awk installed. An implicit
4652
(silent) check for binaries is done when you start testssl.sh . System V needs probably
47-
to have GNU grep installed. MacOS X and Windows (using MSYS2, Cygwin or WSL) work too.
53+
to have GNU grep installed. Windows (using MSYS2, Cygwin or WSL) work too.
4854

4955
Update notification here or @ [mastodon](https://infosec.exchange/@testssl) or [bluesky](https://bsky.app/profile/testssl.bsky.social). [twitter](https://twitter.com/drwetter) is not being used anymore.
5056

@@ -74,7 +80,7 @@ docker run --rm -it ghcr.io/testssl/testssl.sh <your_cmd_line>
7480
Or if you have cloned this repo you also can just ``cd`` to the INSTALLDIR and run
7581

7682
```
77-
docker build . -t imagefoo && docker run --rm -t imagefoo example.com
83+
docker build . -t imagefoo && docker run --rm -t imagefoo testssl.net
7884
```
7985

8086
For more please consult [Dockerfile.md](https://github.com/testssl/testssl.sh/blob/3.2/Dockerfile.md).
@@ -83,32 +89,33 @@ For more please consult [Dockerfile.md](https://github.com/testssl/testssl.sh/bl
8389

8490
Usage of the program is without any warranty. Use it at your own risk.
8591

86-
Testssl.sh is intended to be used as a standalone CLI tool. While we tried to apply best practise security measures, we can't guarantee that the program is without any vulnerabilities. Running as a service may pose security risks and you're recommended to apply additional security measures.
92+
Testssl.sh is intended to be used as a standalone CLI tool. While we tried to apply best practise security measures and sanitize external input, we can't guarantee that the program is without any vulnerabilities. Running as a web service may pose security risks and you're advised to apply additional security measures. Validate input from the user and from all services which are queried.
8793

8894
### Status
8995

90-
This is the stable release version 3.2. Please use it **now**, as 3.0.x will not get any updates after 3.0.10, with the current manpower we only support n-1 versions. There will be soon a separate 3.3.dev branch where further development takes place before 3.4 becomes the stable version and 3.2 becomes old-stable.
96+
This is the stable version 3.2. Please use it **now**, as 3.0.x will not get any updates after 3.0.10, with the current manpower we only support n-1 versions. There will be soon a separate 3.3.dev branch where further development takes place before 3.4 becomes the stable version and 3.2 becomes old-stable.
9197

9298
### Documentation
9399

94100
* .. it is there for reading. Please do so :-) -- at least before asking questions. See man page in groff, html and markdown format in `~/doc/`.
95101
* [https://testssl.sh/](https://testssl.sh/) will help to get you started.
96-
* For the (older) version 2.8, Will Hunt provides a longer [description](https://www.4armed.com/blog/doing-your-own-ssl-tls-testing/), including useful background information.
102+
* There's also a [https://deepwiki.com/testssl/testssl.sh](AI generated doc), see also below.
103+
* Will Hunt provides a longer [description](https://www.4armed.com/blog/doing-your-own-ssl-tls-testing/) for an older version (2.8), including useful background information.
97104

98105
### Contributing
99106

100-
A lot of contributors already helped to push the project where it currently is, see [CREDITS.md](https://github.com/testssl/testssl.sh/blob/3.2/CREDITS.md). Your contributions would be also welcome! There's a [large to-do list](https://github.com/testssl/testssl.sh/issues). To get started look for issues which are labeled as [good first issue](https://github.com/testssl/testssl.sh/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22), [for grabs](https://github.com/testssl/testssl.sh/issues?q=is%3Aissue+is%3Aopen+label%3A%22for+grabs%22) or [help wanted](https://github.com/testssl/testssl.sh/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). The latter is more advanced, you can also lookout for documentation issues.
107+
A lot of contributors already helped to push the project where it currently is, see [CREDITS.md](https://github.com/testssl/testssl.sh/blob/3.2/CREDITS.md). Your contribution would be also welcome! There's an [issue list](https://github.com/testssl/testssl.sh/issues). To get started look for issues which are labeled as [good first issue](https://github.com/testssl/testssl.sh/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22), [for grabs](https://github.com/testssl/testssl.sh/issues?q=is%3Aissue+is%3Aopen+label%3A%22for+grabs%22) or [help wanted](https://github.com/testssl/testssl.sh/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). The latter is more advanced. You can also lookout for [documentation issues](https://github.com/testssl/testssl.sh/issues?q=is%3Aissue%20state%3Aopen%20label%3Adocumentation), or you can help with [unit testing](https://github.com/testssl/testssl.sh/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22unit%20test%22) or improving github actions.
101108

102-
It is recommended to read [CONTRIBUTING.md](https://github.com/testssl/testssl.sh/blob/3.2/CONTRIBUTING.md) and please also have a look at he [Coding Convention](https://github.com/testssl/testssl.sh/blob/3.2/Coding_Convention.md). Before you start writing patches with hundreds of lines, better create an issue first.
109+
It is recommended to read [CONTRIBUTING.md](https://github.com/testssl/testssl.sh/blob/3.2/CONTRIBUTING.md) and please also have a look at he [Coding Convention](https://github.com/testssl/testssl.sh/blob/3.2/Coding_Convention.md). Before you start writing PRs with hundreds of lines, better create an issue first.
103110

104-
In general there's also some maintenance burden, like maintaining handshakes and CA stores, writing unit tests, improving github actions. If you believe you can contribute and be responsible to one of those maintenance task, please speak up. That would free resources that we could use for development.
111+
In general there's also some maintenance burden, like maintaining handshakes and CA stores etc. . If you believe you can contribute and be responsible to one of those maintenance task, please speak up. That would free resources that we could use for development.
105112

106113

107114
### Bug reports
108115

109116
Bug reports are important. It makes this project more robust.
110117

111-
Please file bugs in the issue tracker @ GitHub. Do not forget to provide detailed information, see template for issue, and further details @
118+
Please file bugs in the issue tracker @ GitHub. Do not forget to provide detailed information, see the template for issues, and further details @
112119
https://github.com/testssl/testssl.sh/wiki/Bug-reporting. Nobody can read your thoughts -- yet. And only agencies your screen ;-)
113120

114121
You can also debug yourself, see [here](https://github.com/testssl/testssl.sh/wiki/Findings-and-HowTo-Fix-them).

0 commit comments

Comments
 (0)