Commit Graph

118 Commits

Author SHA1 Message Date
Kevin Fenzi
29a00a8986 bastion: fix conditional for ssh tcpforwarding
I copy pasted this and left a 'not' in there that made this backwards.
Fix the conditional.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2026-01-31 08:20:16 -08:00
Kevin Fenzi
278d9427f8 bastion: allow ssh tcp forwarding on bastion hosts
We need this in order to be able to use them as jumphosts with ssh.
Without it, there's no easy way to get to any internal machines.
Just enable it here and leave the default off.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2026-01-30 11:16:01 -08:00
Michael Scherer
4a6c6cf37e Disable TCP forwarding on sshd
While there is a firewall on most of the the hosting facilities used
by the project, this is another layer of protection.
2026-01-13 23:46:37 +00:00
Kevin Fenzi
70c964ed9b pagure02: fare thee well.
We have moved to pagure01, retire pagure02

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-12-03 16:20:22 -08:00
Kevin Fenzi
ce574cf4ce basessh: fix conditional
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-07-16 11:59:38 -07:00
Kevin Fenzi
9d22211952 basessh: remove rhel7 stuff and clean up template
This should largely have no effect, but makes things easiler to
follow/read. We have 0 rhel7 instances left so removing all those
conditionals.

Also, rename the sshd_config teplate to be .j2 like all our other
templates.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-07-16 11:57:10 -07:00
Michal Konecny
2ec055db6f Use first uppercase letter for all handlers
This will unify all the handlers to use first uppercase letter for
ansible-lint to stop complaining.

I went through all `notify:` occurrences and fixed them by running
```
set TEXT "text_to_replace"; set REPLACEMENT "replacement_text"; git grep
-rlz "$TEXT" . | xargs -0 sed -i "s/$TEXT/$REPLACEMENT/g"
```

Then I went through all the changes and removed the ones that wasn't
expected to be changed.

Fixes https://pagure.io/fedora-infrastructure/issue/12391

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2025-02-10 20:31:49 +00:00
Kevin Fenzi
9495fde3f4 sshd: drop old rhel6 stuff
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-01-20 14:17:21 -08:00
Ryan Lerch
47c68f478d ansiblelint fixes - fqcn[action-core] - template to ansible.builtin.template
Replaces references to template: with ansible.builtin.template

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 11:30:29 +10:00
Ryan Lerch
3c41882bb0 ansiblelint fixes - fqcn[action-core] - shell to ansible.builtin.shell
Replaces references to shell: with ansible.builtin.shell

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 11:29:10 +10:00
Ryan Lerch
25391e95b7 ansiblelint fixes - fqcn[action-core] - package to ansible.builtin.package
Replaces many references to  package: with ansible.builtin.package

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 11:28:00 +10:00
Ryan Lerch
462176464b ansiblelint fixes-- fqcn[action-core] - command to ansible.builtin.command
Replaces many references to  command: with ansible.builtin.command

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 11:26:47 +10:00
Ryan Lerch
6a3816dfdc ansiblelint fixes-- fqcn[action-core] - copy to ansible.builtin.copy
Replaces many references to 'copy' with ansible.builtin.copy

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 10:43:31 +10:00
Ryan Lerch
62952df107 ansiblelint fixes-- fqcn[action-core] - file to ansible.builtin.file
Replaces many references to  file: with ansible.builtin.file

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 10:41:52 +10:00
Ryan Lerch
691adee6ee Fix name[casing] ansible-lint issues
fix 1900 failures of the following case issue:

`name[casing]: All names should start with an uppercase letter.`

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-14 20:20:07 +10:00
Ryan Lerch
89f6f1fc32 Fix majority of remaining yamllint warnings and errors
Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2024-11-28 17:31:45 +10:00
Stephen Smoogen
b5e7db6b83 Fix sshd_config for Fedora 36+
I have probably made this a bit wordy but I have found long jinja2
logic statements to be a bit hard to debug or go off the rails. So I
copied the section for Red Hat and used it for Fedora.

Signed-off-by: Stephen Smoogen <ssmoogen@redhat.com>
2023-01-17 17:43:18 -05:00
Stephen Smoogen
0863d2c8a9 Fix item in sshd_config that Kevin found in review 2023-01-17 15:43:33 -05:00
Stephen Smoogen
1618137592 retry to make a branch with just the sshd config change. 2023-01-17 20:37:34 +00:00
Kevin Fenzi
aa5e7e86ee bashssh: revert hack from 11006 and see if it is really fixed by quoting we did with new ansible
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-12-07 15:19:57 -08:00
Kevin Fenzi
dfa13ef9c7 Revert "Add elif to sshd_config template for EL7"
This reverts commit 3437042944.

This doesn't work on rhel8 machines:
/etc/crypto-policies/back-ends/opensshserver.config: line 1: Bad configuration option: CRYPTO_POLICY
/etc/crypto-policies/back-ends/opensshserver.config: terminating, 1 bad configuration options
2022-12-05 16:59:49 -08:00
Stephen Smoogen
3437042944 Add elif to sshd_config template for EL7
EL6 and EL7 have a limited set of algorithms, but EL8 and Fedora use
system configs set in a different file. Added an elif to better try
and show this.

Signed-off-by: Stephen Smoogen <ssmoogen@redhat.com>
2022-12-05 12:36:38 -05:00
Pavel Raiskup
50a7bd5e58 basessh: invent no_ed25519_key option
And re-configure copr-be-dev.
2022-11-23 13:10:13 +01:00
Kevin Fenzi
51811f894d basessh: fix sign_hostnames to use correct variable expansion (i hope)
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-19 10:51:24 -08:00
Kevin Fenzi
9259cb1ead basessh: change empty list to not use quotes
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-19 10:46:29 -08:00
Kevin Fenzi
61ebb2f958 basessh: remove singlequotes
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-19 10:43:21 -08:00
Kevin Fenzi
da8ef971ee basessh: inner variable no longer needs escaped
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-19 10:33:26 -08:00
Kevin Fenzi
25914510c1 basessh: try and move the variable expansion out to the addition
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-19 10:28:06 -08:00
Kevin Fenzi
7e40030b01 Revert "basessh: try and filter out the empty list element"
This reverts commit 91db9425bc.
2022-11-19 10:18:04 -08:00
Kevin Fenzi
91db9425bc basessh: try and filter out the empty list element
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-19 10:13:31 -08:00
Kevin Fenzi
4cdee4e355 basessh: try and check path in renew path too
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-19 09:51:06 -08:00
Kevin Fenzi
60f6342682 basessh: try and only act on items with a /etc/ssh path
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-18 21:53:39 -08:00
Kevin Fenzi
a7f25f1662 basessh: see if we can just fail fetching missing files
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-18 10:21:55 -08:00
Kevin Fenzi
b2dbfba711 basessh: revert back
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-18 10:15:08 -08:00
Kevin Fenzi
1c740ec365 basessh: try setting empty fact another way
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-18 10:13:11 -08:00
Kevin Fenzi
7747b40c82 basessh: try and not add initial empty fact
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-18 10:11:14 -08:00
Kevin Fenzi
8398aec029 basessh: enable internal sftp server globally.
In the past we only enabled sftp on servers where we needed it.
(ones using sshfs, ones that users might need to sftp to, etc).
However, now days the openssh scp client uses sftp, so we might as well
just enable it globally so people don't need to use 'scp -O' (which
has it use the old scp protocol, which will be removed someday).

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-29 14:17:13 -07:00
Pierre-Yves Chibon
2b46c6a7fb basessh/distgit: adjust the way ssh is configured for distgit
Basically, we are now installing a small wrapper in /usr/local/bin
which just echoes to stdout what should be in the authorized_keys
file for that user.
That content is generated by retrieving the ssh key from sssd via
the command sss_ssh_authorizedkeys as well as the usual ssh way to
restrict the action an user/key can do: command="...".
In this case, we're setting a couple of environment variable that
are needed later on for things to work properly as well as only
allow the user to call the aclchecker.py script provided by pagure.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-04-03 21:16:51 +02:00
Pierre-Yves Chibon
00804542f3 Revert "basessh/distgit: adjust the way ssh is configured for distgit"
This is still being reviewed and wasn't meant to be pushed out yet

This reverts commit 67844b4504.
2021-04-03 19:10:54 +02:00
Pierre-Yves Chibon
67844b4504 basessh/distgit: adjust the way ssh is configured for distgit
Basically, we are now installing a small wrapper in /usr/local/bin
which just echoes to stdout what should be in the authorized_keys
file for that user.
That content is generated by retrieving the ssh key from sssd via
the command sss_ssh_authorizedkeys as well as the usual ssh way to
restrict the action an user/key can do: command="...".
In this case, we're setting a couple of environment variable that
are needed later on for things to work properly as well as only
allow the user to call the aclchecker.py script provided by pagure.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-04-03 19:01:38 +02:00
Kevin Fenzi
ddbda78af2 basessh: should be an else here
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-03-29 21:13:48 -07:00
Kevin Fenzi
a1121be991 basessh / pagure: undo change to everyone using git user, as we are not doing this now
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-03-29 20:57:58 -07:00
Pierre-Yves Chibon
a3677b36a1 distgit: start working on moving dist-git to use git@ for ssh
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-03-01 13:16:18 +01:00
Kevin Fenzi
68ae773dc6 basessh: in stg setup sssd/ipa to handle ssh keys
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-01-18 15:51:28 -08:00
Kevin Fenzi
bfc5675848 basessh: it's pagure02
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-11-04 15:19:52 -08:00
Kevin Fenzi
9fba0f7ff4 basessh: revert new ed25519 key on pagure.io as well
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-11-04 15:17:09 -08:00
Kevin Fenzi
84a7bbe56e basessh: do not add new host key on pkgs01*
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-11-03 16:32:52 -08:00
Kevin Fenzi
07d908dfc5 basessh: enable ed25519 ssh host keys everywhere
For newer ssh (in fedora) we need to have certs that are not using
sha-1. So, we need to regenerate the certs signed by our CA with sha256.
While we are at it, enable the ed25519 host keys as rsa keys are
increasingly in disfavor.

So, old ssh will use the old rsa host certs that are sha1 for now, but
new ssh will use the sha256 signed ed25519 certs. If everything works
fine for a while, we can resign the rsa host keys also and totally get
rid of the sha1 certs.

Since both host keys are signed by our CA, they should still be just as
trusted as before. If you are asked to approve a new host key for
something, make sure you have our CA in your known_hosts file:
https://admin.fedoraproject.org/ssh_known_hosts

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-11-03 15:11:16 -08:00
Kevin Fenzi
925f314af5 basessh: see if we can generate a sha256 cert
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-11-03 15:04:51 -08:00
Kevin Fenzi
259a1734ae bastion02: try resigning and using better host certs.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-11-03 14:59:21 -08:00