Usually I set "AnyPurpose" on Root CA (meaning this is root and can issue certificates to any other intermediate or sub CA), and then, when issuing the intermediates CA I set the restrictions...
My Root CA have:
- AnyPolice 2.5.29.32.0,
- CA:True 2.5.4.37,
- AnyPurpose 2.5.29.15,
- DigitalSignature 2.5.4.37.3,
- CRL Distribution Points 2.5.29.31,
On my intermediate TLS CA for Example I set:
- Web ServerAuth TLS 1.3.6.1.5.5.7.3.1,
- Web ClientAuth 1.3.6.1.5.5.7.3.2
This is limit the TLS CA from inheritance from all attributes from Root CA (the restrictive OIDs apllied here will allow only sign TLS certificates and with pathlen:0 I will forbidden sub CAs).
Everything depends how you set your PKI infrastructure.
On my network I do one intermediate CA per purpose, example:
- Intermediate CA for Emails
- Intermediate CA for TLS
- Intermediate CA for Software
- Intermediate CA for Identity
- Intermediate CA for Components
This way if there an problem with an mail certificate, I only need revoke the Email CA while all other Intermediate CA are fine.
Big Certification Authorities have for example an dedicated intermediate CA to EV.
Note: This is for personal PKI, if you wish do something following RFCs and best practices like big Certification Authorities do, then there a lot of extra stpes, like include much more OIDs and setup all them...
For example you can read some of the standards on this link:
https://cabforum.org/wp-content/uploads/Baseline_Requirements_V1.pdf
Another example, for EV certificates there a lot of extra steps setup OIDs:
- Domain Validated 2.23.140.1.2.1
- Organization Validated 2.23.140.1.2.2
And since my setup do not need those, I don`t spended my time searching and testing the necessary OIDs for get this working