{"id":22220881,"url":"https://github.com/nokia/tpmcourse","last_synced_at":"2025-04-11T11:23:52.812Z","repository":{"id":41173426,"uuid":"255581582","full_name":"nokia/TPMCourse","owner":"nokia","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-05T05:51:04.000Z","size":816,"stargazers_count":164,"open_issues_count":3,"forks_count":38,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-25T07:42:02.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause-clear","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nokia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-04-14T10:43:33.000Z","updated_at":"2025-03-22T18:04:48.000Z","dependencies_parsed_at":"2024-03-23T19:45:26.274Z","dependency_job_id":null,"html_url":"https://github.com/nokia/TPMCourse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nokia%2FTPMCourse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nokia%2FTPMCourse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nokia%2FTPMCourse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nokia%2FTPMCourse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nokia","download_url":"https://codeload.github.com/nokia/TPMCourse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248382454,"owners_count":21094559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T23:10:46.570Z","updated_at":"2025-04-11T11:23:52.785Z","avatar_url":"https://github.com/nokia.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nokia TPM Course\n\nThis is a short course on getting started with understanding how a TPM 2.0 works. In this course we explain a number of the features of the TPM 2.0 through the TPM2_Tools through examples and, optionally, exercises.\n\nWhile this course is designed to be used as part of a tutorial session it can be used stand alone and also as an easy reference.\n\n(C)2022 Nokia\n\n## Installation\n\nThere are other ways to complete the install, other ways to do each step, but this is common and clear.\n\nStart your install at a terminal window on a linux system.  If you are using a Windows computer, create a linux VM (possibly using VirtualBox), such as the latest Ubuntu system, and begin your install from the linux VM command line.\n\nWhile in your home directory, install the TPMCourse in your linux VM by using git.  The command is\n\n```bash\ngit clone https://github.com/nokia/TPMCourse.git\n```\n\nGit will clone (copy) files from the remote TPMCourse repository on the Nokia github to your linux system.  However, your linux system may not yet have the git tool.  If you don't have it, you will need to install it in order to complete the git clone. (The linux system should tell you how to install it as part of its negative response to your initial attempt.)  \nhttps://git-scm.com/book/en/v2/Getting-Started-Installing-Git\n\nWhen the clone is complete, your home directory should have a new TPMCourse sub-directory.  Move to this directory on your linux system and list the files and directories. It should look like the Nokia github TPMCourse repository from which you copied, including an alpine directory, a docs directory, a src directory, a license file and a README file.  Now you are ready to build the container that will host the TPM simulator, the TPM tools, and the alpine linux operating system which is a simple secure linux that will always have the libraries and configurations needed for this course. \n\nNote, for now, let's assume you are going to work on a TPM Simulator, not an actual TPM in your system hardware.  This course could be adapted to work with a real TPM, but that will not be addressed here.  The TPM simulator is convenient for learning, because if you mess up something, only the simulator is affected and the simulator can easily be restored (by restart). \n\nTo build the TPMCourse container, docker must be available on your linux VM.  If you enter the docker build command below and it starts the 29 step build, you are on your way.  If it fails, the system will provide the instructions on how to install docker on your system.  After docker install, you may receive \"Got permission denied while trying to connect to the Docker daemon socket...\".  If so, you have a permission issue.  See \"How to Fix Docker Permission Denied Error on Ubuntu\":\nhttps://linuxhandbook.com/docker-permission-denied/#:~:text=deal%20with%20it.-,Fix%201%3A%20Run%20all%20the%20docker%20commands%20with%20sudo,the%20Docker%20daemon%20socket'%20anymore.\n\n\n```bash\ncd alpine\ndocker build -t tpmcourse:latest .\n```\n\nNOTE: the above might need to be run as sudo, eg:\n\n```bash\nsudo docker build -t tpmcourse:latest .\n```\n\n\nTo see how the build executes, see the Dockerfile in the alpine directory which when built downloads the various libraries and tools to interact with a TPM and also the IBM TPM Simulator\n\nIf all works successfully, after about 29 stages, you can type the following command to run the container in interactive mode.\n\n```bash\ndocker run -it tpmcourse:latest\n```\n\nNOTE: the above might need to be run as sudo, eg:\n\n```bash\nsudo docker run -it tpmcourse:latest\n```\n\n\nThe following will be printed out. This tells us that the TPM simulator is runnig on ports 2321 and 2322 and at the end we have a command line prompt. We're running the `ash` command line interpreter.\n\n```\n/ # LIBRARY_COMPATIBILITY_CHECK is ON\nManufacturing NV state...\nSize of OBJECT = 2600\nSize of components in TPMT_SENSITIVE = 1096\n    TPMI_ALG_PUBLIC                 2\n    TPM2B_AUTH                      66\n    TPM2B_DIGEST                    66\n    TPMU_SENSITIVE_COMPOSITE        962\nStarting ACT thread...\nTPM command server listening on port 2321\nPlatform server listening on port 2322\nCommand IPv4 client accepted\nPlatform IPv4 client accepted\n^C\n/ # \n```\n\nNOTE: sometimes the `#`` prompt doesn't appear...hit enter, the it should.\n\nTo test type the TPM command `tpm2_getrandom` to obtain a random number:\n\n```bash\ntpm2_getrandom 32 --hex\ne0b2c1bb096a81032ec1114cc504795ee77c7cc3d159e76165801b38d892296f\n/ # \n```\n\nNB: you should get a different random number that we do above!\n\n## Caveats\n\nFirstly, you can run everything here against your own, real, hardware (or firmware) TPM - there are some commands which might be irreperable changes - these are clearly noted. We are NOT responsible for any actions resulting in the bricking or worse of your (or someone else's) computer.\n\nThe supplied docker file is the best way to explore things in safety...if you break something you can just restart the container :-)\n\nSecondly, sometimes parameters to commands change - we use the latest tpm2_tools and sometimes things do change and the course might not be fully updated. In this case, either make an issue in github or make a fork, change and then a pull request - your contributions either way will be very much appreciated.\n\n\n## Course Material\n\nAll the course material is in the [./docs](./docs) directory. Read the `STARTHERE.md` file first and then work through the documents in order. You can find a set of files that explain different TPM concepts and contain code examples you can use with the container to get familiarized with TPM and its use cases.\n\n\n## Technologies\n\nSoftware needed for the actual end functionality is the TCG TPM2 Software Stack\n(TSS2) and the IBM TPM simulator.\n\n*  [TPM2-tss](https://github.com/tpm2-software/tpm2-tss) BSD-2-Clause\n*  [TPM2-abrmd](https://github.com/tpm2-software/tpm2-abrmd) BSD-2-Clause\n*  [TPM2-tools](https://github.com/tpm2-software/tpm2-tools) BSD-3-Clause\n*  [IBM simulator](./licenses/LICENSE-ibm-tpm-simulator)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnokia%2Ftpmcourse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnokia%2Ftpmcourse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnokia%2Ftpmcourse/lists"}