Commit graph

102 commits

Author SHA1 Message Date
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
Stephen Smoogen
d05626d43c [pagure] put back changes into configs I whacked earlier 2020-04-24 21:34:20 +02:00
Stephen Smoogen
ccaa519dd3 [pkgs]: remove mentions of repospanner so that playbooks will set up things without it 2020-04-24 21:34:20 +02:00
Kevin Fenzi
88e27098a3 basessh: simplify when conditional
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:18 +02:00
c0e2e1dbe9 basessh: fix up check for libselinux python OS version chceks 2020-04-24 21:34:14 +02:00
Kevin Fenzi
d535829453 basessh: fix up logic for el8 machines.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:13 +02:00
Kevin Fenzi
2eb26dd5f9 basessh: carefully adjust install so it only fixes rhel8 and changes nothing else for freeze.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:13 +02:00
Kevin Fenzi
50d998849b basessh: We need these conditions to apply to CentOS as well as RedHat due to maintainer test instances.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:13 +02:00
Kevin Fenzi
81fb4582e7 ansible: change when conditions to use == instead of is when checking strings.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:10 +02:00
Kevin Fenzi
e4222545c1 basessh: Did ansible variable handling change on us?
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:10 +02:00
Kevin Fenzi
b3197a473f basessh: can drop this section now too.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:10 +02:00
Kevin Fenzi
a562b8a3f8 ansible_distribution_version: address FIXME's/review tweaks.
download: mod_limitipconn isn't used anyone, dropped the entire line.
transient_cloud: just dropped the dnf part and use 'package' entirely.
sshd_config: UsePrivilegeSeparation isn't used in Fedora at all.
koji_hub: no fedora or rhel8 hubs yet, so just 7 is fine for now.
openvpn: changes look ok
packages3: Should get cverna to review, packages is using fedora now.
varnish: no rhel8 varnish servers yet.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:10 +02:00
Karsten Hopp
c9ed62ac32 update ansible_distribution_major_version conditionals
Signed-off-by: Karsten Hopp <karsten@redhat.com>
2020-04-24 21:34:10 +02:00
Kevin Fenzi
27929fa58b basessh: Always run the keygen shell command if needed, even in check mode.
Without this check mode will fail if there's not an old signed copy of the key around.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:10 +02:00
Kevin Fenzi
812c4c0f0d basessh: set the delegate here to localhost
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2019-07-01 18:18:03 +00:00
Kevin Fenzi
3ed359e343 basessh: do not set python2 here, it should be autodetected.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2019-07-01 18:06:09 +00:00
Kevin Fenzi
d74c28a2c8 basessh: try and set /usr/bin/python for the delegations to batcave01 for python3 using hosts.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2019-06-16 20:01:10 +00:00