Skip to content

Chore/bisect#3

Open
danielbodnar wants to merge 19 commits intomainfrom
chore/bisect
Open

Chore/bisect#3
danielbodnar wants to merge 19 commits intomainfrom
chore/bisect

Conversation

@danielbodnar
Copy link
Contributor

@danielbodnar danielbodnar commented Oct 28, 2025

This pull request introduces several foundational improvements to the BitBuilder Cloud CLI (bbctl) project, focusing on documentation, configuration, code quality, and initial planning. The changes establish a clear project structure, add configuration and linting for both Rust and TypeScript development, and provide comprehensive guides and plans for future development.

Project Planning and Documentation:

  • Added a detailed implementation plan for bbctl, outlining architecture, phases, and directory structure in PLAN.md.
  • Introduced an API documentation guide using Zod and OpenAPI in docs/api-readme.md, including instructions for schema validation, type safety, and client generation.
  • Added a comprehensive configuration guide in docs/configuration-guide.md, covering all aspects of bbctl configuration, provider and credential management, and best practices.
  • Expanded the main README.md with instructions for testing against a VyOS lab environment.

Development Environment and Tooling:

  • Added .eslintrc.json for TypeScript linting with recommended rules and project-specific overrides.
  • Introduced bunfig.toml to configure Bun for dependency management, testing, and building TypeScript code.
  • Updated Cargo.toml to include the uuid crate for networking and security features, preparing for future API and RPC additions.

Developer Experience and Guidelines:

  • Enhanced CLAUDE.md with more detailed build, test, and style guidelines, including project structure, code formatting, and naming conventions. [1] [2] [3] [4]

These changes lay the groundwork for robust development practices, clear documentation, and a maintainable codebase as bbctl evolves.

@danielbodnar danielbodnar marked this pull request as ready for review October 29, 2025 00:27
Copilot AI review requested due to automatic review settings October 29, 2025 00:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive VyOS test lab infrastructure with Docker-based deployment scripts, network configuration, and integration documentation for the bbctl CLI. The changes primarily introduce new test infrastructure files and documentation to support multi-tenant networking scenarios.

Key Changes

  • Added Docker-based VyOS test lab setup with automated provisioning scripts
  • Introduced network configuration files for L3VPN/EVPN, WireGuard, and OSPF
  • Added comprehensive documentation for VyOS networking and test lab setup
  • Created TypeScript schema definitions and OpenAPI integration files

Reviewed Changes

Copilot reviewed 57 out of 61 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/vyos-lab/setup-lab.sh Main orchestration script for VyOS lab deployment with router configuration
tests/vyos-lab/scripts/*.sh Individual setup scripts for base infrastructure, containers, L3VPN, and WireGuard
tests/vyos-lab/README.md Documentation for the VyOS test lab environment
docs/vyos-*.md Comprehensive networking architecture and test lab documentation
src/main.rs Added TestVyOS command for connectivity testing
schema.ts TypeScript/Zod schemas for API validation
package.json Added npm scripts and dependencies for TypeScript tooling
Comments suppressed due to low confidence (6)

src/main.rs:1

  • The TestVyOS command destructuring pattern is missing several fields that are defined in the command struct (password, key_path, api_key). This will cause a compilation error. Include all fields in the destructuring pattern or use .. to ignore unused fields.
    src/main.rs:1
  • [nitpick] The default host IP '5.254.54.3' appears to be a public IP address that may not be appropriate as a default value. Consider using 'localhost' or a more generic local IP address as the default.
    tests/vyos-lab/setup-lab.sh:1
  • The script references ${SCRIPT_DIR}/scripts/ but SCRIPT_DIR is defined relative to the current script location. The scripts directory should exist at ${SCRIPT_DIR}/scripts/, but the actual scripts are in a sibling 'scripts' directory based on the file structure. This path should be verified or corrected.
    tests/vyos-lab/scripts/setup-base.sh:1
  • Hardcoded interface name 'eth0' may not exist on all systems. Consider detecting the default route interface dynamically using ip route show default | awk '{print $5}' or making it configurable.
    tests/vyos-lab/scripts/configure-wireguard.sh:1
  • The regex pattern for extracting the WireGuard private key expects exactly 43 characters, but WireGuard keys are base64-encoded 32-byte values resulting in 44 characters (including padding). The pattern should be [A-Za-z0-9+/=]\{44\} to correctly match WireGuard keys.
    tests/vyos-lab/scripts/setup-vyos-container.sh:1
  • The encrypted password hash is exposed in plain text in the configuration script. While this is a test environment, it's better practice to generate unique passwords per deployment or document that this is the hash for the default 'vyos' password.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

schema.ts Outdated
provider: ProviderTypeEnum,
providerId: z.string(),
region: z.string(),
cidr: z.string().regex(/^([0-9]{1,3}\.){3}[0-9]{1,3}\/[0-9]{1,2}$/),
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CIDR regex validation only checks the format but doesn't validate that octets are in the valid range (0-255) or that the prefix length is valid (0-32 for IPv4). Consider using a more robust validation or IP validation library to prevent invalid CIDR blocks like '999.999.999.999/99'.

Copilot uses AI. Check for mistakes.
@danielbodnar danielbodnar requested a review from Copilot January 12, 2026 03:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 57 out of 61 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (8)

vyos-lab/setup-network.sh:1

  • The hardcoded absolute path /home/bodnar/vyos-lab makes this script non-portable. Use $(dirname "$0") or a relative path to make the script work for other users and environments.
    vyos-lab/mkosi.default:1
  • Hardcoded path contains a specific username 'bodnar'. This should use a relative path or environment variable to ensure portability across different user environments.
    tests/vyos-lab/setup-lab.sh:1
  • The default host IP 5.254.54.3 appears to be a public IP address. For a test lab, consider using private IP ranges (e.g., 192.168.x.x or 10.x.x.x) to avoid potential conflicts with real public IPs.
    tests/vyos-lab/scripts/setup-base.sh:1
  • The script assumes network interface eth0 exists. Modern systems may use different interface naming schemes (e.g., ens33, enp0s3). Consider detecting the default interface dynamically or documenting this assumption.
    tests/vyos-lab/scripts/setup-vyos-container.sh:1
  • Using a hardcoded password hash in test scripts is a security concern if these scripts are ever used in non-test environments. Add a prominent comment warning that this is for testing only, or better yet, generate unique passwords per deployment.
    src/main.rs:1
  • The error message refers to implementation details ('tokio runtime') that may confuse users. This appears to be a placeholder that returns an error, but the actual implementation exists later in main(). Consider removing this unreachable code path or updating the comment to clarify the control flow.
    src/network.rs:1
  • The code accesses config.port with unwrap_or(), but the WireguardConfig struct defines port as a non-optional u16 field. This suggests either the struct definition is incorrect or this code is outdated. The struct should have port: Option<u16> if this fallback is intended.
    src/services/instance.rs:1
  • The hardcoded node name 'pve' is a placeholder that could cause issues in production. This should either retrieve the actual node name from the instance metadata or be documented as a limitation that requires configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"typescript": "^5.2.2"
},
"engines": {
"bun": ">=1.0.0"
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package requires Bun >=1.0.0 but doesn't document this requirement prominently in the README or installation instructions. Users following the installation guide might not realize they need Bun installed.

Copilot uses AI. Check for mistakes.
@danielbodnar danielbodnar marked this pull request as draft January 15, 2026 00:26
danielbodnar and others added 15 commits January 14, 2026 18:34
- Add complete TypeScript/Zod schema definitions for all API models
- Implement OpenAPI 3.1 specification generation with Swagger UI
- Set up Bun runtime environment with TypeScript support
- Add comprehensive API documentation and integration guides
- Configure ESLint for TypeScript with strict validation rules
- Create example validation scripts and development workflows
- Establish schema compatibility between Rust backend and TypeScript API
- Add documentation index with complete guide references
- Implement automated OpenAPI schema generation from Zod schemas
Restores the full 1,241 lines of critical infrastructure documentation
that was accidentally truncated to just the header section. Content
includes:

- Complete architecture overview with mermaid diagrams
- Network addressing schemas
- Physical infrastructure setup procedures
- Hypervisor layer configuration (NIC, SR-IOV, LACP, OVS)
- VyOS VM deployment using mkosi and systemd-vmspawn
- WireGuard control plane configuration
- Complete bash scripts for infrastructure automation

Restored from commit 8467274 which has correct markdown formatting
(```bash without spaces) instead of the bad formatting introduced in
later commits (``` bash with spaces).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Restores README.md from commit 8467274 which has correct markdown
formatting (```bash without spaces) instead of the bad formatting
introduced in later commits (``` bash with spaces).

All documentation sections are preserved:
- Testing with VyOS Lab Environment
- Complete Documentation section with all guide links
- Examples section for TypeScript validation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Adds back Rust/Cargo-specific comments and patterns from the initial
commit while maintaining the clean, deduplicated structure:

- Rust/Cargo section with explanatory comments about Cargo.lock
- Rust-specific patterns: debug/, target/, **/*.rs.bk, *.pdb
- Maintains comprehensive coverage of Bun, Node.js, TypeScript, IDE,
  OS-specific files, environment variables, debug, testing, and logs

Removes duplicate entries that were present in the main branch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Restores PLAN.md and docs/vyos-test-lab-setup.md from commit 8467274
which has correct markdown formatting:
- Single space after bullets (- item) instead of triple (-)
- Single space after numbered lists (1. item) instead of double (1.  )
- No extra blank lines after headers

All substantive content is preserved, only formatting corrected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Daniel Bodnar <1790726+danielbodnar@users.noreply.github.com>
… check

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Daniel Bodnar <1790726+danielbodnar@users.noreply.github.com>
@danielbodnar danielbodnar requested a review from Copilot March 18, 2026 18:50
@danielbodnar danielbodnar marked this pull request as ready for review March 18, 2026 18:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 45 out of 50 changed files in this pull request and generated 21 comments.

Comments suppressed due to low confidence (2)

package.json:58

  • package.json has an extra closing brace at the end, making the JSON invalid and breaking installs/tooling. Remove the trailing } so the file ends with a single top-level object close.
}
}

docs/api-readme.md:37

  • The OpenAPI generation instructions include duplicated headings and a malformed code fence (an opening bash, then bullet text, then another bash). This breaks Markdown rendering and makes the instructions hard to follow. Remove the duplicated prerequisite/install blocks and use a single properly-delimited code fence for commands.
- Bun 1.0 or higher

### Installation

```bash
-   Bun 1.0 or higher

### Installation

```bash
cd bitbuilder.io/bbctl
bun install
</details>



---

💡 <a href="/bitbuilder-io/bbctl/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.

Comment on lines 41 to +43
- systemctl restart frr
- echo "Router 2 setup complete"
- echo "Router 2 setup complete"
Comment on lines 180 to 184
## Security Considerations


## Security Considerations
- Isolation between tenants using VRFs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Daniel Bodnar <1790726+danielbodnar@users.noreply.github.com>
@socket-security
Copy link

socket-security bot commented Mar 18, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Medium
System shell access: cargo darling_core

Location: Package overview

From: ?cargo/ratatui@0.29.0cargo/darling_core@0.23.0

ℹ Read more on: This package | This alert | What is shell access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/darling_core@0.23.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
System shell access: cargo r-efi

Location: Package overview

From: ?cargo/tempfile@3.24.0cargo/mockito@1.7.1cargo/uuid@1.19.0cargo/r-efi@5.3.0

ℹ Read more on: This package | This alert | What is shell access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/r-efi@5.3.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
System shell access: cargo syn

Location: Package overview

From: ?cargo/clap@4.5.54cargo/tokio@1.49.0cargo/serde_json@1.0.149cargo/chrono@0.4.43cargo/indicatif@0.17.11cargo/futures@0.3.31cargo/dirs@5.0.1cargo/reqwest@0.11.27cargo/ratatui@0.29.0cargo/serde@1.0.228cargo/openssl@0.10.75cargo/mockito@1.7.1cargo/uuid@1.19.0cargo/syn@2.0.114

ℹ Read more on: This package | This alert | What is shell access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/syn@2.0.114. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
System shell access: cargo zerocopy-derive

Location: Package overview

From: ?cargo/mockito@1.7.1cargo/zerocopy-derive@0.8.33

ℹ Read more on: This package | This alert | What is shell access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/zerocopy-derive@0.8.33. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo find-msvc-tools

Location: Package overview

From: ?cargo/chrono@0.4.43cargo/reqwest@0.11.27cargo/openssl@0.10.75cargo/find-msvc-tools@0.1.7

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/find-msvc-tools@0.1.7. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo hyper-util

Location: Package overview

From: ?cargo/mockito@1.7.1cargo/hyper-util@0.1.19

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/hyper-util@0.1.19. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo icu_normalizer_data

Location: Package overview

From: ?cargo/reqwest@0.11.27cargo/icu_normalizer_data@2.1.1

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/icu_normalizer_data@2.1.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo icu_properties_data

Location: Package overview

From: ?cargo/reqwest@0.11.27cargo/icu_properties_data@2.1.2

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/icu_properties_data@2.1.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo quote

Location: Package overview

From: ?cargo/clap@4.5.54cargo/tokio@1.49.0cargo/serde_json@1.0.149cargo/chrono@0.4.43cargo/indicatif@0.17.11cargo/futures@0.3.31cargo/dirs@5.0.1cargo/reqwest@0.11.27cargo/ratatui@0.29.0cargo/serde@1.0.228cargo/openssl@0.10.75cargo/mockito@1.7.1cargo/uuid@1.19.0cargo/quote@1.0.43

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/quote@1.0.43. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo r-efi

Location: Package overview

From: ?cargo/tempfile@3.24.0cargo/mockito@1.7.1cargo/uuid@1.19.0cargo/r-efi@5.3.0

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/r-efi@5.3.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo serde_core

Location: Package overview

From: ?cargo/serde_json@1.0.149cargo/serde@1.0.228cargo/uuid@1.19.0cargo/serde_core@1.0.228

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/serde_core@1.0.228. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo serde_derive

Location: Package overview

From: ?cargo/serde_json@1.0.149cargo/serde@1.0.228cargo/uuid@1.19.0cargo/serde_derive@1.0.228

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/serde_derive@1.0.228. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo wasm-bindgen-macro-support

Location: Package overview

From: ?cargo/chrono@0.4.43cargo/indicatif@0.17.11cargo/reqwest@0.11.27cargo/uuid@1.19.0cargo/wasm-bindgen-macro-support@0.2.107

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/wasm-bindgen-macro-support@0.2.107. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo wasm-bindgen

Location: Package overview

From: ?cargo/chrono@0.4.43cargo/indicatif@0.17.11cargo/reqwest@0.11.27cargo/uuid@1.19.0cargo/wasm-bindgen@0.2.107

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/wasm-bindgen@0.2.107. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo wit-bindgen

Location: Package overview

From: ?cargo/tempfile@3.24.0cargo/mockito@1.7.1cargo/uuid@1.19.0cargo/wit-bindgen@0.46.0

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/wit-bindgen@0.46.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo zerocopy-derive

Location: Package overview

From: ?cargo/mockito@1.7.1cargo/zerocopy-derive@0.8.33

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/zerocopy-derive@0.8.33. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Environment variable access: cargo zmij

Location: Package overview

From: ?cargo/serde_json@1.0.149cargo/zmij@1.0.14

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/zmij@1.0.14. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Daniel Bodnar <1790726+danielbodnar@users.noreply.github.com>
danielbodnar and others added 2 commits March 18, 2026 14:04
Removed duplicate conclusion paragraph in PLAN.md

Signed-off-by: Daniel Bodnar <1790726+danielbodnar@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Daniel Bodnar <1790726+danielbodnar@users.noreply.github.com>

// Optionally disable TLS certificate verification for lab/dev setups
if !self.config.verify_ssl {
builder = builder.danger_accept_invalid_certs(true);

Check failure

Code scanning / CodeQL

Disabled TLS certificate check High

Disabling TLS certificate validation can expose the application to man-in-the-middle attacks.

Copilot Autofix

AI 5 days ago

In general, to fix this problem, the HTTP client must never disable TLS certificate validation in production code. Instead of toggling danger_accept_invalid_certs(true) at runtime, certificate verification should remain enabled (the default), and any special handling for lab/dev environments should be implemented in a safer way (for example, by using proper test certificates or environment‑specific roots, not by disabling validation).

The best fix here, without changing existing functionality more than necessary, is to remove the call to danger_accept_invalid_certs(true) entirely and rely on the default behavior of reqwest::Client::builder(), which is to validate certificates. If you still want an explicit link between verify_ssl and client behavior, you can set danger_accept_invalid_certs(false) when verify_ssl is true, but that is redundant and not required for correctness. Since we cannot change the rest of the code and want a minimal, safe change, we will simply delete the conditional block that disables TLS verification and leave the rest of init_http_client intact. No new imports, methods, or definitions are needed; the change is localized to init_http_client in src/api/vyos.rs, lines 116–119.

Suggested changeset 1
src/api/vyos.rs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/api/vyos.rs b/src/api/vyos.rs
--- a/src/api/vyos.rs
+++ b/src/api/vyos.rs
@@ -110,14 +110,9 @@
     /// Initialize HTTP client for API operations
     fn init_http_client(&mut self) -> Result<()> {
         if self.http_client.is_none() {
-            let mut builder = Client::builder()
+            let builder = Client::builder()
                 .timeout(Duration::from_secs(self.config.timeout));
 
-            // Optionally disable TLS certificate verification for lab/dev setups
-            if !self.config.verify_ssl {
-                builder = builder.danger_accept_invalid_certs(true);
-            }
-
             let client = builder
                 .build()
                 .context("Failed to build HTTP client")?;
EOF
@@ -110,14 +110,9 @@
/// Initialize HTTP client for API operations
fn init_http_client(&mut self) -> Result<()> {
if self.http_client.is_none() {
let mut builder = Client::builder()
let builder = Client::builder()
.timeout(Duration::from_secs(self.config.timeout));

// Optionally disable TLS certificate verification for lab/dev setups
if !self.config.verify_ssl {
builder = builder.danger_accept_invalid_certs(true);
}

let client = builder
.build()
.context("Failed to build HTTP client")?;
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants