|
| 1 | +--- |
| 2 | +title: Getting Started |
| 3 | +layout: page |
| 4 | +permalink: /trustify/getting-started |
| 5 | +parent: Trustify Docs |
| 6 | +nav_order: 1 |
| 7 | +--- |
| 8 | + |
| 9 | +# Getting Started |
| 10 | + |
| 11 | +This guide will walk you through the process of setting up Trustify on your |
| 12 | +local machine and analyzing your first Software Bill of Materials (SBOM). We'll |
| 13 | +be using the pre-built binaries, which is the quickest and easiest way to get |
| 14 | +started. |
| 15 | + |
| 16 | +## Prerequisites |
| 17 | + |
| 18 | +You don't need any special tools to run Trustify. You'll just need a way to |
| 19 | +download a file and run it from your terminal. We'll use `curl` in this guide |
| 20 | +for downloading and interacting with the API, but you can use any similar tool. |
| 21 | + |
| 22 | +## 1. Download Trustify |
| 23 | + |
| 24 | +The easiest way to get Trustify is to download the latest pre-built binary for |
| 25 | +your operating system from the |
| 26 | +[Trustify Releases](https://github.com/guacsec/trustify/releases) page. |
| 27 | + |
| 28 | +Look for the `trustd-pm` binaries in the "Assets" section of the latest release. |
| 29 | +Download the one that matches your system (e.g., |
| 30 | +`trustd-pm-...-x86_64-unknown-linux-gnu` for Linux). |
| 31 | + |
| 32 | +Once downloaded, you may need to make the file executable. In your terminal, |
| 33 | +run: |
| 34 | + |
| 35 | +```shell |
| 36 | +chmod +x /path/to/your/downloaded/trustd-pm |
| 37 | +``` |
| 38 | + |
| 39 | +## 2. Run Trustify |
| 40 | + |
| 41 | +Now, you can start Trustify in "Personal Machine" (PM) mode. This is a |
| 42 | +lightweight mode that's perfect for local use. It will create a local database |
| 43 | +in a `.trustify/` directory in your current folder. |
| 44 | + |
| 45 | +To start Trustify, simply run the binary from your terminal: |
| 46 | + |
| 47 | +```shell |
| 48 | +./path/to/your/downloaded/trustd-pm |
| 49 | +``` |
| 50 | + |
| 51 | +You should see some log output, and the server will be running in the |
| 52 | +background. |
| 53 | + |
| 54 | +## 3. Access the Trustify UI and API |
| 55 | + |
| 56 | +With Trustify running, you can now access its features through your web browser |
| 57 | +or via the REST API. |
| 58 | + |
| 59 | +- **To use the GUI**, navigate to: |
| 60 | + [http://localhost:8080](http://localhost:8080) |
| 61 | +- **To use the REST API**, navigate to: |
| 62 | + [http://localhost:8080/openapi/](http://localhost:8080/openapi/) |
| 63 | + |
| 64 | +Take a moment to explore the web UI. You'll see that it's currently empty |
| 65 | +because we haven't ingested any data yet. |
| 66 | + |
| 67 | +## 4. Ingest Your First SBOM |
| 68 | + |
| 69 | +Trustify is most useful when it has data to analyze. Let's upload your first |
| 70 | +SBOM. You can use any CycloneDX or SPDX JSON file you have. If you don't have |
| 71 | +one handy, you can use an example from the Trustify repository. |
| 72 | + |
| 73 | +To upload an SBOM from a local file, run the following command in your terminal: |
| 74 | + |
| 75 | +```shell |
| 76 | +curl -X POST --data-binary @/path/to/your/sbom.json -H "Content-Type: application/json" http://localhost:8080/api/v2/sbom |
| 77 | +``` |
| 78 | + |
| 79 | +If the upload is successful, you'll see a confirmation message. Now, if you |
| 80 | +refresh the Trustify UI in your browser, you should see the SBOM you just |
| 81 | +uploaded. |
| 82 | + |
| 83 | +## 5. Ingest a Dataset |
| 84 | + |
| 85 | +While uploading individual SBOMs is useful, you can also ingest entire datasets |
| 86 | +of SBOMs and security advisories at once. The Trustify repository includes |
| 87 | +several example datasets. Let's download and ingest `ds3`, which contains a |
| 88 | +collection of Red Hat advisories and related SBOMs. |
| 89 | + |
| 90 | +1. **Download the dataset**: |
| 91 | + |
| 92 | + ```shell |
| 93 | + curl -L -o ds3.zip https://github.com/guacsec/trustify/raw/main/etc/datasets/ds3.zip |
| 94 | + ``` |
| 95 | + |
| 96 | +2. **Upload the dataset to Trustify**: |
| 97 | + ```shell |
| 98 | + curl -X POST --data-binary @ds3.zip -H "Content-Type: application/zip" http://localhost:8080/api/v2/dataset |
| 99 | + ``` |
| 100 | + |
| 101 | +After the upload is complete, refresh the Trustify UI. You will now see a much |
| 102 | +richer set of data to explore, including advisories and multiple SBOMs. |
| 103 | + |
| 104 | +## 6. Next Steps |
| 105 | + |
| 106 | +Congratulations! You've successfully set up Trustify and ingested your first |
| 107 | +SBOM. From here, you can start to explore the power of Trustify: |
| 108 | +
|
| 109 | +- **Upload more SBOMs and security advisories** to build a comprehensive picture |
| 110 | + of your software. |
| 111 | +- **Explore the relationships** between your software components and known |
| 112 | + vulnerabilities in the UI. |
| 113 | +- **Use the REST API** to automate your software supply chain security |
| 114 | + workflows. |
| 115 | +
|
| 116 | +For more advanced topics, such as configuring authentication or setting up data |
| 117 | +importers, please refer to the rest of our documentation. |
| 118 | +
|
| 119 | +--- |
| 120 | +
|
| 121 | +### Alternative for Developers: Building from Source |
| 122 | +
|
| 123 | +If you are a developer and want to build Trustify from source, you'll need a |
| 124 | +recent version of Rust and `cargo`. |
| 125 | + |
| 126 | +1. **Clone the repository**: |
| 127 | + |
| 128 | + ```shell |
| 129 | + git clone https://github.com/guacsec/trustify.git |
| 130 | + cd trustify |
| 131 | + ``` |
| 132 | + |
| 133 | +2. **Run Trustify**: |
| 134 | + ```shell |
| 135 | + AUTH_DISABLED=true cargo run --bin trustd |
| 136 | + ``` |
| 137 | + |
| 138 | +This will build and run Trustify in the same "PM mode" as the binary. |
0 commit comments