aws-samples / aws-samples/aws-device-lobby

Device certificates are created with extra permissions

Open
#7 2 comments 1 reaction 0 assignees View on GitHub
enhancement
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.