Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create codejail functionality and security test script #896

Open
5 tasks
robrap opened this issue Jan 13, 2025 · 0 comments
Open
5 tasks

Create codejail functionality and security test script #896

robrap opened this issue Jan 13, 2025 · 0 comments
Assignees

Comments

@robrap
Copy link
Contributor

robrap commented Jan 13, 2025

Acceptance Criteria:

  • Create a script that performs automated testing
  • Create Codejail service test procedure
    • Includes running the automated script
    • Includes manual testing of infrastructure (ability to connect to other infra from codejail service; ability to reach codejail service from internet)
  • Validated against devstack: Secure codejail code-exec #927 (work in parallel)

Notes:

  • Cover functional testing
  • Cover security testing
  • Should be useful across all environments (e.g. devstack to Prod), but could have details specific to certain environments (e.g. checking that containers in Prod do not have access to any LMS DB, cache, etc.).
  • Is there anything useful to take from https://2u-internal.atlassian.net/wiki/spaces/AT/pages/16385128/Code-jail+Upgrade+and+Testing?
  • See codejail repo README for some instructions.
  • See edxapp pipeline for a smoke test of codejail.

Things to test

Just building up some local notes.

Should succeed

  • Basics
    • Define a function, call it
    • Read globals that were passed in
    • Return data via globals
  • Disk:
    • Working directory read and write (allow this one)
    • Attached files
  • Import modules
    • numpy or anything else that's in the standard codejail package list

Should fail

  • Network:
    • Public internet
    • Other servers in deployment (may be difficult to configure this in a meaningful way)
    • Localhost
    • TCP (HTTP call to 1.1.1.1), UDP (DNS resolution of example.com)
  • Disk:
    • Read, write, and list:
      • Parent directory, which contains other people's codejail
      • /etc/passwd (as stand-in for more sensitive files)
      • /proc/1/cmdline (as a stand-in for more sensitive process values)
  • Long-running task
  • Processes
    • Child process
    • Fork
  • Memory
    • Allocate huge objects

Other

  • Abuse of python_path
  • Read environment variables
  • Confirm Python version
  • /proc/*/mounts
@robrap robrap added this to Arch-BOM Jan 13, 2025
@robrap robrap converted this from a draft issue Jan 13, 2025
@robrap robrap removed the status in Arch-BOM Jan 29, 2025
@robrap robrap moved this to Ready For Development in Arch-BOM Jan 30, 2025
@timmc-edx timmc-edx changed the title Create codejail test procedure Create codejail functionality and security test script Feb 3, 2025
@timmc-edx timmc-edx moved this from Ready For Development to In Progress in Arch-BOM Feb 3, 2025
@timmc-edx timmc-edx self-assigned this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants