CA, PKI AD CS olarak adlandırılan servisinin kurulumu ve konfigurasyonu hakkında vereceğim.
Kullanıcı hesapları, computer hesapları ve servis hesapları için kullanılan sertifikalar Windows ortamında sıkça kullanılır. Ayrıca network devicelar içinde kullanılır.
Standalone ve Enterprise CA olmak üzre temelde ikiye ayrılır. Standalone ca için bir domain ortamı gerekmek. Kullanıcı hesapları için sertifika requestleri manuel yapılır ayrıca bir sertifika template yapısı kullanılmaz. Auto enrollment yapısıda bulunmaz. Ancak Enterprise CA için bir AD DS ihtiyacı bulunur, GPO ile sertifikalar dağıtılabilir AD DS ile recovations yapısı kullanılabildiği gini template ve autoenrollment desteği de bulunur.
802.1x, EFS, Smart Card Auth (2FA), WebServer gibi çokça serviste kullanılan AD CA nin kurulum adımları aşağıdaki gibidir.
Domain ortamında Enterprise Admin yetkisine sahip bir account ile kurulum yapılmakatadır.




CA için kullanılacak features lar seçilir. Ben tüm servisleri seçiyorum. İhtiyaca göre gerekli servisler seçilerek kurulabilir. AD CS ile birlikte ISS in kuruluma da gerçekleşir.

Kurulumdan sonra post-deployment çalıştırılır.


AD CS in her servisi ayrı olarak tek tek konfigure edebilir.
AD CS kurulu olmadan Network Device Enrollement ve Certificate Entollment Web Service kurulumu gerçekleştirilmemektedir.
![Machine generated alternative text:
AD CS Configuration 
Role Services 
Cr.der-.iels 
Role Services 
Setup Type 
CA Type 
Private Key 
Cryptography 
CA Name 
Certificate Reguest 
Certificate Detebese 
Authentication Type for C.. 
Server Certificate 
Confirmation 
DESTINATION SERVER 
DCOI.semih.IocaI 
Select Role Services to configure 
Certification Authority 
g] Certification Authority Web Enrollment 
g] Online Responder 
Network Device Enrollment Service 
Certificate Enrollment Web Service 
g] Certificate Enrollment Policy Web Service 
More about AD CS Server Roles 
Configure 
Cancel](https://www.semihuykan.com.tr/wp-content/uploads/2021/01/machine-generated-alternative-text-ad-cs-configur-1.png)
Yazının başında belirttiğim gibi Enterprise veya Standalone CA kurulumdan hangisini gerçekleştireceksek ilgili CA tipi seçilir ve kurulum başlatılır.

Root CA ilk kurulan CA dir. Subordinate CA ise child ca gibi düşebilirsiniz.

İlk kurulumda CA için bir private key oluşturulması sağlanır. Backup\Restore veya upgrade seçeneklerinde diğer seçenek ile kurulum yapılır.

AD CS için cryptographic provider seçimi gerçekleştirilir.


Sertifikanın kullanım alanına göre sertifikanın kaç gün\yıl ile expire olacağı seçilir. Kullaılacak senarya göre gün olarak seçilebildiği gibi genelde sunucularda 2-3 yıl olarak seçilir.


Sertifikamız domain ortamında olduğu için Windows Integrated olarak çalışması gerekmektedir. AD_Level Auth olarak kullanılır.

AD CS için daha sonra bir sertifika konfigurasyonu yapacağım için bu seçeneği seçiyorum.



İlk kurulum tamamlanmıştır.

![Machine generated alternative text:
certsrv [Certification Authority I\Revoked Certificates] 
File Action View Help 
Cetification Authority (Local) 
semih-DC01-CA-1 
Revoked Ce rtificates 
Issued Certificates 
Pending Requests 
Failed Requests 
Certificate Templates 
Request ID 
Revocation Date 
Effective Revocation Date 
Revocation Reason 
Requester 
There are no items to show in this view.](https://www.semihuykan.com.tr/wp-content/uploads/2021/01/machine-generated-alternative-text-certsrv-certi.png)
Var bir klasörü aşağıdaki gibi encrypt edersem domaindeki account um otomatik olarak AD CS ten bir sertifika alacak ve alınan sertifika IE üzerinden aşağıdaki gibi görülebilecek.
![Machine generated alternative text:
Test Properties 
Advanced Attributes 
Attribut 
Choose the settings pu want for this folder 
When you dick OK or Apply on the Proper tes dialog, you will be 
asked if you vvant the changes to affect all subfolders and fles 
as nell 
Archive and Index attributes 
Folder is ready for archiving 
Z] Allon fles in this folder to have contents indexed in addition to file 
oper tes 
Compress or Encrypt attributes 
Compress contents to save disk space 
Z] Encrypt contents to secure data](https://www.semihuykan.com.tr/wp-content/uploads/2021/01/machine-generated-alternative-text-test-propertie.png)

Sertifika ayrıca aşağıdaki Issued Certificates te görülmektedir. Sertifika temlate I olarak ta Basic EFS sertifikası client için issue edilmiştir.
![Machine generated alternative text:
certsrv - [Certification Authority I\lssued Certificates] 
File Action View Help 
Cetification Authority (Local) 
semih-DC01-CA-1 
Revoked Certificates 
Issued Certificates 
Pending Requests 
Failed Requests 
Certificate Templates 
Request ID 
Requester Name 
SEMI H\administrator 
Binary Certificate 
- --8EGIN CERTIFICAT... 
Certificate Template 
Basic EFS (EFS) 
Serial Number 
57DDDDDD02bfd... 
Certificate Effective Date 
1/19/2021 1239 AM](https://www.semihuykan.com.tr/wp-content/uploads/2021/01/machine-generated-alternative-text-certsrv-cer.png)
EFS gibi sertifikaların otomatik issue edilmeyin Pending Request te beklemesi ve bir admin in bu sertifikayı issue etmesi gerekiyorsa aşağıdaki seçenek ile değişiklik yapılır.

Kurulmak istenen PKI altyapısına göre hangi kullanıcı\grup lara hangi yetkiler verilmek isteniyorsa securty tabında ilgili değişiklikler yapılır.

Sertifika templatelerine göre ilgili kullanıcı\gruplar için yetki verilebilir. 802.1x sertifika ları bir IT ekibi başka bir sertifika template ini başka bir IT ekibi gibi.
Delegasyon işlemlerinin yapıldığı yerdir.

AD CS üzerindeki kim hangi işlemi yaptmış gibi bir log tutmak isteniyorsa aşağıdaki events to audit ten ilgili seçenekler seçilir.
![Machine generated alternative text:
certsrv - [Certification Authority 
File Action View Help 
Certification Authority (Local) 
semih-DC01-CA-1 
Revoked Certificates 
Issued Certificates 
Pending Requests 
Failed Requests 
Certificate Templates 
semih-DCOI-CA-I Properties 
Extensions 
Enrollment Agents 
Storage 
P olicy Module 
Certificate Managem 
Exit Module 
Auditing 
Reco very 
To start logging events to the security Bg. you must enable the 'Audit object 
access' setting in Group Policy 
Events to audit 
[3 Back up and restore the CA database 
Change CA configuration 
Change CA security settings 
Z] Issue and manage certificate requests 
Revoke certificates and publish CRLs 
Store and retrieve archived keys 
[3 Start and stop Active Directory Certificate Services](https://www.semihuykan.com.tr/wp-content/uploads/2021/01/machine-generated-alternative-text-certsrv-cer-3.png)
Issue edilen bir sertifika aşağıdaki gibi bir ihtiyaç nedeniylr revoke edilebilir.
![Machine generated alternative text:
certsrv - [Certification Authority I \lssued Certificates] 
File Action View Help 
Cetification Authority (Local) 
semih-DC01-CA-1 
Revoked Certificates 
Issued Certificat 
es 
Pending Requests 
Failed Requests 
Certificate Templates 
Request ID 
Requester Name 
All Tasks 
Refresh 
Help 
Binary Certificate 
--8EGIN CERTIFICAT... 
View Attributes/Extensions... 
Export Binary Data... 
Revoke Certificate 
Certificate Template 
Basic EFS (EFS) 
Serial Number 
5700000002bfd...](https://www.semihuykan.com.tr/wp-content/uploads/2021/01/machine-generated-alternative-text-certsrv-cer-4.png)
![Machine generated alternative text:
certsrv - [Certification Authority -CA-Illssued Certificates] 
File Action View Help 
Cetification Authority (Local) 
semih-DC01-CA-1 
Revoked Certificates 
Issued Certificates 
Pending Requests 
Failed Requests 
Certificate Templates 
Request ID 
Requester Name 
SEMI H\administrator 
Binary Certificate 
-BEGIN CERTIFICAT... 
Certificate Template 
Basic EFS (EFS) 
Serial Number 
57DDDDDD02bft 
Certificate Revocation 
Are you sure you want to revoke the selected certificate(s)? 
Specify a reason date and time 
Reason code 
Unspecified 
Date and Time](https://www.semihuykan.com.tr/wp-content/uploads/2021/01/machine-generated-alternative-text-certsrv-cer-5.png)
![Machine generated alternative text:
certsrv [Certification Authority I\Revoked Certificates] 
File Action View Help 
Certification Authority (Local) 
semih-DC01-CA-1 
Revoked Cetificates 
Issued Certificates 
Pending Requests 
Failed Requests 
Certificate Templates 
Request ID 
Revocation Date 
1/19/2021 1:D3AM 
Effective Revocation Date 
1/19/2021 1:02AM 
Revocation Reason 
Unspecified 
Requester Name 
SEMIH\administr... 
Binary](https://www.semihuykan.com.tr/wp-content/uploads/2021/01/machine-generated-alternative-text-certsrv-certi-1.png)

Her CA in bir CRL URL I vardır. Buradan daha önce dağıtılan sertifikalar revoke edilmiş mi kontrol edilir.

Remove edilen sertifikalarda AD CS te publish edilir.
![Machine generated alternative text:
certsrv [Certification Authority I\Revoked Certificates] 
File Action View Help 
Certification Authority (Local) 
semih-DC01-CA-1 
Revoked C 
Request ID 
Revocation Date 
19/2021 
Publish 
Effective Revocation Date 
1/19/2021 1:02AM 
Revocation Reason 
Uns pecfied 
Requester Name 
SEMIH\administr... 
Sinai 
All Tasks 
Issued Ce 
Pending R 
Failed Req 
Refresh 
Certificate 
Export List... 
Properties 
Help](https://www.semihuykan.com.tr/wp-content/uploads/2021/01/machine-generated-alternative-text-certsrv-certi-2.png)
![Machine generated alternative text:
certsrv - [Certification Authority -CA-IlRevoked Certificates] 
File Action View Help 
Certification Authority (Local) 
semih-DC01-CA-1 
es 
Revoked Certificat 
Issued Certificates 
Pending Requests 
Failed Requests 
Certificate Templates 
Request ID 
Revocation Date 
1/19/2021 1:D3AM 
Effective Revocation Date 
1/19/2021 1:02AM 
Revocation Reason 
Uns fied 
Requester Name 
SEMIH\administr... 
Binary Certificate 
-BEGIN CERTI.. 
Certificat 
Basic EFS 
Publish CRL 
The latest published Certificate Revocation Ljst (CRL)is Qill valid Clients maynot 
receive a new CRL until after their current one expires 
Type of CRL to publish 
@ New CRL 
Issues a complete CRL. which contains upkozate revocation information 
for the CA 
C) Delta CRL only 
Issues an abbreviated version of the CRL. which contains only the updates to 
the CRL that have been made since the last time t was published](https://www.semihuykan.com.tr/wp-content/uploads/2021/01/machine-generated-alternative-text-certsrv-cer-6.png)
AD CS e web browser üzerinden http://adcsosname-veyaipadresi/certsrv ile erişilir. Bir sertifika requestinde de bulunabilir ayrıca CA Sertifikası da download edilebilir.
User sertifikası alınabildiği gibi ayrıca publish edilen sertifikalar da AD CS ten alınabilir.




Microsoft IIS üzerinden aşağıdaki adımlarla bir sertifika rewuesti yapılır. Daha sonra bu request CA üzerinden alınıp IIS teki Compate Certificate Request ile sonlandırılır.
Ayrıca bu request ile public certificate authority lerde sertifika alma ve import etme ile aynı yöntemdir.








