aws-samples / aws-samples/aws-device-lobby
Device certificates are created with extra permissions
- Dominant language
- JavaScript
- Stars
- 22
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
After pki/create-thing-creds.sh creates IoT device certificate it contains extra privileges:
```
X509v3 Basic Constraints: critical
CA:TRUE, pathlen:2
```
and
```
X509v3 Key Usage: critical
Digital Signature, Certificate Sign, CRL Sign
```
It should be
```
X509v3 Basic Constraints: critical
CA:FALSE
```
and
```
X509v3 Key Usage: critical
Digital Signature
```
I think it because wrong int1CA.cnf is used in the command:
```
openssl ca -batch -config int1CA.cnf -extensions v3_req -days 365 -md sha256 -in ../devices/$THING_NAME.csr.pem -out ../devices/$THING_NAME.crt.pem
```
Solution: provide another openssl configuration file to generate certificate for a device. That config file should miss CA:TRUE and Certificate Sign, CRL Sign rights.
Contributor guide
Research direction
Start in pki/create-thing-creds.sh and inspect the openssl ca command that uses int1CA.cnf with the v3_req extension. Add or select a device certificate configuration that produces CA:FALSE and only Digital Signature, then verify the generated certificate's Basic Constraints and Key Usage with the displayed certificate inspection command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- embedded-iot, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100