Skip to content

Commit 1b9c7c4

Browse files
authored
Merge pull request #227 from Be-Secure/develop
Syncing changes for release 0.5.0
2 parents 799aa50 + da89677 commit 1b9c7c4

22 files changed

Lines changed: 2098 additions & 868 deletions

README.md

Lines changed: 154 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -48,110 +48,191 @@ It also provides seamless support for creating and executing BeS playbooks, enab
4848
- **launch**: Trigger function which calls all the above functions.
4949
- The BeS Playbooks are stored and maintained under [besecure-playbooks-store](https://github.com/Be-Secure/besecure-playbooks-store).
5050

51+
<!-- # Developer Guide
52+
53+
**Welcome, Developers!**
54+
55+
We are thrilled to have you here! Thank you for your interest in contributing to our project. Whether you're a seasoned developer or just getting started, your contributions are highly valued and appreciated. This [guide](developer-guide.md) will help you get up and running and provide you with the necessary information to make your development experience as smooth as possible. -->
56+
5157
# Installation
5258

53-
## For Windows
59+
BeSman is designed to be used in a Linux machine.
5460

55-
BeSman is designed to work with linux machines. So, if you are a windows user, you can use [oah-installer](https://github.com/be-secure/oah-installer), a component of [**OpenAppHack(OAH)**](https://openapphack.github.io/OAH/), to install [oah-shell](https://github.com/be-secure/oah-shell) in the local system and using it to bring up [oah-bes-vm](https://github.com/be-secure/oah-bes-vm), an ubuntu VM, with BeSman installed.
61+
`Windows users should use an ubuntu VM or WSL.`
5662

57-
### Pre-requisites
63+
## Install latest stable version
5864

59-
- <a href="https://www.virtualbox.org/" target="_blank">Virtual Box</a>
60-
- <a href="https://www.vagrantup.com/" target="_blank">Vagrant</a>
61-
- <a href="https://gitforwindows.org/" target="_blank">Git Bash</a>
65+
1. Open your terminal
6266

63-
1. Open your git bash
67+
2. Run the below command
6468

65-
2. Execute the below command to set the correct namespace
69+
source <(curl -L https://raw.githubusercontent.com/Be-Secure/BeSman/dist/dist/get.besman.io)
6670

67-
export BES_NAMESPACE=Be-Secure
71+
3. Run the below command to confirm installation
6872

69-
3. Install oah-shell
73+
bes help
7074

71-
curl -s https://raw.githubusercontent.com/Be-Secure/oah-installer/master/install.sh | bash
75+
## Install a different version
7276

73-
4. Confirm the installation oah-shell by executing the below command which would list various oah commands
77+
1. Go to our [release](https://github.com/Be-Secure/BeSman/releases) page and find the version you wish to install.
7478

75-
oah
79+
2. Open your terminal and export the version
7680

77-
5. Execute the below command to get the list of environments
81+
export BESMAN_VERSION=<paste the version here>
82+
83+
3. Run the below command to install
84+
85+
source <(curl -L https://raw.githubusercontent.com/Be-Secure/BeSman/dist/dist/get.besman.io)
7886

79-
oah list
87+
4. Run the below command to confirm installation
8088

81-
Note: Make sure **oah-bes-vm** is listed. If not, execute step 2 and run the below command
89+
bes help
8290

83-
source ${OAH_DIR}/bin/oah-init
91+
## Installation from a Branch
8492

85-
6. Setup oah-bes-vm for BeSman by executing the below command.
93+
This step is useful for developers,
8694

87-
oah install -v oah-bes-vm
95+
BeSman also allows you to install the cli from a branch. This is used to quickly test your feature developments or bug fixes.
8896

89-
## For Linux
97+
1. Clone the repo.
9098

91-
### Pre-requisites
99+
git clone https://github.com/<your id>/BeSman
92100

93-
- <a href="https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html" target="_blank">Ansible</a>
94-
- <a href="https://github.com/cli/cli/blob/trunk/docs/install_linux.md" target="_blank">Github CLI</a>
101+
2. Move into BeSman
102+
103+
cd BeSman
95104

96-
1. Download the latest binary
105+
3. Change branch
106+
107+
git checkout <branch name>
97108

98-
curl -L https://raw.githubusercontent.com/Be-Secure/BeSman/dist/dist/get.besman.io | bash
109+
4. Run the quick_install file
99110

111+
source quick_install.sh
100112

101-
If you want to install a specific version, use the following command, replacing X.Y.Z with the desired version:
113+
This would install BeSman from your current branch.
102114

103-
export BESMAN_VERSION=X.Y.Z
104-
105-
curl -L https://raw.githubusercontent.com/Be-Secure/BeSman/dist/dist/get.besman.io | bash
115+
# Usage
106116

107-
2. Source the files into memory
117+
Below are the steps to be performed by the user of BeSman to **setup their machine**, **install an environment** and **run a playbook** to generate the assessment reports and [OSAR](https://be-secure.github.io/bes-schema/assessment-report/#open-source-assessment-report-schema-osar).
108118

109-
source $HOME/.besman/bin/besman-init.sh
119+
## 1. Initial Setup
110120

111-
3. Run the below command to confirm installation
121+
1. Configure git
122+
123+
$ git config --global user.name "Your username"
124+
$ git config --global user.email "your.email@example.com"
112125

113-
bes help
126+
2. Set BeSman variable with configured git user name for cloning artifact source code repo and assessment datastore repo.
114127

115-
# Usage
128+
$ bes set BESMAN_USER_NAMESPACE <github id/gitlab id>
129+
130+
3. Fork the required repositories. Read [here](https://github.com/Be-Secure/besecure-ce-env-repo/tree/develop?tab=readme-ov-file#2-set-your-githubgitlab-id).
131+
132+
## 2. Environment Setup
133+
134+
Read about environments from our [environment repo](https://github.com/Be-Secure/besecure-ce-env-repo).
135+
136+
### 2.1 List
137+
138+
Use the command to get the available environments for installation.
139+
140+
$ bes list -env
141+
142+
If you wish to change the repo, run the below command
143+
144+
$ bes set BESMAN_ENV_REPO <GitHub Org>/<Repo name>
145+
146+
If you wish to change the branch, run the below command
147+
148+
$ bes set BESMAN_ENV_REPO_BRANCH <branch>/<tag>
149+
150+
### 2.2 Edit environment configuration(optional)
151+
152+
`IMPORTANT`: If you are using a common environment to assess multiple artifacts,this step is required.
153+
154+
Visit [environment repo](https://github.com/Be-Secure/besecure-ce-env-repo/tree/develop?tab=readme-ov-file#41-edit-environment-configuration) to see how to edit configuration of an environment.
155+
156+
### 2.3 Install
157+
158+
From the listed environments(from above list command), choose an environment and its version for installation and run the below command
159+
160+
$ bes install -env <environment name> -V <version>
161+
162+
### 2.3 Reload environment configuration
163+
164+
The `reload` command reloads the current configuration of the environment.
165+
166+
$ bes reload
167+
168+
This is useful when,
169+
170+
1. A value for a variable has to be changed for the current environment.
171+
2. Reflecting values in a new terminal session.
172+
173+
This command only works when an environment is installed.
174+
175+
## 3. Playbook Setup
176+
177+
Read about playbooks from our [playbook repo](https://github.com/Be-Secure/besecure-playbooks-store).
178+
179+
### 3.1 List
180+
181+
Use the command to get the available playbooks for performing assessments and generate [OSAR](https://be-secure.github.io/bes-schema/assessment-report/#open-source-assessment-report-schema-osar).
182+
183+
$ bes list -P
184+
185+
If you wish to change the repo, run the below command
186+
187+
$ bes set BESMAN_PLAYBOOK_REPO <GitHub Org>/<Repo name>
188+
189+
If you wish to change the branch, run the below command
190+
191+
$ bes set BESMAN_PLAYBOOK_REPO_BRANCH <branch>/<tag>
192+
193+
### 3.2 Pull
194+
195+
Before running(execute) a playbook, you need to pull(fetch) it to your local machine,
196+
197+
$ bes pull -P <playbook name> -V <version>
198+
199+
### 3.3 Run
200+
201+
To run a playbook to generate [OSAR](https://be-secure.github.io/bes-schema/assessment-report/#open-source-assessment-report-schema-osar) and detailed assessment report,
202+
203+
$ bes run -P <playbook name> -V <version>
204+
205+
## 4. Attestation of OSAR
206+
207+
The user can run the `attest` command to attest the [OSAR](https://be-secure.github.io/bes-schema/assessment-report/#open-source-assessment-report-schema-osar) generated by the organization/individual/lab to verify the authenticity of report by any another lab/organization/individual interested in the reports generated by the former.
208+
209+
$ bes attest --file <osar file name> --path <complete path to dir containing osar file>
210+
211+
eg: bes attest --file fastjson-1.2.24-osar.json --path ~/besecure-assessment-datastore/fastjson/1.2.24/
212+
213+
# Verification of OSAR
214+
215+
The user can use the `verify` command to verify the authenticity of the OSAR generated by a lab/organization/individual.
216+
217+
**Pre-requisites**
218+
219+
1. Install BeSman.
220+
2. Download the OSAR file, public key and `.bundle` files into the same directory.
221+
222+
**Usage**
223+
224+
$ bes verify --file <osar file name> --path <complete path to the directory containing downloaded files>
225+
226+
eg: bes verify --file fastjson-1.2.24-osar.json --path ~/besecure-assessment-datastore/fastjson/1.2.24/
227+
228+
## Other commands
229+
230+
To get the complete set of commands run,
231+
232+
$ bes help
233+
234+
To get more info regarding a command
116235

117-
NAME
118-
bes - The cli for BeSman
119-
120-
SYNOPSIS
121-
bes [command] [options] [ [environment name] | [playbook name] | [version] ]
122-
123-
DESCRIPTION
124-
BeSman (pronounced as ‘B-e-S-man’) is a command-line utility designed for creating and provisioning customized security environments.
125-
It helps security professionals to reduce the turn around time for assessment of Open Source projects, AI Models, Model Datasets
126-
leaving them focus on the assessment task rather than setting up environment for it.
127-
BeSman also provides seamless support for creating and executing BeS playbooks, enabling users to automate complex workflows and tasks.
128-
With BeSman, users can efficiently manage and execute playbooks, streamlining their processes and enhancing productivity.
129-
130-
COMMANDS
131-
help: Display the help command
132-
list: List available environments, playbooks, roles.
133-
install: Install available environments.
134-
uninstall: Uninstall the installed environment.
135-
update: Update the configurations of the installed environment.
136-
validate: Validate the installtion of the environment.
137-
reset: Reset the environment to default configurations.
138-
create: Create environment script.
139-
set: Change the BeSman config variables.
140-
pull: Fetches the playbook from remote to local.
141-
run: Execute available playbooks.
142-
upgrade: Upgrade BeSman to the latest version
143-
rm | remove: Remove BeSman from machine.
144-
status: Display the list of installed environments and its current version
145-
146-
OPTIONS
147-
-env | --environment: For passing the name of the environment script.
148-
-V | --version: For passing the version number.
149-
-P | --playbook: For passing the playbook name
150-
--role: To list the role names
151-
152-
For more details execute below command
153-
$ bes help <command name>
154-
Choose command name from list of COMMANDS
155-
236+
$ bes help <command>
156237

157238
You can find more details of the command from the BeSman [webpage](https://be-secure.github.io/Be-Secure/bes-besman-details/)

0 commit comments

Comments
 (0)