Skip to content

Commit

Permalink
V3.12 Specification Implementation (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgedias authored Oct 12, 2023
1 parent 8ed8cf7 commit 6b68476
Show file tree
Hide file tree
Showing 24 changed files with 1,017 additions and 507 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +67,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Copy Markdown Files to gh_pages
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build Deploment Folder 🔧
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/push-to-docker-mail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout the emasser Repository
uses: actions/checkout@v3
- name: Checkout the eMASSer Repository
uses: actions/checkout@v4
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push-to-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -24,10 +24,10 @@ jobs:
replace-with: ''
flags: 'g'
- name: Checkout the emasser Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- name: Setup ruby
uses: actions/setup-ruby@v1
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch origin +refs/tags/*:refs/tags/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch origin +refs/tags/*:refs/tags/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: crazy-max/ghaction-chocolatey@v1
with:
args: install curl -y
Expand Down
54 changes: 52 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,59 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Harden the docker container (ex. non root user, etc).
## [3.12.0] Oct 11, 2023
### Changes
- Implemented eMASS API V3.12 specifications (to include previous updates)

## [3.10.0] Jun 27, 2023
### Changes
- Implemented eMASS API 3.10 specifications

## [3.4.1] Oct 7, 2022
### Changes
- Included the ability to register NPE credentials and obtain the Api key api-key

## [3.4.0] Sep 22, 2022
### Changes
- Implemented API specifications V3.4
- Changed release version to match API specificationa

## [1.0.6] Jun 17, 2022
### Changes
- addMultiplePackages

## [1.0.3] Jan 14, 2022
### Changes
- UpdateVersionTags

## [1.0.2] Jan 14, 2022
### Changes
- updateCLI_Help

## [1.0.1] Jan 3, 2022
### Changes
- Rename swagger_client to emass_client and publish it to rubygems.

## [1.0.0] - Dec 29, 2021
### Changes
- addReleaseWorkflow @georgedias (#26)
- create test-cli workflow @georgedias (#25)
- Add cli tests @georgedias (#24)
- Add the stoplight prism mock server as a server selection @georgedias (#23)
- Update eMASSRestOpenApi.yaml @georgedias (#22)
- ci(Mergify): configuration update @camdenmoors (#21)
- fix_gh_pages @georgedias (#18)
- Fixed the removal of jekyll thene when updating the gh_pages @georgedias (#17)
- Add workflow to update markdown files in gh-pages @georgedias (#15)
- Udates to the emasser features documentation @georgedias (#13)
- corrected controls post/put requests @georgedias (#9)
- Added eMASS contact information to the README @georgedias (#8)
- Update eMASSOpenAPI specification, add redoc and swagger documentation @rbclark (#6)

### Features

- Initial workflow configuration @georgedias (#10)

## [0.2.0] - 2020-12-14
### Added
- Scaffolding for the emasser project including such things as a Dockerfile, a .gitlab-ci.yml, some repository dependencies such as `standard` and `minitest`, and some gem dependencies such as `thor`.
Expand Down
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
PATH
remote: .
specs:
emasser (3.4.1)
emasser (3.12.0)
activesupport (>= 6.1.4, < 7.1.0)
colorize (~> 0.8.1)
dotenv (~> 2.7.6)
emass_client (~> 3.10)
emass_client (~> 3.12)
rubyzip (~> 2.3.2)
thor (~> 1.1.0)

GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.5)
activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -26,16 +26,16 @@ GEM
concurrent-ruby (1.2.2)
diff-lcs (1.5.0)
dotenv (2.7.6)
emass_client (3.10.1)
emass_client (3.12.0)
typhoeus (~> 1.0, >= 1.0.1)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
ffi (1.15.5-x64-mingw32)
ffi (1.16.3)
ffi (1.16.3-x64-mingw32)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
minitest (5.18.1)
minitest (5.20.0)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
Expand Down
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# emasser
# eMASSer
![GitHub Release Date](https://img.shields.io/github/release-date/mitre/emasser?label=Release%20Date&logo=github&color=blue)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/mitre/emasser?label=Release%20Version&logo=github) ![Gem](https://img.shields.io/gem/v/emasser?label=gem%20version&logo=ruby&logoColor=red) ![Docker Version](https://img.shields.io/docker/v/mitre/emasser?label=docker%20version&logo=docker&sort=semver)

Expand All @@ -9,29 +9,29 @@

## About

`emasser` is a Command Line Interface (CLI) that aims to automate routine business use-cases and provide utility surrounding the Enterprise Mission Assurance Support Service (eMASS) by leveraging its Representational State Transfer (REST) Application Programming Interface (API).
`eMASSer` is a Command Line Interface (CLI) that aims to automate routine business use-cases and provide utility surrounding the Enterprise Mission Assurance Support Service (eMASS) by leveraging its Representational State Transfer (REST) [Application Programming Interface (API)](https://mitre.github.io/emass_client/docs/eMASS_API_Documentation.pdf).

***NOTE***: The `emasser` CLI utilizes the [emass_client](https://github.com/mitre/emass_client) RubyGem executable package to access the eMASS API endpoints.
***NOTE***: The `eMASSer` CLI utilizes the [emass_client](https://github.com/mitre/emass_client) RubyGem executable package to access the eMASS API endpoints.

---
## Documentation
For detail content information about the `eMASS` API references the [**eMASS API Specification**](https://mitre.github.io/emass_client/docs/redoc/) page.

For detail features provided by the `emasser` CLI references the [**emasser CLI Features**](docs/features.md) page.
For detail features provided by the `eMASSer` CLI references the [**eMASSer CLI Features**](docs/features.md) page.

The `emasser` CLI [**Architecture**](#emasser-cli-architecture) depicts the `emasser` structure, and provides an explanation of how it behaves.
The `eMASSer` CLI [**Architecture**](#emasser-cli-architecture) depicts the structure, and provides an explanation of CLI behaviors.

---
## Installation Options

`emasser` is a Ruby CLI distributed via GitHub (this repository), [RubyGems](https://rubygems.org/gems/emass_client/versions/), or [Docker](https://hub.docker.com/r/mitre/emasser/tags).
`eMASSer` is a Ruby CLI distributed via GitHub (this repository), [RubyGems](https://rubygems.org/gems/emass_client/versions/), or [Docker](https://hub.docker.com/r/mitre/emasser/tags).

### Installation Dependencies
* git
* Ruby version 2.7 or greater

### Runtime Dependencies
* Ruby version 2.7 or greater.
### Runtime Major Dependencies
* Ruby version 2.7 or greater
* `rubyzip (latest version)`
* `emass_client (latest version)`
* On Windows the `cURL` binary is required (libcurl.dll). To install cURL:
Expand All @@ -41,6 +41,7 @@ The `emasser` CLI [**Architecture**](#emasser-cli-architecture) depicts the `ema
- Extract the file into the Ruby installation /bin directory
- Rename the file to `libcurl.dll` if it has the `_x64` suffix
- Install [cURL for windows](https://community.chocolatey.org/packages/curl) and add the installation directory to the PATH.
* See the `emasser.gemspec` file for all other dependencies


## Install via GitHub
Expand All @@ -49,7 +50,7 @@ The `emasser` CLI [**Architecture**](#emasser-cli-architecture) depicts the `ema
git clone <path to emasser repository> emasser
cd emasser
```
- Build the emasser gem*
- Build the eMASSer gem*
```bash
gem build *.gemspec
gem install *.gem
Expand Down Expand Up @@ -81,7 +82,7 @@ bundle exec exe/emasser [command]
***Note:** See [Setting Environment Variables Configuration](https://github.com/mitre/emasser/wiki/Editing-Environment-Variables-Configuration) for detailed information on required and optional variables.
## Using Docker
Ensure that docker engine is running and start the emasser Docker Container.
Ensure that docker engine is running and start the eMASSer Docker Container.
### Install
- On Linux or Mac:
```
Expand Down Expand Up @@ -109,7 +110,7 @@ Ensure that docker engine is running and start the emasser Docker Container.
```
- See [Editing Environment Variables Configuration](https://github.com/mitre/emasser/wiki/Editing-Environment-Variables-Configuration)
### Run emasser API client commands
### Run eMASSer API client commands
- To list all available GET, POST, PUT, or DELETE commands use:
```
docker run --rm -v $PWD/path-to-secrets:/data mitre/emasser:latest get help
Expand All @@ -132,7 +133,7 @@ Ensure that docker engine is running and start the emasser Docker Container.
---
## Roadmap
The `emasser` implements all endpoints provided by the `eMASS` API, there is, all of the functions available from the `eMASS GUI` that are exposed by the API. If additional functions are useful (accessible via the CLI), please submit a request to [eMass Tier III Support](mailto:[email protected]) for possible inclusion into the API.
The `eMASSer` implements all endpoints provided by the `eMASS` API, there is, all of the functions available from the `eMASS GUI` that are exposed by the API. If additional functions are useful (accessible via the CLI), please submit a request to [eMass Tier III Support](mailto:[email protected]) for possible inclusion into the API.
The Road Map seeks to add any useful features that facilitates organization that utilizes `eMASS` instances and have a need to automate their cybersecurity management process.
Expand All @@ -147,13 +148,13 @@ Some proposed capabilities (looking for a sponsor) are:
## Design
### Interactions with eMASS API
The `emasser` CLI leverages the [emass_client](https://github.com/mitre/emass_client), which provides a REST API client developed by MITRE based on the [OpenAPI V3](https://www.openapis.org/) standards for the official [eMASS API specification](https://mitre.github.io/emass_client/docs/redoc). This design enables REST API clients to be generated in [any supported programming language](https://openapi-generator.tech/docs/generators/). The design enables the `emass_client` to be generated independently of the emasser CLI. Currently, a Ruby and a Typescript eMASS client API are provided. The TypeScript client is used with the [Security Automation Framework CLI (SAF) CLI](https://github.com/mitre/saf).
The `eMASSer` CLI leverages the [emass_client](https://github.com/mitre/emass_client), which provides a REST API client developed by MITRE based on the [OpenAPI V3](https://www.openapis.org/) standards for the official [eMASS API specification](https://mitre.github.io/emass_client/docs/redoc). This design enables REST API clients to be generated in [any supported programming language](https://openapi-generator.tech/docs/generators/). The design enables the `emass_client` to be generated independently of the eMASSer CLI. Currently, a Ruby and a Typescript eMASS client API are provided. The TypeScript client is used with the [Security Automation Framework CLI (SAF) CLI](https://github.com/mitre/saf).
### Business Logic
Because interactions with the API are handled by a dependency, the bulk of `emasser` business logic is for accepting user input/output, reading data from eMASS or from input, transforming data, and routing data to the appropriate eMASS API endpoint. This business logic is organized into Ruby Classes and Modules based on the command or subcommand requested by the user.
Because interactions with the API are handled by a dependency, the bulk of `eMASSer` business logic is for accepting user input/output, reading data from eMASS or from input, transforming data, and routing data to the appropriate eMASS API endpoint. This business logic is organized into Ruby Classes and Modules based on the command or subcommand requested by the user.
## Emasser CLI Architecture
The `emasser` CLI makes use of the `emass_client` ruby gem to communicate with an `eMASS` instance via the `eMASS API` as depicted in the diagram below:
## eMASSer CLI Architecture
The `eMASSer` CLI makes use of the `emass_client` ruby gem to communicate with an `eMASS` instance via the `eMASS API` as depicted in the diagram below:
<div align="center">
<img src="images/emasser_architecture.jpg" alt="emasser CLI Architecture" title="emasser CLI Architecture">
Expand Down
Loading

0 comments on commit 6b68476

Please sign in to comment.