Skip to content

jitsecurity/jit-customer-scripts

Repository files navigation

Jit Customer Scripts README

The README provided is an extensive guide on how to use the jit-customer-scripts project.
The Makefile described is composed of commands that ease the installation, configuration, and running of the scripts within the project.

Prerequisites

  • Python 3.x
  • Git
  • make

To make sure you have all you can run this command:

Amazon Linux distro

sudo yum install -y git make && git clone https://github.com/jitsecurity/jit-customer-scripts.git && cd jit-customer-scripts

Ubuntu distro

sudo apt update && sudo apt install -y git make && git clone https://github.com/jitsecurity/jit-customer-scripts.git && cd jit-customer-scripts

Mac

brew install git make && git clone https://github.com/jitsecurity/jit-customer-scripts.git && cd jit-customer-scripts

Here's a breakdown of the provided README and Makefile:

Supported Scripts

The Makefile consists of several commands to facilitate the installation, configuration, and running of scripts. Here's a link to the docs for each one:

Hierarchical Structure of the Commands:

  1. sync-teams

    • install
    • configure
    • run
  2. self-hosted-runner

    • amazon
    • ubuntu

Project Structure

The project has the following structure:

jit-customer-scripts/
├── src/
│   └── scripts/
│       └── sync_teams
│            └── sync_teams.py
|       └── self-hosted-runners
│            └── setup-rootless-docker-amazon.sh
│            └── setup-rootless-docker-ubuntu.sh
│            └── ...
├── src/
│   └── utils/
│       └── github_topic_to_json_file.py
├── src/
│   └── shared/
│       └── models.py
│       └── ...
├── Makefile
└── README.md
  • scripts/: Contains the customer scripts.
  • src/shared/models.py: Contains the data models used by the scripts.
  • .env: Configuration file generated by the Makefile.
  • Makefile: Provides commands to help with project setup and execution.
  • README.md: This file.

Generating API Keys

  • To generate Github Personal Access Token(PAT) refer to this guide
  • To generate a Jit API Key Go to Settings -> Users & Permissions -> API Tokens in your Jit dashboard.

We recommend generating a fine-grained PAT with read-only access to the organization for the use of this script.

Development

To override Jit's API endpoint, you can set the JIT_API_ENDPOINT environment variable. If the variable is not set, the default value will be used.

Help

To see the available commands and their descriptions, use the following command:

make help