Skip to main content

tCell Python Agent

A tCell.io security agent that instruments your Python web applications.

Installation

Installing latest agent via pip:

$ pip install tcell_agent

Install a particular version:

$ pip install tcell_agent==1.0.1

Install from source:

$ pip install ~/Downloads/tcellagent_src

Install from a compressed file:

$ pip install ~/Downloads/pythonagent-tcell-master.zip

Run application from source

Switch to your project

$ cd ~/projects/mydjangoapp/

Obtain a tcell_agent.config file from the tCell dashboard and place it at the root of your web app, for this example ~/projects/mydjango/.

NOTE! By default the agent looks for the tcell_agent.config in the current working directory as well as $TCELL_AGENT_HOME/tcell_agent.config.

There are two ways you can load the tcell_agent:

1. Use the tcell_agent binary to run your app

If you previously started your web app like this:

$ python manage.py runserver 0.0.0.0:8000

you now start it like this:

$ tcell_agent run python manage.py runserver 0.0.0.0:8000

2. Load the tcell_agent via a wsgi.py file

Assuming your wsgi.py (Django) file looks something like this:

import os
from django.core.wsgi import get_wsgi_application
from django_waitlist.settings import PROJECT_ROOT

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_waitlist.settings")
application = get_wsgi_application()

modify it accordingly:

import os
from django.core.wsgi import get_wsgi_application
from django_waitlist.settings import PROJECT_ROOT

# optional: change default settings via ENV
# os.environ['TCELL_AGENT_CONFIG'] = '/var/www/html/tcell/tcell_agent.config'
# os.environ['TCELL_AGENT_HOME'] = '/var/www/html/tcell'
import tcell_agent
tcell_agent.init()

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_waitlist.settings")
application = get_wsgi_application()

Run application from service script

Assuming your service script (/etc/init.d/myapp.conf) that looks something like this:

script
    set -a
    source /etc/environment
    exec /path/to/bin/uwsgi --ini uwsgi.ini
end script

load the tcell_agent by modifying it accordingly:

script
    set -a
    source /etc/environment
    export TCELL_AGENT_CONFIG='/path/to/tcell-home/tcell_agent.config'
    export TCELL_AGENT_HOME='/path/to/tcell-home/tcell'
    exec /path/to/bin/tcell_agent /path/to/bin/uwsgi --ini uwsgi.ini
end script

If you don't want to modify your service script, modifying wsgi.py to load the agent should also work.

Common pitfalls

  • If you're using tcell_agent binary, ensure it exists in your path.
  • If you're using virtualenv make sure to load the environment before installing tcell_agent
  • When specifying TCELL_AGENT_HOME ensure the app's user has correct read/write permissions to that directory.

Metadata

Release files for tcell-agent 1.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tcell-agent 1.10.0
File Size Uploaded
tcell_agent-1.10.0.tar.gz 22.1 MB Details

Release files / tcell_agent-1.10.0.tar.gz

Download URL tcell_agent-1.10.0.tar.gz
Size 22.1 MB
Tags Source
SHA-256 checksum
How to use checksums
9ad012de810fc1a0989233c2c98a34c0c7bd16a3b550488db83ac32a82187183
BLAKE2b-256 checksum
How to use checksums
a79288d5c143d23069ab6aa586299657b87369215a90f315721b20bc22fc9007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.10.0 This release

1 release file

1.9.0

1 release file

1.8.2

1 release file

1.8.1

1 release file

1.8.0

1 release file

1.7.3

1 release file

1.7.2

1 release file

1.7.1

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.1

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

0.4.5

1 release file

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.2.35

1 release file

0.2.34

1 release file

0.2.33

1 release file

0.2.32

1 release file

0.2.31

1 release file

0.2.30

1 release file

0.2.29

1 release file

0.2.28

1 release file

0.2.27

1 release file

0.2.26

1 release file

0.2.25

1 release file

0.2.24

1 release file

0.2.23

0.2.22

1 release file

0.2.21

1 release file

0.2.20

1 release file

0.2.19

1 release file

0.2.17

1 release file

0.2.16

1 release file

0.2.15

1 release file

0.2.14

1 release file

0.2.13

1 release file

0.2.12

1 release file

0.2.11

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page