diff --git a/.github/workflows/checksums.yml b/.github/workflows/checksums.yml new file mode 100644 index 0000000..f41a0c0 --- /dev/null +++ b/.github/workflows/checksums.yml @@ -0,0 +1,33 @@ +name: Release Assets + +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + checksums: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Download Assets + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Download all assets for the release that triggered the workflow + gh release download "${{ github.event.release.tag_name }}" --dir ./assets + + - name: Generate Checksums + run: | + cd assets + # Generate SHA-256 hashes for all downloaded files, excluding any existing checksums.txt + sha256sum * > ../checksums.txt + + - name: Upload Checksums to Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload "${{ github.event.release.tag_name }}" checksums.txt --clobber diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..f9326e5 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,99 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '43 16 * * 4' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Add any setup steps before running the `github/codeql-action/init` action. + # This includes steps like installing compilers or runtimes (`actions/setup-node` + # or others). This is typically only required for manual builds. + # - name: Setup runtime (example) + # uses: actions/setup-example@v1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - name: Run manual build steps + if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/lychee.yml b/.github/workflows/lychee.yml new file mode 100644 index 0000000..a93ab2c --- /dev/null +++ b/.github/workflows/lychee.yml @@ -0,0 +1,21 @@ +name: Link Checker + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: "0 0 * * 1" # Run weekly on Monday at midnight + +jobs: + lychee: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Link Checker + uses: lycheeverse/lychee-action@v2.0.2 + with: + args: --verbose --no-progress "**/*.md" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml new file mode 100644 index 0000000..7364e28 --- /dev/null +++ b/.github/workflows/markdownlint.yml @@ -0,0 +1,17 @@ +name: Documentation Linter + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + markdownlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run markdownlint + uses: DavidAnson/markdownlint-cli2-action@v16 + with: + globs: "**/*.md" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..c9139fc --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,18 @@ +name: release-please + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + with: + release-type: simple diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..05fc670 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,83 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at **security@milehighworldllc.com**. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..bca91db --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,40 @@ +# Contributing to CodeQL CLI Binaries + +Thank you for your interest in contributing to the CodeQL CLI distribution infrastructure for MILEHIGH-WORLD LLC. To maintain enterprise-grade resilience and ensure seamless automation via agentic workflows, we enforce strict contribution protocols. + +## Commit Message Format + +We strictly enforce **Conventional Commits**. This is non-negotiable as it powers our automated release versioning via `release-please`. + +The format is: +`(): ` + +Common types: +- `feat`: A new feature (corresponds to a MINOR version bump) +- `fix`: A bug fix (corresponds to a PATCH version bump) +- `docs`: Documentation only changes +- `style`: Changes that do not affect the meaning of the code (white-space, formatting, etc) +- `refactor`: A code change that neither fixes a bug nor adds a feature +- `perf`: A code change that improves performance +- `test`: Adding missing tests or correcting existing tests +- `chore`: Changes to the build process or auxiliary tools and libraries + +Example: +`feat(automation): add markdownlint workflow` + +## Branching Strategy + +To isolate work and track automated workflows, please use the following prefixes for your branches: + +- `feature/`: Standard development and new features. +- `hotfix/`: Production-critical patches. +- `agent/`: AI-driven workflows and agentic tool updates (e.g., `agent/jules`). + +## Pull Request Process + +1. Create a branch from `main` using the appropriate prefix. +2. Ensure your commit messages follow the Conventional Commits standard. +3. Documentation changes must pass the `markdownlint` and `lychee` checks in CI. +4. Once your changes are ready, open a Pull Request. +5. All PRs require review and approval before merging. +6. Upon merging to `main`, the `release-please` workflow will automatically manage versioning and changelog updates. diff --git a/README.md b/README.md index 161270f..67d6b68 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,78 @@ -# CodeQL CLI +# CodeQL CLI Binaries -This repo holds binaries for the CodeQL CLI. +This repository serves as the official distribution hub for CodeQL CLI binaries used within the **Into the Void** development ecosystem and **MILEHIGH-WORLD LLC**'s enterprise infrastructure. -[CodeQL overview](https://securitylab.github.com/tools/codeql/) | [CodeQL CLI Documentation](https://codeql.github.com/docs/codeql-cli/) +## Architectural Overview -# Getting started +The CodeQL CLI is a core component of our static analysis and delivery reliability strategy. It interfaces with our C# and Unity environments to provide deep semantic analysis of the codebase, ensuring artifact integrity and automated governance before deployment to PHNXENT production servers. -1. Go to the [Releases page](https://github.com/github/codeql-cli-binaries/releases). -2. Find the latest release, select Assets, and download the zip file containing the CLI. -3. You'll also want to clone https://github.com/github/codeql to get the CodeQL queries and - libraries. Please take note of the - [set-up instructions](https://codeql.github.com/docs/codeql-cli/getting-started-with-the-codeql-cli/) - for placing it in a location where the CLI can find it. -4. Read the rest of the [CodeQL CLI documentation](https://codeql.github.com/docs/codeql-cli/). +By distributing binaries via GitHub Releases and providing cryptographic verification (SHA-256), we ensure a resilient and secure delivery pipeline for all internal and agentic workflows. -# Found a bug or have a question? +## Getting Started -Please raise an issue in the [github/codeql](https://github.com/github/codeql/issues/new/choose) repository. +### 1. Download & Verify +1. Navigate to the [Releases page](https://github.com/github/codeql-cli-binaries/releases). +2. Download the zip file corresponding to your operating system. +3. Download the `checksums.txt` file from the same release. +4. Verify the integrity of the binary (example for Linux/macOS): + ```bash + sha256sum -c checksums.txt + ``` -# License +### 2. Setup +To utilize CodeQL with our Unity projects, you must also clone the standard CodeQL queries: +```bash +git clone https://github.com/github/codeql +``` +Follow the [setup instructions](https://codeql.github.com/docs/codeql-cli/getting-started-with-the-codeql-cli/) to place it where the CLI can find it. -By downloading, you agree to the [GitHub CodeQL Terms & Conditions](https://securitylab.github.com/tools/codeql/license/). +## Integration Guide: Unity & C# -GitHub CodeQL can only be used on codebases that are released under an OSI-approved open source license, or to perform academic research. It can't be used to generate CodeQL databases for or during automated analysis, continuous integration or continuous delivery, whether as part of normal software engineering processes or otherwise. For these uses, [contact the sales team](https://enterprise.github.com/contact). +CodeQL analysis of Unity projects requires capturing the C# compilation process. Standard text-based scanners are insufficient for our resilience requirements. + +### Intercepting the Unity Build +To build a semantic database of a Unity project, the GitHub Actions workflow must intercept the Unity batchmode build. + +1. **Initialize the Database:** + ```bash + codeql database init --language=csharp --source-root=./path/to/unity/project MyCodeQLDatabase + ``` + +2. **Execute Headless Unity Build:** + Unity must be invoked in batchmode to trigger the C# compilation that CodeQL traces. + ```bash + unity-editor -batchmode -nographics -projectPath ./path/to/unity/project -buildTarget Win64 -executeMethod MyBuildScript.PerformBuild -quit + ``` + *Note: Ensure your `MyBuildScript` uses standard `msbuild` or Unity's internal build pipeline to ensure all C# logic is compiled.* + +3. **Finalize & Analyze:** + ```bash + codeql database finalize MyCodeQLDatabase + codeql database analyze MyCodeQLDatabase --format=sarif-latest --output=results.sarif + ``` + +## Troubleshooting + +### "No source code found" +This typically occurs when CodeQL fails to intercept any compilation events. +- **Cause:** Unity might be using pre-compiled DLLs or a cache. +- **Fix:** Perform a clean build. Delete the `Library` folder in the Unity project before running `codeql database init`. + +### MSBuild Incompatibilities +- **Issue:** Mismatched .NET SDK versions between the environment and Unity's expected runtime. +- **Fix:** Explicitly set `FrameworkPathOverride` or use a specific MSBuild path via environment variables if the tracer fails to find the compiler. + +### Agentic Workflow Failures +If an agent (e.g., `agent/jules`) encounters failures: +- Ensure the branch naming convention `agent/` is strictly followed to trigger the correct CI/CD runners. +- Verify that `Conventional Commits` are used to prevent `release-please` from stalling. + +## Governance & Security + +- **Security Reporting:** Reports vulnerabilities to [security@milehighworldllc.com](mailto:security@milehighworldllc.com). See [SECURITY.md](SECURITY.md) for full protocol. +- **Contribution:** We enforce a strict Conventional Commits policy. Refer to [CONTRIBUTING.md](CONTRIBUTING.md). +- **Code of Conduct:** We adhere to the Contributor Covenant 2.1. See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). + +## License + +By downloading, you agree to the [GitHub CodeQL Terms & Conditions](LICENSE.md). Use is restricted to Open Source Codebases or for customers with a valid GitHub Advanced Security license. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..c316e0f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting a Vulnerability + +MILEHIGH-WORLD LLC and the PHNXENT initiative take the security of our binary distribution infrastructure seriously. If you believe you have found a security vulnerability in the CodeQL CLI binaries or the distribution pipeline, please report it to us as follows: + +1. **Do not open a GitHub Issue.** Public disclosure via GitHub Issues or any other public forum is strictly prohibited until the vulnerability has been patched and verified. +2. Email your report to: **security@milehighworldllc.com** + +Please include the following information in your report: +- A detailed description of the vulnerability. +- Steps to reproduce the issue. +- Potential impact of the vulnerability. +- Any suggested mitigations. + +## Supported Versions + +We only provide security updates for the latest released version of the CodeQL CLI binaries. Please ensure you are always using the most recent release. + +## Response Process + +After we receive your report: +- We will acknowledge receipt within 48-72 hours. +- We will perform a technical evaluation to confirm the vulnerability. +- We will work on a fix and coordinate a release. +- We will notify you once the fix is deployed. +- We will credit you for the discovery (if desired) after the fix is publicly released.