Puppet Master에서 인증서 요청을 거부하는 방법은 무엇입니까?

Puppet Master에서 인증서 요청을 거부하는 방법은 무엇입니까?

호스트 이름이 잘못된 에이전트로부터 몇 가지 요청이 있습니다. 이 문제를 수정했지만 여전히 잘못된 호스트 이름이 포함된 미해결 요청이 있습니다.

나는 시도했다:

$puppet cert list
  "wrong.host.name" (SHA256) 8E:...:51

$ puppet cert revoke wrong.host.name
Error: Could not find a serial number for wrong.host.name

$ puppet cert clean wrong.host.name
Error: Could not find a serial number for wrong.host.name

그들을 제거하는 올바른 방법은 무엇입니까?

답변1

사용ca더 잘 작동하며 와 달리 단일 단계로 인증서를 제거할 수 있습니다 cert. 중요한 것은 유효하지 않은 인증서에 일시적으로 서명하지 않는다는 것입니다.

$ puppet ca destroy wrong.host.name
Notice: Removing file Puppet::SSL::CertificateRequest wrong.host.name at '/var/lib/puppet/ssl/ca/requests/wrong.host.name.pem'
Deleted for wrong.host.name: Puppet::SSL::CertificateRequest

명령puppet ca최근에 더 이상 사용되지 않습니다따라서 어느 시점에서는 사라질 수도 있지만 이에 상응하는 명령은 없습니다. 이있다벌레교체 없이 이 명령을 제거하는 것이 약간 어리석다고 생각되면 투표할 수 있습니다.

답변2

가능한 해결 방법 1:

puppet cert clean꼭두각시 마스터 를 사용하는 것이 올바른 방법입니다. 그러나 오류가 발생하므로 인증서 인벤토리가 잘못되었을 수 있습니다.

재인벤토리를 수행한 후 정리를 시도해 보십시오.

$ puppet cert reinventory
$ puppet cert clean --all

참고: 내 예에서는 --all플래그를 사용합니다. 그러면 서명된 인증서와 서명되지 않은 인증서가 모두 지워집니다. 또한 reinventory.

원천:http://docs.puppetlabs.com/references/3.6.2/man/cert.html

가능한 해결 방법 2:

$ puppet cert sign wrong.host.name
Notice: Signed certificate request for wrong.host.name
Notice: Removing file Puppet::SSL::CertificateRequest wrong.host.name at '/var/lib/puppet/ssl/ca/requests/wrong.host.name.pem'

$ puppet cert clean wrong.host.name
Notice: Revoked certificate with serial 87
Notice: Removing file Puppet::SSL::Certificate wrong.host.name at '/var/lib/puppet/ssl/ca/signed/wrong.host.name.pem'
Notice: Removing file Puppet::SSL::Certificate wrong.host.name at '/var/lib/puppet/ssl/certs/wrong.host.name.pem'

가능한 해결 방법 3:

첫 번째: 서버에서

$ puppet cert --revoke wrong.host.name
$ puppet cert --clean wrong.host.name

두 번째: 클라이언트에서

$ rm -rf /usr/lib/puppet/ssl
$ puppet agent --server [puppetmaster domain name] --waitforcert 60

세 번째: 서버에서(필요에 따라 조정)

$ puppet cert --list (you should see your host)
$ puppet cert --sign wrong.host.name

또한 클라이언트가 [puppetmaster 도메인 이름]에 연결할 수 있는지 다시 확인하세요.

원천:https://serverfault.com/questions/574976/puppet-trying-to-configure-puppet-client-for-first-use-but-got-some-problems-wi

답변3

내가 한 방법은 다음과 같습니다.

[root@puppetmc ca]# puppet cert clean sparrow.home
Error: Could not find a serial number for sparrow.home
[root@puppetmc ca]# cat inventory.txt 
0x0002 2015-05-17T06:33:29GMT 2020-05-16T06:33:29GMT /CN=puppetmc.home
0x0003 2015-05-17T23:25:33GMT 2020-05-16T23:25:33GMT /CN=sparrow.rospop.com
0x0004 2015-05-18T00:53:18GMT 2020-05-17T00:53:18GMT /CN=puppetmc.home
0x0005 2015-05-18T02:18:12GMT 2020-05-17T02:18:12GMT /CN=sparrow.rospop.com
[root@puppetmc ca]# vi  inventory.txt 

Inventory.txt에 아래 줄을 추가했습니다.

0x0001 2015-05-17T06:33:29GMT 2020-05-16T06:33:29GMT /CN=sparrow.home

그런 다음 실행

[root@puppetmc ca]# puppet cert clean sparrow.home
Notice: Revoked certificate with serial 1
Notice: Removing file Puppet::SSL::CertificateRequest sparrow.home at '/var/lib/puppet/ssl/ca/requests/sparrow.home.pem'
Vince Bhebhe

관련 정보