Skip to content

Commit

Permalink
Syncing changes to master for 0.1.0 (#85)
Browse files Browse the repository at this point in the history
* Added requirements for environment submission. (#38)

* Added contributing and codeowners files

* Updated

* Rename CONTRIBUTING to CONTRIBUTING.md

* Updated

* Added requirements for environment submission

* updated

* Added BeSman ML assessment environment (#41)

* Added counterfit env

* Updated script

* Updated env name and config file

* Added watchtower env script

---------

Co-authored-by: Ubuntu <[email protected]>

* Ml rt env update (#42)

* updated config file

* updated ml-rt-env config file

---------

Co-authored-by: Ubuntu <[email protected]>

* Updated readme and list

* Improved info in config files

* Updated

* Updated

* Updated configs

* Update config (#44)

* updated ML config file

* updated artifat type

* Update besman-ML-RT-env-config.yaml

* Update besman-ML-RT-env.sh

* Update besman-ML-RT-env-config.yaml

* Added github id check

* Update besman-ML-RT-env-config.yaml

---------

Co-authored-by: Ubuntu <[email protected]>

* Improvde documentation, config file informations and fixed typo in list file (#45)

* Updated readme and list

* Improved info in config files

* Updated

* Updated

* Updated configs

* Updated

* Updated

* Updated

* updated config files (#49)

Co-authored-by: Ubuntu <[email protected]>

* Update besman-ML-RT-env.sh

* Renamed classic model env

* Renamed classic model env (#54)

* added cosign installation for classic model (#56)

* Added developer guide

* Added steps for testing

* Added developer guide for environments (#58)

* Updated readme and list

* Improved info in config files

* Updated

* Updated

* Updated configs

* Updated

* Updated

* Updated

* Renamed classic model env

* Added developer guide

* Added steps for testing

* Added environment metadata json

* Added environment metadata json (#60)

* Updated readme and list

* Improved info in config files

* Updated

* Updated

* Updated configs

* Updated

* Updated

* Updated

* Renamed classic model env

* Added developer guide

* Added steps for testing

* Added environment metadata json

* Updated version format

* Updated

* Adding @anilsingla

* Updated version format (#62)

* Updated readme and list

* Improved info in config files

* Updated

* Updated

* Updated configs

* Updated

* Updated

* Updated

* Renamed classic model env

* Added developer guide

* Added steps for testing

* Added environment metadata json

* Updated version format

* Updated

* Adding @anilsingla

* Uploading RT ENV for Dubbo and Struts (#61)

* Uploading RT ENV for Dubbo and Struts

* Updating the environment-metadata.json

* Updated readme file with latest avavilble env

---------

Co-authored-by: Aditi Salokhe <[email protected]>

* Updated format for environments

* Added PyRIT RT env script (#72)

* Added PyRIT RT env script

* removed bash

* updated version

* updated conda installation and uninstallation code

* Added envs for fleetbase, odxtools (#76)

* made requested changes

* performed requested changes

* Added env for LLM scan (#70)

* Added support for model scan

* Updated config for PurpleLlama

* Llm-Assessment -> LlmAssessment

* fix code for env

* Fix review comment

---------

Co-authored-by: root <[email protected]>

* Uploading RT Environment for Sechub (#78)

* Adding logstash, prometheus, privacyidea RT env (#79)

* resolving conflicts

* updating logstash, prometheus

* Updated info

* Updated info (#80)

* updated

* Removed available envs section from readme (#81)

* Updated info

* updated

* updated

* updated

* updated

---------

Co-authored-by: Pramit Kumar Dutta <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
Co-authored-by: ANIL SINGLA <[email protected]>
Co-authored-by: Aditi Salokhe <[email protected]>
Co-authored-by: Aditi Salokhe <[email protected]>
Co-authored-by: Sandhya K <[email protected]>
Co-authored-by: Sudhir Verma <[email protected]>
Co-authored-by: root <[email protected]>
  • Loading branch information
9 people authored Aug 5, 2024
1 parent 424ab7a commit ba98f83
Show file tree
Hide file tree
Showing 40 changed files with 3,964 additions and 455 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# make GitHub consider this file invalid if not commented.

# For any changes, Unless a later match takes precedence, these maintainer will be requested for review
* @asa1997 @harimohanr
*@asa1997 @harimohanr @anilsingla

# For docs and other md files
*.md @asa1997 @harimohanr @panickervinod
Expand Down
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,16 @@ Here we discuss the branching and release strategy for our projects. It ensures

- Discuss major changes or architectural decisions with the community.
- Communicate any delays or blockers promptly.

# Requirements for Submitting a New Environment

When submitting a new environment script, ensure that the following requirements are fulfilled:

1. Each environment script must be accompanied by its configuration file.
2. The mandatory fields in the configuration file must not be left empty.
3. Update the [list.txt](./list.txt) file with the environment in the format <namespace>/<repo name>/<environment name>,<version>.
4. The initial version of the environment file should be set to `0.0.1`.
5. A new version of the environment script will be treated as a distinct environment script.
6. Ensure that environment scripts include all the required [lifecycle functions](./README.md#lifecycle-functions-of-besman-environment-scripts).
7. Include all necessary tool configurations that users should be aware of at the bottom of the configuration file.

76 changes: 38 additions & 38 deletions HWC-API/0.0.1/besman-HWC-API-BT-env-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,66 +6,66 @@
# BESMAN_<var name>: <value>
# If you are not using any particular value, remove it or comment it(#).
#*** - These variables should not be removed, nor left empty.
# BESMAN_ORG - used to mention where you should clone the repo from, default value is Be-Secure
BESMAN_ORG: Be-Secure #***
# Used to mention where you should clone the repo from, default value is Be-Secure
BESMAN_ORG: Be-Secure

# BESMAN_ARTIFACT_TYPE - project/ml model/training dataset
BESMAN_ARTIFACT_TYPE: project # project/ml model/training dataset #***
# project/ml model/training dataset
BESMAN_ARTIFACT_TYPE: project

# BESMAN_ARTIFACT_NAME - name of the artifact under assessment.
BESMAN_ARTIFACT_NAME: HWC-API #***
# Name of artifact under assessment.
BESMAN_ARTIFACT_NAME: HWC-API

# BESMAN_ARTIFACT_VERSION - version of the artifact under assessment.
BESMAN_ARTIFACT_VERSION: develop #Enter the version of the artifact here. #***
# Version of artifact under assessment.
BESMAN_ARTIFACT_VERSION: develop

# BESMAN_ARTIFACT_URL - Source code url of the artifact under assessment.
BESMAN_ARTIFACT_URL: https://github.com/Be-Secure/HWC-API #***
# Source code url of artifact under assessment.
BESMAN_ARTIFACT_URL: https://github.com/Be-Secure/HWC-API

#BESMAN_ENV_NAME - This variable stores the name of the environment file.
BESMAN_ENV_NAME: HWC-API-BT-env #***
# Name of environment.
BESMAN_ENV_NAME: HWC-API-BT-env

# BESMAN_ARTIFACT_DIR - The path where you wish to clone the source code of the artifact under assessment.
# Path to clone source code of artifact under assessment.
# If you wish to change the clone path, provide the complete path.
BESMAN_ARTIFACT_DIR: $HOME/$BESMAN_ARTIFACT_NAME #***
BESMAN_ARTIFACT_DIR: $HOME/$BESMAN_ARTIFACT_NAME

# BESMAN_TOOL_PATH - The path where we download the assessment and other required tools during installation.
BESMAN_TOOL_PATH: /opt #***
# Path to download assessment and other required tools during installation.
BESMAN_TOOL_PATH: /opt

# BESMAN_LAB_TYPE - Organization/lab/individual.
BESMAN_LAB_TYPE: Organization #***
# Organization/lab/individual.
BESMAN_LAB_TYPE: Organization

# BESMAN_LAB_NAME - Name of the owner of the lab. Default is Be-Secure.
BESMAN_LAB_NAME: Be-Secure #***
# Name of lab owner. Default is Be-Secure.
BESMAN_LAB_NAME: Be-Secure

# BESMAN_ASSESSMENT_DATASTORE_DIR - This is the local dir where we store the assessment reports. Default is home.
BESMAN_ASSESSMENT_DATASTORE_DIR: $HOME/besecure-assessment-datastore #***
# Local dir to store assessment reports. Default is home.
BESMAN_ASSESSMENT_DATASTORE_DIR: $HOME/besecure-assessment-datastore

# BESMAN_ASSESSMENT_DATASTORE_URL - The remote repo where we store the assessment reports.
BESMAN_ASSESSMENT_DATASTORE_URL: https://github.com/Be-Secure/besecure-assessment-datastore #***
# Remote repo to store assessment reports.
BESMAN_ASSESSMENT_DATASTORE_URL: https://github.com/Be-Secure/besecure-assessment-datastore

# BESMAN_ANSIBLE_ROLES_PATH - The path where we download the ansible role of the assessment tools and other utilities
BESMAN_ANSIBLE_ROLES_PATH: $BESMAN_DIR/tmp/$BESMAN_ARTIFACT_NAME/roles #***
# Path to download ansible role of assessment tools and other utilities
BESMAN_ANSIBLE_ROLES_PATH: $BESMAN_DIR/tmp/$BESMAN_ARTIFACT_NAME/roles

# BESMAN_ANSIBLE_ROLES - The list of tools you wish to install. The tools are installed using ansible roles.
# To get the list of ansible roles run
# List of tools to install. Tools are installed using ansible roles.# To get the list of ansible roles run
# $ bes list --role
BESMAN_ANSIBLE_ROLES: Be-Secure/ansible-role-bes-java,Be-Secure/ansible-role-oah-maven,Be-Secure/ansible-role-oah-eclipse #add the roles here. format - <Github id>/<repo name>,<Github id>/<repo name>,<Github id>/<repo name>,... #***
# add the roles here. format - <Github id>/<repo name>,<Github id>/<repo name>,<Github id>/<repo name>,...
BESMAN_ANSIBLE_ROLES: Be-Secure/ansible-role-bes-java,Be-Secure/ansible-role-oah-maven,Be-Secure/ansible-role-oah-eclipse

# BESMAN_ARTIFACT_TRIGGER_PLAYBOOK_PATH - sets the path of the playbook with which we run the ansible roles.
# Path of the playbook with which we run the ansible roles.
# Default path is ~/.besman/tmp/<artifact name dir>/
BESMAN_ARTIFACT_TRIGGER_PLAYBOOK_PATH: $BESMAN_DIR/tmp/$BESMAN_ARTIFACT_NAME #***
BESMAN_ARTIFACT_TRIGGER_PLAYBOOK_PATH: $BESMAN_DIR/tmp/$BESMAN_ARTIFACT_NAME

#BESMAN_ARTIFACT_TRIGGER_PLAYBOOK - Name of the trigger playbook which runs the ansible roles.
BESMAN_ARTIFACT_TRIGGER_PLAYBOOK: besman-$BESMAN_ARTIFACT_NAME-BT-trigger-playbook.yaml #***
# Name of trigger playbook which runs the ansible roles.
BESMAN_ARTIFACT_TRIGGER_PLAYBOOK: besman-$BESMAN_ARTIFACT_NAME-BT-trigger-playbook.yaml

# BESMAN_DISPLAY_SKIPPED_ANSIBLE_HOSTS - If the users likes to display all the skipped steps, set it to true.
# Display all the skipped steps, set it to true.
# Default value is false
BESMAN_DISPLAY_SKIPPED_ANSIBLE_HOSTS: false #***
BESMAN_DISPLAY_SKIPPED_ANSIBLE_HOSTS: false


# The default values of the ansible roles will be present in their respective repos.
# You can go to https://github.com/Be-Secure/<repo of the ansible role>/blob/main/defaults/main.yml.
# If you wish to change the default values copy the variable from the https://github.com/Be-Secure/<repo of the ansible role>/blob/main/defaults/main.yml
# Default values of ansible roles will be present in their respective repos.
# Check https://github.com/Be-Secure/<repo of the ansible role>/blob/main/defaults/main.yml.
# To change the default values copy variable from https://github.com/Be-Secure/<repo of the ansible role>/blob/main/defaults/main.yml
# and paste it here and change the value.
# Format is <variable name>: <value>
# Eg: openjdk_version: 11
Expand Down
51 changes: 51 additions & 0 deletions LlmAssessment/0.0.1/besman-LlmAssessment-RT-env-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# If you wish to update the default configuration values, copy this file and place it under your home dir, under the same name.
# These variables are used to drive the installation of the environment script.
# The variables that start with BESMAN_ are converted to environment vars.
# If you wish to add any other vars that should be used globally, add the var using the below format.
# BESMAN_<var name>: <value>
# If you are not using any particular value, remove it or comment it(#).
#*** - These variables should not be removed, nor left empty.

# BESMAN_ARTIFACT_TYPE - project/ml model/training dataset
BESMAN_ARTIFACT_TYPE: model

# BESMAN_ARTIFACT_NAME - name of the artifact under assessment.
BESMAN_ARTIFACT_NAME: "" #***

# BESMAN_ARTIFACT_VERSION - version of the artifact under assessment.
BESMAN_ARTIFACT_VERSION: ""

# BESMAN_ARTIFACT_URL - Source code url of the artifact under assessment.
BESMAN_ARTIFACT_URL: "" #***

#BESMAN_ENV_NAME - This variable stores the name of the environment file.
BESMAN_ENV_NAME: LlmAssessment-RT-env #***

# BESMAN_ARTIFACT_DIR - The path where you wish to clone the source code of the artifact under assessment.
# If you wish to change the clone path, provide the complete path.
#BESMAN_ARTIFACT_DIR: $HOME/$BESMAN_ARTIFACT_NAME #***

# BESMAN_TOOL_PATH - The path where we download the assessment and other required tools during installation.
BESMAN_TOOL_PATH: /opt #***

# BESMAN_LAB_TYPE - Organization. This variable indicates the individual's lab affiliation
BESMAN_LAB_TYPE: Organization #***

# BESMAN_LAB_NAME - Name of the lab. Default is Be-Secure. This variable indicates the individual's lab affiliation
BESMAN_LAB_NAME: Be-Secure #***

# BESMAN_ASSESSMENT_DATASTORE_DIR - This is the local dir where we store the assessment reports. Default is home.
BESMAN_ASSESSMENT_DATASTORE_DIR: $HOME/besecure-ml-assessment-datastore #***

# BESMAN_ASSESSMENT_DATASTORE_URL - The remote repo where we store the assessment reports.
BESMAN_ASSESSMENT_DATASTORE_URL: https://github.com/Be-Secure/besecure-ml-assessment-datastore #***

# Remote repo from PURPLELAMA will be installed.
BESMAN_PURPLELAMA_URL: https://github.com/Be-Secure/PurpleLlama.git

# PURPLELAMA remote repo branch
BESMAN_PURPLELAMA_BRANCH: main

# Path where it should config
BESMAN_PURPLELAMA_LOCAL_PATH: $HOME/LlmAssessment
80 changes: 80 additions & 0 deletions LlmAssessment/0.0.1/besman-LlmAssessment-RT-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/bash

function __besman_install
{
__besman_check_github_id || return 1
__besman_echo_white "Starting PurpleLama Installation..."
install_purpleLlama || return 1
__besman_echo_white "Purplelama environment installation completed!"

}

function __besman_uninstall
{
__besman_echo_white "uninstall PurpleLama..."
uninstall_PurpleLlama
}

function __besman_update
{
echo "Reset method not implemented yet."
}

function __besman_validate
{
echo "Reset method not implemented yet."
}

function __besman_reset
{
echo "Reset method not implemented yet."
}


function install_purpleLlama()
{
echo "Cloning the PurpleLama repository..."
git clone --single-branch --branch $BESMAN_PURPLELAMA_BRANCH $BESMAN_PURPLELAMA_URL $BESMAN_PURPLELAMA_LOCAL_PATH
if [["$?" != 0]]; then
echo "error while cloning"
return 1
fi
echo "Installing required dependency..."
sudo apt -y update
sudo apt -y upgrade
sudo apt install -y python3-pip
apt install -y cargo
apt install python3.10-venv
cargo install weggli --rev=9d97d462854a9b682874b259f70cc5a97a70f2cc --git=https://github.com/weggli-rs/weggli
export WEGGLI_PATH=weggli
python3 -m venv ~/.venvs/CybersecurityBenchmarks
source ~/.venvs/CybersecurityBenchmarks/bin/activate
export DATASETS=$PWD/CybersecurityBenchmarks/datasets
if [["$?" != 0]]; then
echo "error while installing dependency"
return 1
fi
echo "Installing Python packages from requirements.txt..."
cd $BESMAN_PURPLELAMA_LOCAL_PATH
pip3 install -r CybersecurityBenchmarks/requirements.txt
python3 -m CybersecurityBenchmarks.benchmark.run --help
if [["$?" != 0]]; then
echo "error while installing packages"
return 1
fi
}

function uninstall_PurpleLlama()
{
read -p "${bold}Do you want to remove the directory '$BESMAN_PURPLELAMA_LOCAL_PATH'? (y/n): " response
if [[ "$response" == "y" || "$response" == "Y" || "$response" == "Yes" || "$response" == "yes" ]]; then
if rm -rf $BESMAN_PURPLELAMA_LOCAL_PATH; then
echo "Directory '$BESMAN_PURPLELAMA_LOCAL_PATH' has been removed."
else
echo "Failed to remove the directory '$BESMAN_PURPLELAMA_LOCAL_PATH'."
fi
else
echo "Skipping the removal of '$BESMAN_PURPLELAMA_LOCAL_PATH' directory..."
fi
}

71 changes: 71 additions & 0 deletions PyRIT/0.0.1/besman-PyRIT-RT-env-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
# If you wish to update the default configuration values, copy this file and place it under your home dir, under the same name.
# These variables are used to drive the installation of the environment script.
# The variables that start with BESMAN_ are converted to environment vars.
# If you wish to add any other vars that should be used globally, add the var using the below format.
# BESMAN_<var name>: <value>
# If you are not using any particular value, remove it or comment it(#).
#*** - These variables should not be removed, nor left empty.
# used to mention where you should clone the repo from, default value is Be-Secure
BESMAN_ORG: Be-Secure #***

# project/ml model/training dataset
BESMAN_ARTIFACT_TYPE: project

# Name of the artifact under assessment.
BESMAN_ARTIFACT_NAME: PyRIT #***

# Version of the artifact under assessment.
BESMAN_ARTIFACT_VERSION: v0.3.0

# Source code url of the artifact under assessment.
BESMAN_ARTIFACT_URL: https://github.com/Be-Secure/PyRIT #***

# This variable stores the name of the environment file.
BESMAN_ENV_NAME: PyRIT-RT-env #***

# The path where you wish to clone the source code of the artifact under assessment.
# If you wish to change the clone path, provide the complete path.
BESMAN_ARTIFACT_DIR: $HOME/$BESMAN_ARTIFACT_NAME #***

# The path where we download the assessment and other required tools during installation.
BESMAN_TOOL_PATH: /opt #***

# Organization/lab/individual.
BESMAN_LAB_TYPE: Organization #***

# Name of the owner of the lab. Default is Be-Secure.
BESMAN_LAB_NAME: Be-Secure #***

# This is the local dir where we store the assessment reports. Default is home.
BESMAN_ASSESSMENT_DATASTORE_DIR: $HOME/besecure-assessment-datastore #***

# The remote repo where we store the assessment reports.
BESMAN_ASSESSMENT_DATASTORE_URL: https://github.com/Be-Secure/besecure-assessment-datastore #***

# The path where we download the ansible role of the assessment tools and other utilities
BESMAN_ANSIBLE_ROLES_PATH: $BESMAN_DIR/tmp/$BESMAN_ARTIFACT_NAME/roles #***

# The list of tools you wish to install. The tools are installed using ansible roles.
# To get the list of ansible roles run
# $ bes list --role
#add the roles here. format - <Github id>/<repo name>,<Github id>/<repo name>,<Github id>/<repo name>,... #***
BESMAN_ANSIBLE_ROLES: Be-Secure/ansible-role-oah-sonarQube,Be-Secure/ansible-role-oah-sbomGenerator,Be-Secure/ansible-role-oah-fossology

# sets the path of the playbook with which we run the ansible roles.
# Default path is ~/.besman/tmp/<artifact name dir>/
BESMAN_ARTIFACT_TRIGGER_PLAYBOOK_PATH: $BESMAN_DIR/tmp/$BESMAN_ARTIFACT_NAME #***

# Name of the trigger playbook which runs the ansible roles.
BESMAN_ARTIFACT_TRIGGER_PLAYBOOK: besman-$BESMAN_ARTIFACT_NAME-RT-trigger-playbook.yaml #***

# If the users likes to display all the skipped steps, set it to true.
# Default value is false
BESMAN_DISPLAY_SKIPPED_ANSIBLE_HOSTS: false #***

# The default values of the ansible roles will be present in their respective repos.
# You can go to https://github.com/Be-Secure/<repo of the ansible role>/blob/main/defaults/main.yml.
# If you wish to change the default values copy the variable from the https://github.com/Be-Secure/<repo of the ansible role>/blob/main/defaults/main.yml
# and paste it here and change the value.
# Format is <variable name>: <value>
# Eg: openjdk_version: 11
Loading

0 comments on commit ba98f83

Please sign in to comment.