Skip to content

Commit 892eaca

Browse files
committed
update the README
1 parent d199a78 commit 892eaca

1 file changed

Lines changed: 58 additions & 35 deletions

File tree

README.md

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,54 @@
1-
# Jit Customer Scripts
1+
# Jit Customer Scripts README
2+
3+
The README provided is an extensive guide on how to use the `jit-customer-scripts` project. \
4+
The Makefile described is composed of commands that ease the installation, configuration, and running of the scripts within the project. \
5+
Here's a breakdown of the provided README and Makefile:
6+
7+
## README Overview
8+
9+
- **Introduction**: The README begins with a brief description of the project and its purpose, which is to aid customers in creating teams and updating assets based on a given JSON file.
10+
- **Project Structure**: An organized visual representation of the project's file structure is provided.
11+
- **Prerequisites**: Lists necessary software that should be installed before starting, along with instructions for CentOS and Ubuntu to prepare the environment.
12+
- **Generating API Keys**: Guidance on how to generate the necessary Github Personal Access Token and Jit API Key.
13+
- **Installation**: Steps on cloning the repository and setting up the project.
14+
- **Configuration**: Instructions on how to configure the necessary environment variables for the script.
15+
- **Usage**:
16+
- **Creating Teams from Github Topics**: Details on how to use the script to create teams and update assets from GitHub topics.
17+
- **Using External JSON File**: Allows users to directly provide a JSON file containing team details.
18+
- **Excluding Topics**: Instructions on excluding specific topics when creating teams.
19+
- **Setting Up Self-Hosted Runners**: Guidance on setting up GitHub self-hosted runners on both CentOS and Ubuntu.
20+
- **Help**: Instruction on getting help with the Makefile commands.
21+
- **Development**: A small note about overriding the Jit API endpoint.
22+
23+
## Makefile Overview
24+
25+
The Makefile consists of several targets to facilitate the installation, configuration, and running of scripts. Here's a breakdown:
26+
27+
### sync-teams
28+
This target has three sub-targets:
29+
- `install`: Ensures Python 3 is installed, sets up a virtual environment, and installs the required dependencies.
30+
- `configure`: Prompts the user to input configuration details like GitHub organization name, API client ID, client secret, and GitHub token. The responses are written to a `.env` file.
31+
- `run`: Activates the virtual environment and runs two Python scripts in succession to generate teams.
32+
33+
### self-hosted-runner
34+
This target and its sub-targets facilitate setting up a GitHub self-hosted runner:
35+
- `check-root`: Ensures the script isn't run as root.
36+
- `setup-runner`: Checks the platform (CentOS or Ubuntu) and runs the appropriate setup script.
37+
- `install-agent`: Installs the GitHub runner agent.
238

3-
[![codecov](https://codecov.io/gh/jitsecurity/jit-customer-scripts/graph/badge.svg?token=76IhFwTPjv)](https://codecov.io/gh/jitsecurity/jit-customer-scripts)
39+
### Help
40+
- `help`: Displays available targets and their brief descriptions.
41+
42+
## Hierarchical Structure of the Commands:
43+
44+
1. **sync-teams**
45+
- install
46+
- configure
47+
- run
448

5-
This project provides customer scripts to help them with their JIT solution. \
6-
The `create-teams.py` script's goal is to create teams and update assets based on the provided JSON file.
49+
2. **self-hosted-runner**
50+
- centos
51+
- ubuntu
752

853
## Project Structure
954

@@ -34,12 +79,14 @@ jit-customer-scripts/
3479
- `Makefile`: Provides commands to help with project setup and execution.
3580
- `README.md`: This file.
3681

82+
3783
## Prerequisites
3884

3985
- Python 3.x
4086
- Git
4187
- make
4288

89+
4390
To make sure you have all you can run this command:
4491

4592
#### Centos
@@ -77,31 +124,7 @@ sudo apt install -y git make && git clone https://github.com/jitsecurity/jit-cus
77124
cd jit-customer-scripts
78125
```
79126

80-
3. Create a virtual environment and install the required dependencies:
81-
82-
```shell
83-
make install
84-
```
85-
86-
## Configuration
87-
88-
Before running the script, you need to configure the necessary environment variables. Follow these steps:
89-
90-
1. Run the configuration command:
91-
92-
```shell
93-
make configure
94-
```
95-
96-
2. Enter the required information when prompted:
97-
- GitHub organization name
98-
- API client ID
99-
- API client secret
100-
- GitHub token
101-
102-
3. The command will generate a `.env` file with the provided information.
103-
104-
## Usage
127+
## Sync Teams
105128

106129
### Creating Teams from Github Topics
107130

@@ -192,14 +215,15 @@ This will exclude topics with names like "test", "test123", and "abc-testing".
192215
To override Jit's API endpoint, you can set the `JIT_API_ENDPOINT` environment variable. If the variable is not set, the
193216
default value will be used.
194217

195-
### Settings Up Self-Hosted Runners
218+
219+
## Settings Up Self-Hosted Runners
196220

197221
To setup self-hosted runners, use the following command:
198222

199223
You need to take the self hosted runners token from the Github Actions page of your repository.
200224
`https://github.com/<your-github-org-name>/jit/settings/actions/runners`
201225

202-
#### Running on CentOS
226+
### Running on CentOS
203227

204228
```shell
205229
make self-hosted-runner centos runner_token=<runner-token> github_org=<github-organization> jit_repo=<jit-repo-name>
@@ -211,7 +235,7 @@ The runner will be automatically started on boot.
211235

212236
Replace `<runner-token>`, `<github-organization>`, and `<jit-repo-name>` with the appropriate values.
213237

214-
#### Running on Ubuntu
238+
### Running on Ubuntu
215239

216240
```shell
217241
make self-hosted-runner ubuntu runner_token=<runner-token> github_org=<github-organization>
@@ -223,11 +247,10 @@ The runner will be automatically started on boot.
223247

224248
Replace `<runner-token>` and `<github-organization>` with the appropriate values.
225249

226-
### Help
250+
## Help
227251

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

230254
```shell
231255
make help
232-
```
233-
256+
```

0 commit comments

Comments
 (0)