cloudflare / cloudflare/cfssl

auth_key not working on default profile

Open
#1,093 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
9.5k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hey, it seems for me that they "auth_key" is not working when supplied in the default profile. When running `cfssl serve` it throws a warning for the /sign endpoint.
Note: I'm using cfssl version 1.4.1 installed via homebrew.

The warning that is shown:
```
2020/04/06 12:27:32 [WARNING] endpoint 'sign' is disabled: {"code":5200,"message":"Invalid or unknown policy"}
```

Here is the config file I'm using:
```
{
"signing": {
"default": {
"auth_key": "key1",
"expiry": "8760h",
"crl_url": "http://localhost:8888/api/v1/cfssl/crl",
"ocsp_url": "http://localhost:8889",
"usages": [
"signing",
"key encipherment",
"server auth",
"client auth"
]
},
"profiles": {
"intermediate": {
"auth_key": "key1",
"expiry": "43800h",
"usages": [
"cert sign",
"crl sign"
],
"ca_constraint": {
"is_ca": true,
"max_path_len": 0,
"max_path_len_zero": true
}
},
"ocsp": {
"auth_key": "key1",
"expiry": "43800h",
"usages": [
"digital signature",
"ocsp signing"
]
},
"server": {
"auth_key": "key1",
"expiry": "8760h",
"usages": [
"signing",
"key encipherment",
"server auth",
"client auth"
]
},
"client": {
"auth_key": "key1",
"expiry": "8760h",
"usages": [
"signing",
"key encipherment",
"client auth",
"email protection"
]
}
}
},
"auth_keys": {
"key1": {
"type": "standard",
"key": "E50195DC233B5689D162472009476BFD"
}
}
}
```

If I remove the "auth_key" from the default profile it works. But then the default profile does not require any authentication and therefore can be used without a key.
```
2020/04/06 12:29:55 [INFO] endpoint '/api/v1/cfssl/scan' is enabled
```

As a workaround I've been removing all usages from the default profile so it can't be used to sign certificates. In both cases, with or without key on default profile, the other profiles work without issues.

Contributor guide

Open the contributing guide

Research direction

Reproduce the /sign warning with the supplied cfssl serve configuration, then trace how auth_key is validated for the default signing profile. Confirm the default profile can require authentication without disabling the endpoint, while the other profiles continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authentication, backend, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.