Skip to content

feat(devcontainer): add separate secure customer profile#10431

Merged
viyatb-oai merged 12 commits intomainfrom
codex/viyatb/devcontainer-foundation
Apr 11, 2026
Merged

feat(devcontainer): add separate secure customer profile#10431
viyatb-oai merged 12 commits intomainfrom
codex/viyatb/devcontainer-foundation

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

@viyatb-oai viyatb-oai commented Feb 2, 2026

Description

Keeps the existing Codex contributor devcontainer in place and adds a separate secure profile for customer use.

What changed

  • leaves .devcontainer/devcontainer.json and the contributor Dockerfile aligned with main
  • adds .devcontainer/devcontainer.secure.json and .devcontainer/Dockerfile.secure
  • adds secure-profile bootstrap scripts:
    • post_install.py
    • post-start.sh
    • init-firewall.sh
  • updates .devcontainer/README.md to explain when to use each path

Secure profile behavior

The new secure profile is opt-in and is meant for running Codex in a stricter project container:

  • preinstalls the Codex CLI plus common build tools
  • uses persistent volumes for Codex state, Cargo, Rustup, and GitHub auth
  • applies an allowlist-driven outbound firewall at startup
  • blocks IPv6 by default so the allowlist cannot be bypassed via AAAA routes
  • keeps the stricter networking isolated from the default contributor workflow

Resulting behavior

  • devcontainer.json remains the low-friction Codex contributor setup
  • devcontainer.secure.json is the customer-facing secure option
  • the repo supports both workflows without forcing the secure profile on Codex contributors

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fad8095c9e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .devcontainer/init-firewall.sh
@viyatb-oai viyatb-oai changed the title feat(devcontainer): add codex-focused secure devcontainer setup fix(devcontainer): add a secure devcontainer setup Feb 3, 2026
@viyatb-oai viyatb-oai changed the title fix(devcontainer): add a secure devcontainer setup fix(devcontainer): add a better devcontainer setup Feb 3, 2026
@viyatb-oai viyatb-oai force-pushed the codex/viyatb/devcontainer-foundation branch from eed40a5 to 58ab6db Compare February 3, 2026 01:25
@viyatb-oai viyatb-oai changed the title fix(devcontainer): add a better devcontainer setup feat(devcontainer): add a new devcontainer profile for using codex securely Feb 3, 2026
@viyatb-oai viyatb-oai marked this pull request as draft February 13, 2026 01:49
@viyatb-oai viyatb-oai removed the request for review from bolinfest February 13, 2026 01:49
@github-actions
Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions bot closed this Feb 27, 2026
@viyatb-oai viyatb-oai reopened this Mar 8, 2026
@viyatb-oai viyatb-oai changed the title feat(devcontainer): add a new devcontainer profile for using codex securely feat(devcontainer): add separate secure customer profile Mar 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions bot closed this Mar 29, 2026
@viyatb-oai viyatb-oai reopened this Apr 11, 2026
@viyatb-oai viyatb-oai marked this pull request as ready for review April 11, 2026 01:10
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 755e0dd339

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


host_network="$(echo "$host_ip" | sed 's/\.[0-9]*$/.0\/24/')"
iptables -A INPUT -s "$host_network" -j ACCEPT
iptables -A OUTPUT -d "$host_network" -j ACCEPT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Restrict host-subnet egress to gateway only

The rule iptables -A OUTPUT -d "$host_network" -j ACCEPT whitelists the whole /24 around the Docker gateway, not just the host. Any proxy/service on a peer container in that subnet can relay traffic to arbitrary destinations, bypassing the allowed-domains ipset and weakening the intended default-deny egress policy.

Useful? React with 👍 / 👎.

Comment on lines +78 to +79
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Limit DNS egress to trusted resolver addresses

Allowing outbound DNS on port 53 to any destination (OUTPUT ... --dport 53) creates an unfiltered channel to arbitrary IPs. This bypasses the domain allowlist model and lets traffic leave even when non-allowlisted destinations are blocked. DNS should be constrained to Docker's resolver (or explicit trusted resolvers).

Useful? React with 👍 / 👎.

@viyatb-oai viyatb-oai merged commit dbfe855 into main Apr 11, 2026
20 checks passed
@viyatb-oai viyatb-oai deleted the codex/viyatb/devcontainer-foundation branch April 11, 2026 06:32
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant