From d006029f1e46726719f149a296b6234a066820c8 Mon Sep 17 00:00:00 2001 From: rabsondev Date: Mon, 18 Mar 2024 13:53:11 +0000 Subject: [PATCH] Update references to OXO --- README.md | 24 ++++++++++++------------ agent/semgrep_agent.py | 1 + agent/utils.py | 1 + ostorlab.yaml | 24 ++++++++++++------------ tests/conftest.py | 1 + tests/semgrep_agent_test.py | 1 + tests/utils_test.py | 1 + 7 files changed, 29 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 2688b1a..82a542e 100644 --- a/README.md +++ b/README.md @@ -11,35 +11,35 @@ _Semgrep is a fast, open-source, static analysis engine for finding bugs, detect --- -This repository is an implementation of [Ostorlab Agent](https://pypi.org/project/ostorlab/) for [Semgrep](https://github.com/returntocorp/semgrep). +This repository is an implementation of [OXO Agent](https://pypi.org/project/ostorlab/) for [Semgrep](https://github.com/returntocorp/semgrep). ## Getting Started To perform your first analysis, simply run the following command. ```shell -ostorlab scan run --install --agent agent/ostorlab/semgrep file code.c +oxo scan run --install --agent agent/ostorlab/semgrep file code.c ``` This command will download and install `agent/ostorlab/semgrep` and analyze the source file `code.c`. -For more information, please refer to the [Ostorlab Documentation](https://github.com/Ostorlab/ostorlab/blob/main/README.md) +For more information, please refer to the [OXO Documentation](https://oxo.ostorlab.co/docs) ## Usage -Agent Semgrep can be installed directly from the ostorlab agent store or built from this repository. +Agent Semgrep can be installed directly from the oxo agent store or built from this repository. - ### Install directly from ostorlab agent store + ### Install directly from oxo agent store ```shell - ostorlab agent install agent/ostorlab/semgrep + oxo agent install agent/ostorlab/semgrep ``` You can then run the agent with the following command: -`ostorlab scan run --install --agent agent/ostorlab/semgrep file code.c` +`oxo scan run --install --agent agent/ostorlab/semgrep file code.c` ### Build directly from the repository - 1. To build the semgrep agent you need to have [ostorlab](https://pypi.org/project/ostorlab/) installed in your machine. If you have already installed ostorlab, you can skip this step. + 1. To build the semgrep agent you need to have [oxo](https://pypi.org/project/ostorlab/) installed in your machine. If you have already installed oxo, you can skip this step. ```shell pip3 install ostorlab @@ -51,21 +51,21 @@ pip3 install ostorlab git clone https://github.com/Ostorlab/agent_semgrep.git && cd agent_semgrep ``` - 3. Build the agent image using ostorlab cli. + 3. Build the agent image using oxo cli. ```shell - ostorlab agent build --file=ostorlab.yaml + oxo agent build --file=ostorlab.yaml ``` You can pass the optional flag `--organization` to specify your organisation. The organization is empty by default. 4. Run the agent using on of the following commands: * If you did not specify an organization when building the image: ```shell - ostorlab scan run --agent agent//semgrep file code.c + oxo scan run --agent agent//semgrep file code.c ``` * If you specified an organization when building the image: ```shell - ostorlab scan run --agent agent/[ORGANIZATION]/semgrep file code.c + oxo scan run --agent agent/[ORGANIZATION]/semgrep file code.c ``` diff --git a/agent/semgrep_agent.py b/agent/semgrep_agent.py index cf8a8a4..5a72ccf 100644 --- a/agent/semgrep_agent.py +++ b/agent/semgrep_agent.py @@ -1,4 +1,5 @@ """Ostorlab Agent implementation for Semgrep""" + import json import logging import subprocess diff --git a/agent/utils.py b/agent/utils.py index 98dc5f9..b17aa92 100644 --- a/agent/utils.py +++ b/agent/utils.py @@ -1,4 +1,5 @@ """Utilities for Semgrep Agent""" + import dataclasses import mimetypes import requests diff --git a/ostorlab.yaml b/ostorlab.yaml index 7db879d..990ab69 100644 --- a/ostorlab.yaml +++ b/ostorlab.yaml @@ -2,27 +2,27 @@ kind: Agent name: semgrep version: 0.3.2 description: | - This repository is an implementation of [Ostorlab Agent](https://pypi.org/project/ostorlab/) for [Semgrep](https://github.com/returntocorp/semgrep) by r2c. + This repository is an implementation of [OXO Agent](https://pypi.org/project/ostorlab/) for [Semgrep](https://github.com/returntocorp/semgrep) by r2c. ## Getting Started To perform your first scan, simply run the following command: ```shell - ostorlab scan run --install --agent agent/ostorlab/semgrep file code.c + oxo scan run --install --agent agent/ostorlab/semgrep file code.c ``` This command will download and install `agent/ostorlab/semgrep` and analyze the file `code.c`. - For more information, please refer to the [Ostorlab Documentation](https://github.com/Ostorlab/ostorlab/blob/main/README.md) + For more information, please refer to the [OXO Documentation](https://oxo.ostorlab.co/docs) ## Usage - Agent Semgrep can be installed directly from the ostorlab agent store or built from this repository. + Agent Semgrep can be installed directly from the oxo agent store or built from this repository. - ### Install directly from ostorlab agent store + ### Install directly from oxo agent store ```shell - ostorlab agent install agent/ostorlab/semgrep + oxo agent install agent/ostorlab/semgrep ``` You can then run the agent with the following command: ```shell - ostorlab scan run --install --agent agent/ostorlab/semgrep file code.c + oxo scan run --install --agent agent/ostorlab/semgrep file code.c ``` ### Build directly from the repository - 1. To build the semgrep agent you need to have [ostorlab](https://pypi.org/project/ostorlab/) installed in your machine. if you have already installed ostorlab, you can skip this step. + 1. To build the semgrep agent you need to have [oxo](https://pypi.org/project/ostorlab/) installed in your machine. if you have already installed oxo, you can skip this step. ```shell pip3 install ostorlab ``` @@ -30,19 +30,19 @@ description: | ```shell git clone https://github.com/Ostorlab/agent_semgrep.git && cd agent_semgrep ``` - 3. Build the agent image using ostorlab cli. + 3. Build the agent image using oxo cli. ```shell - ostorlab agent build --file=ostorlab.yaml + oxo agent build --file=ostorlab.yaml ``` You can pass the optional flag `--organization` to specify your organisation. The organization is empty by default. 4. Run the agent using on of the following commands: * If you did not specify an organization when building the image: ```shell - ostorlab scan run --agent agent//semgrep file code.c + oxo scan run --agent agent//semgrep file code.c ``` * If you specified an organization when building the image: ```shell - ostorlab scan run --agent agent/[ORGANIZATION]/semgrep file code.c + oxo scan run --agent agent/[ORGANIZATION]/semgrep file code.c ``` ## License [Apache-2.0](./LICENSE) diff --git a/tests/conftest.py b/tests/conftest.py index 0c64e90..8890ea8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ """conftest for semgrep agent tests""" + import random import pathlib from typing import Any, cast diff --git a/tests/semgrep_agent_test.py b/tests/semgrep_agent_test.py index f2ce4a1..bb0e5b7 100644 --- a/tests/semgrep_agent_test.py +++ b/tests/semgrep_agent_test.py @@ -1,4 +1,5 @@ """Unittests for Semgrep agent.""" + import subprocess from ostorlab.agent.message import message diff --git a/tests/utils_test.py b/tests/utils_test.py index fb165b9..83a3a3d 100644 --- a/tests/utils_test.py +++ b/tests/utils_test.py @@ -1,4 +1,5 @@ """Unittests for Semgrep Agent Utilities""" + from typing import Any import requests