|
| 1 | +# Security and Supply Chain |
| 2 | + |
| 3 | +This document describes the security measures and supply chain considerations for appimagetool. |
| 4 | + |
| 5 | +## Compiler Security Flags |
| 6 | + |
| 7 | +The project is built with comprehensive compiler warnings enabled to catch potential bugs and undefined behavior: |
| 8 | + |
| 9 | +- `-Wall`: Enable all common warnings |
| 10 | +- `-Wextra`: Enable extra warnings |
| 11 | +- `-Wconversion`: Warn about implicit type conversions that may alter values |
| 12 | +- `-Werror`: Treat warnings as errors to ensure they are addressed |
| 13 | + |
| 14 | +These flags help ensure code quality and catch potential security issues at compile time. |
| 15 | + |
| 16 | +## Download Verification |
| 17 | + |
| 18 | +All external dependencies downloaded during the build process are verified using SHA256 hashes: |
| 19 | + |
| 20 | +### Runtime Binaries |
| 21 | + |
| 22 | +The AppImage runtime binaries are downloaded from https://github.com/AppImage/type2-runtime/releases and verified with SHA256 hashes for each architecture: |
| 23 | + |
| 24 | +- `x86_64`: e70ffa9b69b211574d0917adc482dd66f25a0083427b5945783965d55b0b0a8b |
| 25 | +- `i686`: 3138b9f0c7a1872cfaf0e32db87229904524bb08922032887b298b22aed16ea8 |
| 26 | +- `aarch64`: c1b2278cf0f42f5c603ab9a0fe43314ac2cbedf80b79a63eb77d3a79b42600c5 |
| 27 | +- `armhf`: 6704e63466fa53394eb9326076f6b923177e9eb48840b85acf1c65a07e1fcf2b |
| 28 | + |
| 29 | +The build process prints the hash and size of the downloaded runtime for transparency. |
| 30 | + |
| 31 | +### Build Tools |
| 32 | + |
| 33 | +External build tools are also verified: |
| 34 | + |
| 35 | +- **mksquashfs 4.6.1**: SHA256 hash `9c4974e07c61547dae14af4ed1f358b7d04618ae194e54d6be72ee126f0d2f53` |
| 36 | +- **zsyncmake 0.6.2**: SHA256 hash `0b9d53433387aa4f04634a6c63a5efa8203070f2298af72a705f9be3dda65af2` (already verified) |
| 37 | +- **desktop-file-validate 0.28**: SHA256 hash `30355df75de31a5c5a2e87fab197fcd77c0a8d1317e86e0dfe515eb0f94f29f8` |
| 38 | + |
| 39 | +## Build Provenance Attestation |
| 40 | + |
| 41 | +The GitHub Actions workflow generates cryptographically signed build provenance attestations using GitHub's attestation service. These attestations: |
| 42 | + |
| 43 | +- Prove that the artifacts were built by the official GitHub Actions workflow |
| 44 | +- Include the full build context (commit SHA, workflow, runner environment) |
| 45 | +- Can be verified by downstream users using the GitHub CLI or API |
| 46 | + |
| 47 | +To verify an AppImage artifact: |
| 48 | + |
| 49 | +```bash |
| 50 | +gh attestation verify appimagetool-x86_64.AppImage --owner AppImage |
| 51 | +``` |
| 52 | + |
| 53 | +## Sanitizer Support |
| 54 | + |
| 55 | +For development and testing, the build system supports AddressSanitizer (ASAN) and UndefinedBehaviorSanitizer (UBSAN): |
| 56 | + |
| 57 | +```bash |
| 58 | +cmake -DENABLE_SANITIZERS=ON /path/to/source |
| 59 | +make |
| 60 | +``` |
| 61 | + |
| 62 | +These sanitizers help detect: |
| 63 | +- Memory errors (use-after-free, buffer overflows, memory leaks) |
| 64 | +- Undefined behavior (integer overflow, null pointer dereferences, etc.) |
| 65 | + |
| 66 | +Note: Sanitizers cannot be used with static builds and are intended for development/testing only. |
| 67 | + |
| 68 | +## Updating Hashes |
| 69 | + |
| 70 | +When updating dependencies, the hashes must be updated accordingly: |
| 71 | + |
| 72 | +1. Download the new version of the dependency |
| 73 | +2. Calculate its SHA256 hash: `sha256sum <file>` |
| 74 | +3. Update the hash in the corresponding script in `ci/` |
| 75 | +4. Document the change in the commit message |
| 76 | + |
| 77 | +## Supply Chain Considerations |
| 78 | + |
| 79 | +This project takes the following measures to ensure supply chain security: |
| 80 | + |
| 81 | +1. **Pinned Dependencies**: All external dependencies are pinned to specific versions |
| 82 | +2. **Hash Verification**: All downloads are verified against known-good SHA256 hashes |
| 83 | +3. **Minimal Trust Surface**: Only downloads from official sources (GitHub releases, official package repositories) |
| 84 | +4. **Transparency**: All hashes and versions are printed during the build process |
| 85 | +5. **Reproducibility**: Static builds ensure consistent behavior across different systems |
| 86 | +6. **Build Provenance**: GitHub attestations provide cryptographic proof of build authenticity |
| 87 | + |
| 88 | +## Reporting Security Issues |
| 89 | + |
| 90 | +If you discover a security vulnerability in appimagetool, please report it by opening an issue on GitHub. Please provide as much detail as possible to help us understand and address the issue. |
0 commit comments