#166 Add pkinit config and ipa certs
Merged 3 years ago by mohanboddu. Opened 3 years ago by ryanlerch.
ryanlerch/fedora-packager noggin-pkinit  into  main

file modified
+6
@@ -74,3 +74,9 @@ 

  krb5conf_DATA = $(srcdir)/krb-configs/fedoraproject_org \

  	$(srcdir)/krb-configs/stg_fedoraproject_org

  krb5confdir = $(sysconfdir)/krb5.conf.d

+ 

+ EXTRA_DIST += ipa_ca/fedoraproject_ipa_ca.crt \

+ 	ipa_ca/stg_fedoraproject_ipa_ca.crt

+ ipaca_DATA = $(srcdir)/ipa_ca/fedoraproject_ipa_ca.crt \

+ 	$(srcdir)/ipa_ca/stg_fedoraproject_ipa_ca.crt

+ ipacadir = $(sysconfdir)/pki/ipa

file modified
+5 -1
@@ -32,6 +32,7 @@ 

  Requires:       krb5-workstation

  %endif

  %endif

+ Requires:       krb5-pkinit

  Recommends:     fedora-packager-yubikey

  

  BuildArch:      noarch
@@ -72,7 +73,10 @@ 

  %exclude %{python3_sitelib}/fedora_cert

  

  %config(noreplace) %{_sysconfdir}/koji.conf.d/*

- %config(noreplace) %{_sysconfdir}/krb5.conf.d/*

+ %config %{_sysconfdir}/krb5.conf.d/*

+ 

+ %{_sysconfdir}/pki/ipa/*

+ 

  

  %files yubikey

  %license COPYING

@@ -0,0 +1,22 @@ 

+ -----BEGIN CERTIFICATE-----

+ MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQsFADA8MRowGAYDVQQKDBFGRURP

+ UkFQUk9KRUNULk9SRzEeMBwGA1UEAwwVQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4X

+ DTE2MTAxMzEzMDQ0NloXDTM2MTAxMzEzMDQ0NlowPDEaMBgGA1UECgwRRkVET1JB

+ UFJPSkVDVC5PUkcxHjAcBgNVBAMMFUNlcnRpZmljYXRlIEF1dGhvcml0eTCCASIw

+ DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALLFCPrsPD3YW/yzvId7UsWCq/Ac

+ cD7IOtlt46slTa490T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BAQsFAAOCAYEAQCM2

+ 5ewm8zejLr3FGTQRjxr8CoddDd8WBSKgCKeNgpCHZeEO9+SThC0UQJg7EIJ774EY

+ hEHSWIM2bIwVI/zR12KjtXFOwElQkcvyaX+VpCedVr9v3MbYHcz36+wJA/LYYmoI

+ i9bDGzXDTqh1Mdd73PIMYfBmFwZsw8x5WpOyF4Nt9ADqZy1JDEq13kktqdbAPB6P

+ r0W/FJQoM/5a2o2dO44pW6zNTXJwtKCkomK/XE+Fl17x0uOytV6AMEZP+mJ/A6Xp

+ 8gdAq2U24N4IBAVt9OAjkG1fCIl/L2/mUuEKgp+oT9ALBJAkayIHoUu6XskIyNiw

+ YTKEz/HJ87uyG0jatqOkbg7rzbz6KHOnutVUYnpWWwJUZs2/kvaY870DLTDtW7VF

+ euyf2c8xt3hPd/ZTwMGV3rZE0k2x9u4L+3qs7doDCuGBg0R0QKNrCNH/KOcn5tjW

+ OxUPDIJF3XvrT9GlHRWDK9NoO1cxMvgRqsgOrlXyxEvzWQob0dn2HPVIerwS

+ -----END CERTIFICATE-----

@@ -1,6 +1,7 @@ 

  [realms]

   FEDORAPROJECT.ORG = {

          kdc = https://id.fedoraproject.org/KdcProxy

+         pkinit_anchors = FILE:/etc/pki/ipa/fedoraproject_ipa_ca.crt

   }

  [domain_realm]

   .fedoraproject.org = FEDORAPROJECT.ORG

@@ -1,6 +1,7 @@ 

  [realms]

   STG.FEDORAPROJECT.ORG = {

          kdc = https://id.stg.fedoraproject.org/KdcProxy

+         pkinit_anchors = FILE:/etc/pki/ipa/stg_fedoraproject_ipa_ca.crt

   }

  [domain_realm]

   .stg.fedoraproject.org = STG.FEDORAPROJECT.ORG

In the FAS replacement being rolled out in 2021, that uses freeipa and noggin, if a user has 2FA enabled, they need some extra configuration to get kinit working with 2FA.

Note that the commit message has a little more information, and there is also a docs PR in progress that covers for users how to use this. https://github.com/fedora-infra/fedora-accounts-docs/pull/1/files (this will need to be changed to remove the steps that this PR implements)

https://github.com/fedora-infra/fedora-accounts-docs/pull/1 has a bit more information on the reasons for doing this this way too.

2 new commits added

  • Add pkinit config and ipa certs
  • Fix version and specfile
3 years ago

rebased onto 7d80679

3 years ago

So, with this, what is the process? ie, how much does this automate it? :)

After this the user will have to do an anonymous kinit to get the ticket cache then use that cache to kinit as themselves and enter pass+token. It could even be done in a clunky one liner something like

 kinit user@FEDORAPROJECT.ORG - T $(kinit - n @FEDORAPROJECT.ORG) 

The more elegant fleshed out solution is in this PR

I think there are extra spaces provided for the options

kinit user@FEDORAPROJECT.ORG -T $(kinit -n @FEDORAPROJECT.ORG) 

Or it should be spaces?

I think there are extra spaces provided for the options

kinit user@FEDORAPROJECT.ORG -T $(kinit -n @FEDORAPROJECT.ORG)

Or it should be spaces?

Yep, you are right :) I typed it on my phone so it got autocorrected

LGTM but two questions:

  1. What happens if people run kinit user@FEDORAPROJECT.ORG before noggin is deployed but newer version with the newer krb config is installed?
  2. What happens if people run kinit user@FEDORAPROJECT.ORG after noggin is deployed either with this newer version is installed or not?

LGTM but two questions:

  1. What happens if people run kinit user@FEDORAPROJECT.ORG before noggin is deployed but newer version with the newer krb config is installed?

Should have no effect as the cert is from ipa currently in prod. This only effects people with 2fa set. I've run kinit in password only mode in stage with this setup and it worked as normal

  1. What happens if people run kinit user@FEDORAPROJECT.ORG after noggin is deployed either with this newer version is installed or not?

If they don't have an OTP token it will work as before. If they do have an OTP token it will error with kinit: Pre-authentication failed: Invalid argument while getting initial credentials

Also I just realised that I never pasted the link to the docs PR I was referring to in my earlier comment. https://github.com/fedora-infra/fedora-accounts-docs/pull/1/files

@mohanboddu @kevin @mobrien is there anything else needed for this one?

Pull-Request has been merged by mohanboddu

3 years ago