Skip to content

Add new parameter -M for max. duration#409

Closed
sch-m wants to merge 2 commits intomkj:masterfrom
TDT-AG:pr/20260304-max_duration
Closed

Add new parameter -M for max. duration#409
sch-m wants to merge 2 commits intomkj:masterfrom
TDT-AG:pr/20260304-max_duration

Conversation

@sch-m
Copy link
Copy Markdown
Contributor

@sch-m sch-m commented Mar 4, 2026

Some technical guidelines (e.g., TR-03148) and cybersecurity baselines
require a hard maximum connection duration / session timeout for remote
connections. Therefore, a parameter is hereby introduced that can be
used to configure the maximum connection duration. The default value is
0 (disabled).

Use authdone instead of connect_time as dependency for authentication
timeout checking. This prevents connect_time from being set to 0
unnecessarily and allows it to be used for other purposes.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
@sch-m sch-m force-pushed the pr/20260304-max_duration branch from 3451d0c to 362215a Compare March 4, 2026 10:43
@sch-m
Copy link
Copy Markdown
Contributor Author

sch-m commented Mar 4, 2026

@mkj I don't understand why the check fails here and max_duration_secs seems to be set to 1, even though the default value is actually 0. Make check runs without any problems for me.

@mkj
Copy link
Copy Markdown
Owner

mkj commented Mar 5, 2026

@mkj I don't understand why the check fails here and max_duration_secs seems to be set to 1, even though the default value is actually 0. Make check runs without any problems for me.

I guess github runners are slower than local systems so it might take longer than a second? max_duration_secs set to 1 looks like a real problem though?

@sch-m
Copy link
Copy Markdown
Contributor Author

sch-m commented Mar 5, 2026

max_duration_secs set to 1 looks like a real problem though?

But I can't see any errors in my changes. DEFAULT_MAX_DURATION = 0. So how can opts.max_duration_secs = 1 be? The -M option isn't set anywhere in the tests.

Some technical guidelines (e.g., TR-03148) and cybersecurity baselines
require a hard maximum connection duration / session timeout for remote
connections. Therefore, a parameter is hereby introduced that can be
used to configure the maximum connection duration. The default value is
0 (disabled).

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
@sch-m sch-m force-pushed the pr/20260304-max_duration branch from 362215a to b849519 Compare March 5, 2026 12:17
@sch-m sch-m marked this pull request as draft March 5, 2026 12:17
@sch-m sch-m force-pushed the pr/20260304-max_duration branch 3 times, most recently from 7e1dc96 to 6e354ea Compare March 5, 2026 13:28
@mkj
Copy link
Copy Markdown
Owner

mkj commented Mar 5, 2026

Aah, it'll be because that CI option flips any 0 options to 1, it'll need an exclusion. Don't worry about it, I'll fix it up. Sorry for the noise there.

- name: nondefault
if: ${{ matrix.nondefault }}
run: |
# Turn on anything that's off by default. Rough but seems sufficient
grep ' 0$' src/default_options.h | sed 's/0$/1/' >> localoptions.h
# PAM clashes with password
echo "#define DROPBEAR_SVR_PASSWORD_AUTH 0" >> localoptions.h
# 1 second timeout is too short
sed -i "s/DEFAULT_IDLE_TIMEOUT 1/DEFAULT_IDLE_TIMEOUT 99/" localoptions.h
# DROPBEAR_SVR_DROP_PRIVS is on by default, turn it off
echo "#define DROPBEAR_SVR_DROP_PRIVS 0" >> localoptions.h
echo "#define DROPBEAR_SVR_LOCALSTREAMFWD 0" >> localoptions.h

@sch-m sch-m force-pushed the pr/20260304-max_duration branch from 6e354ea to db80283 Compare March 5, 2026 13:45
@sch-m sch-m marked this pull request as ready for review March 5, 2026 13:45
@sch-m
Copy link
Copy Markdown
Contributor Author

sch-m commented Mar 5, 2026

Aah, it'll be because that CI option flips any 0 options to 1, it'll need an exclusion. Don't worry about it, I'll fix it up. Sorry for the noise there.

Thank you for the clarification.

@mkj
Copy link
Copy Markdown
Owner

mkj commented Apr 16, 2026

Thanks, this is merged. While testing I noticed an existing bug in the timeout handling, now fixed. #418

@mkj mkj closed this Apr 16, 2026
@sch-m sch-m deleted the pr/20260304-max_duration branch April 17, 2026 07:26
@sch-m
Copy link
Copy Markdown
Contributor Author

sch-m commented Apr 17, 2026

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants