distro/rhel85: disable pw auth for EC2 images

Disable loging in via password authentication since this is an
official Amazon marketplace requirement

  Linux-based AMIs must not allow SSH password authentication.
  Disable password authentication via your sshd_config file by
  setting PasswordAuthentication to NO.

  Section "Security policies" from
  https://docs.aws.amazon.com/marketplace/latest/userguide/product-and-ami-policies.html
This commit is contained in:
Christian Kellner 2022-01-28 16:06:38 +00:00 committed by Tomáš Hozza
parent 6f132181d9
commit 8aede24057
6 changed files with 46 additions and 0 deletions

View file

@ -371,6 +371,12 @@ func ec2BaseTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec,
p.AddStage(osbuild.NewRHSMStage(rhsmStageOptions))
}
p.AddStage((osbuild.NewSshdConfigStage(&osbuild.SshdConfigStageOptions{
Config: osbuild.SshdConfigConfig{
PasswordAuthentication: common.BoolToPtr(false),
},
})))
return p, nil
}