Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update statement creation to rev a4645e4bc3e78ad5cfd9f8347c7e0ac8267c1079 of SCITT arch and implement verification of statements #39

Merged
merged 16 commits into from
Mar 26, 2024

Conversation

johnandersen777
Copy link

@johnandersen777 johnandersen777 commented Nov 10, 2023

Related: ietf-wg-scitt/draft-ietf-scitt-architecture@a4645e4

Ping @OR13, @aj-stein-nist, @fournet. Does this look correct for the notary?

$ ssh-keygen -q -f /dev/stdout -t ecdsa -b 384 -N '' <<<y | python -c 'import sys; from cryptography.hazmat.primitives import serialization; print(serialization.load_ssh_private_key(sys.stdin.buffer.read(), password=None).private_bytes(encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.PKCS8, encryption_algorithm=serialization.NoEncryption()).decode().rstrip())' | scitt-emulator client create-claim --issuer did:web:example.com --content-type application/json --payload '{"sun": "yellow"}' --out claim.cose --subject "ssh-keygen -q -f /dev/stdout -t ecdsa -b 384 -N '' <<<y | python -c 'import sys; from cryptography.hazmat.primitives import serialization; print(serialization.load_ssh_private_key(sys.stdin.buffer.read(), password=None).private_bytes(encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.PKCS8, encryption_algorithm=serialization.NoEncryption()).decode().rstrip())'" --private-key-pem /dev/stdin
$ python -m cbor2.tool claim.cose 
{"CBORTag:18": ["\\xa5\u00018\"\u0004X+N9gTuAlOwdFk_iZM-MN9gVGwhVhdePEefkVE2iHUa_8\u000eY\u0002F҄D\\xa1\u00018\"\\xa1\u0004X+N9gTuAlOwdFk_iZM-MN9gVGwhVhdePEefkVE2iHUa_8Y\u0001\\xab\\xa5\u0001sdid:web:example.com\u0002y\u0001ssh-keygen -q -f /dev/stdout -t ecdsa -b 384 -N '' <<<y | python -c 'import sys; from cryptography.hazmat.primitives import serialization; print(serialization.load_ssh_private_key(sys.stdin.buffer.read(), password=None).private_bytes(encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.PKCS8, encryption_algorithm=serialization.NoEncryption()).decode().rstrip())'\u0004\u001aeO\\x89\u0015\u0005\u001aeO{\u0005\u0006\u001aeO{\u0005X`\\xf0E\\xbd\\xf1\\xe0\\x8c8\\x8b\\xbd\u001b\u0016\\xdb\\xdc\u0003ؠ\\xa8\\x8e\\xacE=ƅ\u0012\\\\xa6=\\xa1\\xea\\xce\\xdd\\xdb\\xd9\\xf2\\x9f]\\xa7\\xff\\x84a\\xf9JŚ\\xca[7\\xcc\u001b\u0014\\xe6\\xcd\\xee\\xd1Q\\x93\\x860\n~Ӌ\\xeb\\x8dn\\x9c\u0004ˮ\\xf1\\xe9)E\\x8d|8\\xecnBs\u0001\\x87s\\xb2\r\\x8a&`;B\\xf5\\xb2_>\\xca\u0019\u0001\\x89\\xa4kregister_by\u0019\u0003\\xe8ksequence_no\u0000kissuance_ts\u0019\u0003\\xe8ino_replay\\xf6\u0003papplication/json", {"395": "TBD", "394": null}, "{\"sun\": \"yellow\"}", "&QED\\xa4:~\\x89\\xcdO3W\\xda\u0006g\\xf0\\x8f\\xcc_QĦ\u0014\\xe1\\xc6\\xe0\n^\u0003\\xa7V㹹k\\xaa\\x9e\\x9e\\xd0r\\xe6\\xfe\\xaekҹ\\xe2\\xf9\\xcfԴ\\xeb4\\xed\\xd3H\\xf0g\u0019\\xaa^\\xe1Y\\xd6\\xc4\u000b0\\xdc\\xd8\\xc8\u001d$\u0017\u0011\\xdf\u0003\\x85\\xa0\\xa5\rY\\xb7\u0001\\xd6MX\u000f@\\x86Y;\\xb3\u0003K\u0005\u0005"]}
$ xxd claim.cose 
00000000: d284 5902 c8a5 0138 2204 582b 4e39 6754  ..Y....8".X+N9gT
00000010: 7541 6c4f 7764 466b 5f69 5a4d 2d4d 4e39  uAlOwdFk_iZM-MN9
00000020: 6756 4777 6856 6864 6550 4565 666b 5645  gVGwhVhdePEefkVE
00000030: 3269 4855 615f 380e 5902 46d2 8444 a101  2iHUa_8.Y.F..D..
00000040: 3822 a104 582b 4e39 6754 7541 6c4f 7764  8"..X+N9gTuAlOwd
00000050: 466b 5f69 5a4d 2d4d 4e39 6756 4777 6856  Fk_iZM-MN9gVGwhV
00000060: 6864 6550 4565 666b 5645 3269 4855 615f  hdePEefkVE2iHUa_
00000070: 3859 01ab a501 7364 6964 3a77 6562 3a65  8Y....sdid:web:e
00000080: 7861 6d70 6c65 2e63 6f6d 0279 017f 7373  xample.com.y..ss
00000090: 682d 6b65 7967 656e 202d 7120 2d66 202f  h-keygen -q -f /
000000a0: 6465 762f 7374 646f 7574 202d 7420 6563  dev/stdout -t ec
000000b0: 6473 6120 2d62 2033 3834 202d 4e20 2727  dsa -b 384 -N ''
000000c0: 203c 3c3c 7920 7c20 7079 7468 6f6e 202d   <<<y | python -
000000d0: 6320 2769 6d70 6f72 7420 7379 733b 2066  c 'import sys; f
000000e0: 726f 6d20 6372 7970 746f 6772 6170 6879  rom cryptography
000000f0: 2e68 617a 6d61 742e 7072 696d 6974 6976  .hazmat.primitiv
00000100: 6573 2069 6d70 6f72 7420 7365 7269 616c  es import serial
00000110: 697a 6174 696f 6e3b 2070 7269 6e74 2873  ization; print(s
00000120: 6572 6961 6c69 7a61 7469 6f6e 2e6c 6f61  erialization.loa
00000130: 645f 7373 685f 7072 6976 6174 655f 6b65  d_ssh_private_ke
00000140: 7928 7379 732e 7374 6469 6e2e 6275 6666  y(sys.stdin.buff
00000150: 6572 2e72 6561 6428 292c 2070 6173 7377  er.read(), passw
00000160: 6f72 643d 4e6f 6e65 292e 7072 6976 6174  ord=None).privat
00000170: 655f 6279 7465 7328 656e 636f 6469 6e67  e_bytes(encoding
00000180: 3d73 6572 6961 6c69 7a61 7469 6f6e 2e45  =serialization.E
00000190: 6e63 6f64 696e 672e 5045 4d2c 2066 6f72  ncoding.PEM, for
000001a0: 6d61 743d 7365 7269 616c 697a 6174 696f  mat=serializatio
000001b0: 6e2e 5072 6976 6174 6546 6f72 6d61 742e  n.PrivateFormat.
000001c0: 504b 4353 382c 2065 6e63 7279 7074 696f  PKCS8, encryptio
000001d0: 6e5f 616c 676f 7269 7468 6d3d 7365 7269  n_algorithm=seri
000001e0: 616c 697a 6174 696f 6e2e 4e6f 456e 6372  alization.NoEncr
000001f0: 7970 7469 6f6e 2829 292e 6465 636f 6465  yption()).decode
00000200: 2829 2e72 7374 7269 7028 2929 2704 1a65  ().rstrip())'..e
00000210: 4f89 1505 1a65 4f7b 0506 1a65 4f7b 0558  O....eO{...eO{.X
00000220: 60f0 45bd f1e0 8c38 8bbd 1b16 dbdc 03d8  `.E....8........
00000230: a0a8 8eac 453d c685 125c a63d a1ea cedd  ....E=...\.=....
00000240: dbd9 f29f 5da7 ff84 61f9 4ac5 9aca 5b37  ....]...a.J...[7
00000250: cc7f 1b14 e6cd eed1 5193 8630 0a7e d38b  ........Q..0.~..
00000260: eb8d 6e9c 04cb aef1 e929 458d 7c38 ec6e  ..n......)E.|8.n
00000270: 4273 0187 73b2 0d8a 2660 3b42 f5b2 5f3e  Bs..s...&`;B.._>
00000280: ca19 0189 a46b 7265 6769 7374 6572 5f62  .....kregister_b
00000290: 7919 03e8 6b73 6571 7565 6e63 655f 6e6f  y...ksequence_no
000002a0: 006b 6973 7375 616e 6365 5f74 7319 03e8  .kissuance_ts...
000002b0: 696e 6f5f 7265 706c 6179 f603 7061 7070  ino_replay..papp
000002c0: 6c69 6361 7469 6f6e 2f6a 736f 6ea2 1901  lication/json...
000002d0: 8b63 5442 4419 018a f651 7b22 7375 6e22  .cTBD....Q{"sun"
000002e0: 3a20 2279 656c 6c6f 7722 7d58 6026 5145  : "yellow"}X`&QE
000002f0: 44a4 3a7e 89cd 4f33 57da 0667 f08f cc5f  D.:~..O3W..g..._
00000300: 51c4 a614 e1c6 e00a 5e03 a756 e3b9 b96b  Q.......^..V...k
00000310: aa9e 9ed0 72e6 feae 6bd2 b9e2 f9cf d4b4  ....r...k.......
00000320: eb34 edd3 48f0 6719 aa5e e159 d6c4 0b30  .4..H.g..^.Y...0
00000330: dcd8 c81d 2417 11df 0385 a0a5 0d59 b701  ....$........Y..
00000340: d64d 580f 4086 593b b303 4b05 05         [email protected];..K..
  • TODO
    • Verify did:jwk issuers
    • Verify did:web issuers
      • Reuse OIDC test jwks endpoint for statement CWT issuer key discovery
        • For docs use issuer to get odic well-known to find jwks uri
      • Update jsonschemavalidator to load keys from https://github.com/username.keys
    • Ready for review
  • Future
    • Remove use of did:web
    • Add note do docs saying we can use https://github.com/tpm2-software/tpm2-pkcs11 to bind the keys to a TPM owned by the developer.
    • Should we use audience on CWT? I think no, just want to make sure we've documented why thought if not. No usage makes sense to me because we don't know the intended audience, it could be federated into multiple TS

@johnandersen777 johnandersen777 changed the title scitt: create_claim: Update to rev a4645e4bc3e78ad5cfd9f8347c7e0ac8267c1079 of SCITT arch DRAFT: scitt: create_claim: Update to rev a4645e4bc3e78ad5cfd9f8347c7e0ac8267c1079 of SCITT arch Nov 10, 2023
@johnandersen777 johnandersen777 marked this pull request as draft November 10, 2023 15:46
@johnandersen777 johnandersen777 marked this pull request as draft November 10, 2023 15:46
@johnandersen777 johnandersen777 changed the title DRAFT: scitt: create_claim: Update to rev a4645e4bc3e78ad5cfd9f8347c7e0ac8267c1079 of SCITT arch scitt: create_claim: Update to rev a4645e4bc3e78ad5cfd9f8347c7e0ac8267c1079 of SCITT arch Nov 10, 2023
@OR13
Copy link
Contributor

OR13 commented Nov 10, 2023

I realized that .cose is not a valid file extension, I think we should be using .cbor

@OR13
Copy link
Contributor

OR13 commented Nov 10, 2023

I updated some of our examples but it's possible there are leftovers I missed elsewhere

@aj-stein-nist
Copy link
Contributor

I'm new enough @pdxjohnny that I need to reread the CBOR and work with the group on this one.

OR13
OR13 previously approved these changes Nov 10, 2023
OR13
OR13 previously approved these changes Mar 12, 2024
@OR13
Copy link
Contributor

OR13 commented Mar 12, 2024

This PR will be merged unless there are objections in 2 weeks.

SteveLasker
SteveLasker previously approved these changes Mar 12, 2024
Copy link
Contributor

@SteveLasker SteveLasker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @pdxjohnny
LGTM

@johnandersen777
Copy link
Author

Thanks guys!

… statements (via receipts list)

Signed-off-by: John Andersen <[email protected]>
@johnandersen777 johnandersen777 dismissed stale reviews from SteveLasker and OR13 via fffafa6 March 26, 2024 20:36
Helpful for OIDC audience

Signed-off-by: John Andersen <[email protected]>
@johnandersen777
Copy link
Author

johnandersen777 commented Mar 26, 2024

@OR13 @SteveLasker I pushed a couple minor commits over top since hopefully today's the day, I'm in progress on a relying party OIDC issuer based off transparent statement for BOM to make workload identities for AI agents and those last two make it a little cleaner, hope that's alright. Thank you again for the reviews!

Related:

Copy link
Contributor

@SteveLasker SteveLasker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SteveLasker SteveLasker merged commit fa1169d into scitt-community:main Mar 26, 2024
3 checks passed
@johnandersen777
Copy link
Author

Thank you guys!

johnandersen777 pushed a commit to johnandersen777/scitt-api-emulator that referenced this pull request Mar 26, 2024
johnandersen777 pushed a commit to johnandersen777/scitt-api-emulator that referenced this pull request Mar 26, 2024
@johnandersen777
Copy link
Author

There were a couple issues in the CI jobs which trigger on on.push and not pull request which I'd forgotten to update. Pull requests to fix those here:

SteveLasker pushed a commit that referenced this pull request Mar 27, 2024
* ci: notarize: Add --subject to statement creation

Related: #39

Signed-off-by: John Andersen <[email protected]>

* ci: notarize: on: pull request: Test against main PRs

Related: #39

Signed-off-by: John Andersen <[email protected]>

* Revert "ci: notarize: on: pull request: Test against main PRs"

Run actions/github-script@v6
Error: Error message: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable
    at Function.<anonymous> (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:585:23)
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:522:71
    at new Promise (<anonymous>)
    at __webpack_modules__.8041.__awaiter (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:518:12)
    at Function.getIDToken (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:571:16)
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:421:46)
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:133:71
    at new Promise (<anonymous>)
Error: Unhandled error: Error: Error message: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable

This reverts commit d4ea9ea.

---------

Signed-off-by: John Andersen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants