cmu-sei / Polar

Polar is a secure and scalable knowledge graph framework, designed to address the challenges posed by building big data systems in highly regulated environments, and improve observability for DevSecOps Organizations.
Other
9 stars 1 forks source link

Secure and Resilient Build Process for Polar Services #5

Closed daveman1010221 closed 2 months ago

daveman1010221 commented 4 months ago

As the architect for the project, I want to ensure we're delivering safe, secure, resilient software, using a reliable and repeatable build process that allows users to use nearly the same process for local developer builds as for CI/CD pipeline builds, so that developers can have a consistent and secure build environment.

Details:

Use the NixOS package manager, dev shell, and bubble wrap (bwrap) to create a secure build environment for Rust projects. The environment should pull all necessary shell tools and compiler toolchain tools as Nix derivations. Instantiate a bwrap sandbox with those derivations. Allow users to run the build project's local stack initialization and perform other development tasks within the sandbox. Acceptance Criteria:

Setup and Configuration:

Clear documentation on setting up NixOS, dev shell, and bubble wrap. Configuration files for Nix derivations are included and well-documented. Instructions for integrating the build process into both local development and CI/CD pipelines.

Sandbox Environment: The build process runs within a bwrap sandbox to isolate it from the host system. The sandbox environment includes all necessary tools and dependencies as Nix derivations. Ensure that the sandbox environment is secure and restricts access to the host system.

Build Process: The build process for Rust projects is defined and can be executed within the sandbox. The process includes initialization of the local stack and other development tasks. Builds are consistent and reproducible both locally and in the CI/CD pipeline.

Security: The sandbox environment protects the host system from unknown errors and malicious actors. Ensure that all tools and dependencies are securely fetched and verified as Nix derivations. Regular security audits and updates for the build environment and dependencies.

Resilience and Reliability: The build process is resilient to failures and can recover or restart as needed. Provide logging and monitoring for build processes to detect and address issues promptly.

Developer Experience: Developers can easily enter the sandbox environment and perform builds with minimal setup. Provide scripts or tools to automate the setup and execution of the sandboxed build process. Documentation and support for common issues and troubleshooting steps.

Integration with Existing Work: Leverage and extend existing work from this repository. Ensure compatibility and integration with the existing tools and processes defined in the repository.

Testing: Unit and integration tests for the build process and sandbox environment. Ensure that builds are consistent and successful across different environments (local and CI/CD). Automated tests for security and resilience of the sandbox environment.

Documentation: Comprehensive documentation for the setup, usage, and maintenance of the build environment. Include examples and best practices for using the sandboxed build process in development and CI/CD. Provide guidance on extending and customizing the build environment for specific project needs.