Skip to the content.

eMASSer CLI Features

Environment Variables

To facilitate setting the required environment variables the eMASSer CLI utilized the zero-dependency module to load these variables from a .env file.

Configuring the .env File

An .env-example file is provided with the required and optional fields.

Modify the .env_example as necessary and save it as a .env file.

Place the file on the path where the eMASSer command is executed.

Required and Optional Environment Variables

The following environment variables are required:

The following environment variables are optional*:

* If not provided defaults are used

The proper format to set these variables in the .env files is as follows:

export [VARIABLE_NAME]='value'

NOTE eMASSer requires authentication to an eMASS instance as well as authorization to use the eMASS API. This authentication and authorization is not a function of eMASSer and needs to be accomplished with the eMASS instances owner organization. Further information about eMASS credential requirements refer to Defense Counterintelligence and Security Agency about eMASS access.


Common eMASSer Endpoint Requests Information

Invoking eMASSer CLI Commands

The CLI invoke commands listed in this document shows them when executing from the source code (after a pull from GitHub). Please reference the eMASSer README on how to invoke the CLI using other available executables (gem or docker).

GET Endpoints

Test Connection

System Endpoints

System Roles Endpoints

Controls Endpoint

Test Results Endpoint

POA&Ms Endpoints

Milestones Endpoints

Artifacts Endpoints

CAC Endpoint

PAC Endpoint

CMMC Assessment Endpoint

Workflow Definition Endpoint

Workflow Instances Endpoint

Dashboards

System Status Dashboard

Enterprise Terms Conditions Dashboard

Enterprise Security Controls Dashboard

Enterprise POA&M Dashboard

Enterprise Artifacts Dashboard

Hardware Baseline Dashboard

Enterprise Sensor-based Hardware Resources Dashboard

Software Baseline Dashboard

Enterprise Sensor-based Software Resources Dashboard

Enterprise Vulnerability Dashboard

Ports and Protocols Dashboard

System CONMON Integration Status Dashboard

System Associations Dashboard

Users Dashboard

Privacy Compliance Dashboard

System A&A Summary Dashboard

System A2.0 Summary Dashboard

System P.L. 109 Reporting Summary Dashboard

FISMA Inventory Summary Dashboard

Threat Risks Dashboard

POST Endpoints

PUT Endpoints

DELETE Endpoints

Endpoints CLI help

Each CLI endpoint command has several layers of help.

Usage - GET

get test connection


The Test Connection endpoint provides the ability to verify connection to the web service.

$ bundle exec exe/emasser get test connection

A return of success from the call indicates that the CLI can reach the configure server URL. References Required Environment Variables for the necessary environment variables.

top

get system


The get system command is not a sanctioned eMASS endpoint, it makes use of the get systems endpoint with added business logic.

There are two commands provided by the get system:

get system id

Retrieves a system identification based on the SYSTEM_NAME (name) or SYSTEM_OWNER (systemOwner) fields.

To invoke the get system id use the following command:

$ bundle exec exe/emasser get system id --system_name "system name" --system_owner "system owner"

If using a platform that has awk installed the following command can be used to return only the system Id:

$ bundle exec exe/emasser get system --system_name "system name" --system_owner "system owner" | awk "{ print $1 }" 

get system byId

Retrieves the system content for provided identification (ID) number. To invoke the endpoint use the following command:

$ bundle exec exe/emasser get system byId

top

get systems


To retrieve controls use the following command:

top

get roles


There are two get endpoints for system roles:

top

get controls


To retrieve controls use the following command:

$ bundle exec exe/emasser get controls forSystem -s, --systemId=SYSTEMID

top

get test_results


To retrieve test results use the following command:

$ bundle exec exe/emasser get test_results forSystem -s, --systemId=SYSTEMID

top

get poams


There are two get endpoints for system poams:

top

get milestones


There are two get endpoints for system milestones:

top

get artifacts


There are two get endpoints that provides the ability to view existing Artifacts in a system:

top

get cac


To view one or many Control Approval Chain (CAC) in a system specified system ID use the following command:

  $ bundle exec exe/emasser get cac controls -s, --systemId=SYSTEMID

top

get pac


To view one or many Package Approval Chain (PAC) in a system specified system ID use the following command:

  $ bundle exec exe/emasser get pac package -s, --systemId=SYSTEMID

top

get cmmc


To view Cybersecurity Maturity Model Certification (CMMC) Assessments use the following command:

$ bundle exec exe/emasser get cmmc assessments -d, --sinceDate=SINCEDATE 

top

get workflow_definitions


To view Workflow Definitions use the following command:

$ bundle exec exe/emasser get workflow_definitions forSite

top

get workflow_instances


There are two get endpoints to view workflow instances:

top

get dashboards


The Dashboards endpoints provide the ability to view data contained in dashboard exports. In the eMASS front end, these dashboard exports are generated as Excel exports.

All endpoint calls utilize the same parameter values, they are:

System Status Endpoint

Enterprise Sensor-based Software Resources Endpoints

System CONMON Integration Status Endpoint

Usage - POST

post test_results


Test Result add (POST) endpoint API business rules.

Business Rule Parameter/Field
Tests Results cannot be saved if the “Test Date” is in the future. testDate
Test Results cannot be saved if a Security Control is “Inherited” in the system record. description
Test Results cannot be saved if an Assessment Procedure is “Inherited” in the system record. description
Test Results cannot be saved if the AP does not exist in the system. description
Test Results cannot be saved if the control is marked “Not Applicable” by an Overlay. description
Test Results cannot be saved if the control is required to be assessed as “Applicable” by an Overlay. description
Test Results cannot be saved if the Tests Results entered is greater than 4000 characters. description
Test Results cannot be saved if the following fields are missing data: complianceStatus, testDate, testedBy, description
Test results cannot be saved if there is more than one test result per CCI cci

To add (POST) test results use the following command:

  $ bundle exec exe/emasser post test_results add -s, --systemId [value] --cci [value] --testedBy [value] --testDate [value] --description [value] --complianceStatus [value]

Note: If no POA&Ms or AP exist for the control (system), you will get this response: “You have entered a Non-Compliant Test Result. You must create a POA&M Item for this Control and/or AP if one does not already exist.”

Note For information at the command line use:

$ bundle exec exe/emasser post test_results help add

top

post poams


Plan of Action and Milestones (POA&M) add (POST) endpoint API business rules.

The following fields are required based on the contents of the status field

status Required Fields
Risk Accepted comments
Ongoing scheduledCompletionDate, milestones (at least 1)
Completed scheduledCompletionDate, comments, completionDate, milestones (at least 1)
Not Applicable POAM can not be created

If a POC email is supplied, the application will attempt to locate a user already registered within the application and pre-populate any information not explicitly supplied in the request. If no such user is found, these fields are required within the request.

Business logic, the following rules apply when adding POA&Ms

The following POA&M parameters/fields have the following character limitations:

To add (POST) POA&Ms use the following command:

$ bundle exec exe/emasser post poams add -s, --systemId [value] --status [value] --vulnerabilityDescription [value] --sourceIdentVuln [value] --pocOrganization [value] --resources [value]

Notes:

If a milestone Id is provided (–milestone milestoneId:[value]) the POA&M with the provided milestone Id is updated and the new POA&M milestones is set to null.


Client API parameters/fields (required, conditional, and optional).

Note For information at the command line use:

$ bundle exec exe/emasser post poams help add

top

post milestones


To add (POST) milestones in a system for one or more POA&M items use the following command:

  $ bundle exec exe/emasser post milestones add -s, --systemId [value] -p, --poamId [value] --description [value] --scheduledCompletionDate [value]

Note For information at the command line use:

$ bundle exec exe/emasser post milestones help add

top

post artifacts


The add (POST) artifacts endpoint accepts a single binary file with file extension.zip only. The command line (CI) reads the files provided and zips them before sending to eMASS.

If no artifact is matched via filename to the application, a new artifact will be created with the following default values. Any values not specified below will be blank.
  - isTemplate: false
  - type: other
  - category: evidence

Business Rules:

$ bundle exec exe/emasser post artifacts upload -s, --systemId [value] [--isTemplate or --no-isTemplate] --type [value] --category [value] --files [value...value]

Note For information at the command line use:

$ bundle exec exe/emasser post artifacts help upload

top

post cac


Submit control to second role of CAC

Business Rule

To add (POST) test CAC use the following command:

  $ bundle exec exe/emasser post pac add -s, --systemId [value] --controlAcronym [value] --comments [value]

Note For information at the command line use:

$ bundle exec exe/emasser post cac help add

top

post pac


Submit control to second role of CAC

To add (POST) test PAC use the following command:

  $ bundle exec exe/emasser post pac add -s, --systemId [value] --workflow [value] --name [value] --comments [value]

Note For information at the command line use:

$ bundle exec exe/emasser post pac help add

top

post static_code_scan


To add (POST) static code scans use the following command:

  $ bundle exec exe/emasser post scan_findings add -s, --systemId [value] --applicationName [value] --version [value] --codeCheckName [value] --scanDate [value] --cweId [value]

*rawSeverity: In eMASS, values of “Critical” will appear as “Very High”, and values of “Medium” will appear as “Moderate”. Any values not listed as options in the list above will map to “Unknown” and appear as blank values.

To clear (POST) static code scans use the following command:

  $ bundle exec exe/emasser post scan_findings clear -s, --systemId [value] --applicationName [value] --version [value] --clearFindings

*The clearFindings field is an optional field, but required with a value of “True” to clear out all application findings for a single application/version pairing.

Note For information at the command line use:

$ bundle exec exe/emasser post scan_findings help add

top

post cloud_resource


The following Cloud Resource parameters/fields have the following character limitations:

To add a cloud resource and their scan results in the assets module for a system use the following command:

  $ bundle exec exe/emasser post cloud_resource add -s, --systemId [value] --provider [value] --resourceId [value] --resourceName [value] --resourceType [value] --cspPolicyDefinitionId [value] --isCompliant or --is-not-Compliant --policyDefinitionTitle [value] --test [value]

Note For information at the command line use:

$ bundle exec exe/emasser post cloud_resource help add

top

post container


The following Container parameters/fields have the following character limitations:

To add containers and their scan results in the assets module for a system use the following command:

  $ bundle exec ruby exe/emasser post container add -s, --systemId [value] --containerId [value] --containerName [value] --time [value] --benchmark [value] --lastSeen [value] --ruleId [value] --status [value]
 

Note For information at the command line use:

$ bundle exec exe/emasser post container help add

top

Usage - PUT

put controls


Business Rules

The following fields are required based on the value of the implementationStatus field

Value Required Fields
Planned or Implemented controlDesignation, estimatedCompletionDate, responsibleEntities, slcmCriticality, slcmFrequency, slcmMethod, slcmMethod, slcmTracking, slcmComments
Not Applicable naJustification, controlDesignation, responsibleEntities
Manually Inherited controlDesignation, estimatedCompletionDate, responsibleEntities, slcmCriticality, slcmFrequency, slcmMethod, slcmMethod, slcmTracking, slcmComments

Implementation Plan cannot be updated if a Security Control is “Inherited” except for the following fields:

The following parameters/fields have the following character limitations:

Implementation Plan information cannot be updated if Security Control does not exist in the system record.


Updating (PUT) a Control can be accomplished by invoking the following command:

  $ bundle exec exe/emasser put controls update [PARAMETERS]

Note For information at the command line use:

$ bundle exec exe/emasser put controls help update

top

put poams


Business Rules

The following fields are required based on the value of the status field

Value Required Fields
Risk Accepted comments, resources
Ongoing scheduledCompletionDate, resources, milestones (at least 1)
Completed scheduledCompletionDate, comments, resources,
  completionDate, milestones (at least 1)
Not Applicable POAM can not be created

If a POC email is supplied, the application will attempt to locate a user already registered within the application and pre-populate any information not explicitly supplied in the request. If no such user is found, these fields are required within the request.

Business logic, the following rules apply when adding POA&Ms

The following parameters/fields have the following character limitations:

The following POA&M parameters/fields have the following character limitations:


Updating (PUT) a POA&M can be accomplished by invoking the following command:

  $ bundle exec exe/emasser put poams update [PARAMETERS]

Note For information at the command line use:

$ bundle exec exe/emasser put poams help update

top

put milestones


To add (POST) milestones in a system for one or more POA&M items use the following command:

  $ bundle exec exe/emasser put milestones update [PARAMETERS]

Note For information at the command line use:

$ bundle exec exe/emasser put milestones help update

top

put artifacts


Business Rules

To add (POST) milestones in a system for one or more POA&M items use the following command:

  $ bundle exec exe/emasser put artifacts update [PARAMETERS]

Note For information at the command line use:

$ bundle exec exe/emasser put artifacts help update

top

Usage - DELETE

delete poams


Remove one or many poa&m items in a system

To remove (DELETE) one or more POA&M items use the following command:

bundle exec exe/emasser delete poams remove -s, --systemId [value] -p, --poamId [value]

top

delete milestones


Remove milestones in a system for one or many POA&M items

To delete a milestone the record must be inactive by having the field isActive set to false (isActive=false).

The server returns an empty object upon successfully deleting a milestone.

The last milestone can not be deleted, at-least on must exist.

To remove (DELETE) one or more Milestones in a system use the following command:

bundle exec exe/emasser delete milestones remove -s, --systemId [value] -p, --poamId [value] -m, --milestoneId [value]

top

delete artifacts


Remove one or many artifacts in a system

Provide single file or a space/comma delimited list of file names to be removed from the system (systemId)

To remove (DELETE) one or more Artifacts from a system use the following command:

bundle exec exe/emasser delete artifacts remove -s, --systemId [value] -f, --files [value]
or
bundle exec exe/emasser delete artifacts remove -s, --systemId [value] -f, --files [value value...] 
or
bundle exec exe/emasser delete artifacts remove -s, --systemId [value] -f, --files [value, value...] 

top

delete cloud resource


Delete one or many Cloud Resources and their scan results in the assets module for a system

To remove (DELETE) one or many cloud resources in a system use the following command:

bundle exec exe/emasser delete cloud_resource remove -c, --resourceId [value] -s, --systemId [value]

top

delete container


Delete one or many containers scan results in the assets module for a system

To remove (DELETE) one or many containers in a system use the following command:

bundle exec exe/emasser delete container remove -c, --containerId [value] -s, --systemId [value]

top