Skip to content

Commit 5b4375c

Browse files
committed
1.4.20
Signed-off-by: Emily Rodriguez <erodriguez92@gatech.edu>
1 parent b705143 commit 5b4375c

File tree

5 files changed

+15
-126
lines changed

5 files changed

+15
-126
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.19
1+
1.4.20

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mitre/saf",
33
"description": "The MITRE Security Automation Framework (SAF) Command Line Interface (CLI) brings together applications, techniques, libraries, and tools developed by MITRE and the security community to streamline security automation for systems and DevOps pipelines.",
4-
"version": "1.4.19",
4+
"version": "1.4.20",
55
"author": "The MITRE Security Automation Framework",
66
"bin": "./bin/run",
77
"bugs": "https://github.com/mitre/saf/issues",
@@ -123,10 +123,16 @@
123123
},
124124
"theme": "./oclif-theme.json",
125125
"additionalHelpFlags": [
126-
"-h", "-H", "--tell-me-more", "--explain"
126+
"-h",
127+
"-H",
128+
"--tell-me-more",
129+
"--explain"
127130
],
128131
"additionalVersionFlags": [
129-
"-v", "-V", "--version", "--Version"
132+
"-v",
133+
"-V",
134+
"--version",
135+
"--Version"
130136
],
131137
"bin": "saf",
132138
"plugins": [

release-prep.sh

-119
Original file line numberDiff line numberDiff line change
@@ -49,125 +49,6 @@ PrintColor "Yellow" "#----------------------------------------------------------
4949

5050
#------------------------------------------------------------------------------
5151
# Start the Script
52-
PrintColor "Green" "Press enter to continue - or type exit/EXIT to terminate"
53-
read srtInput # Read user input
54-
# Check if input is 'exit', 'Exit', or 'EXIT'
55-
if [[ "$srtInput" == "exit" || "$srtInput" == "Exit" || "$srtInput" == "EXIT" ]]; then
56-
TerminateScript
57-
fi
58-
59-
#------------------------------------------------------------------------------
60-
# Retrieve the latest main content from github
61-
PrintColor "Yellow" "Retrieve the latest main content from github..."
62-
git checkout main
63-
PrintColor "Green" "Done"
64-
echo
65-
66-
#------------------------------------------------------------------------------
67-
# Pull the main branch content from github
68-
PrintColor "Yellow" "Pull the main branch from github..."
69-
git pull origin main
70-
if [ $? -ne 0 ]; then
71-
PrintColor "Red" " Failed to Pull the main branch from github"
72-
TerminateScript
73-
fi
74-
PrintColor "Green" "Done"
75-
echo
76-
77-
#------------------------------------------------------------------------------
78-
# Update the version tag with the next value (package.json file)
79-
PrintColor "Yellow" "Increment the SAF CLI version number..."
80-
81-
# 1. Read the JSON file
82-
json_content=$(cat "package.json")
83-
version=$(echo "$json_content" | jq -r '.version')
84-
85-
# 2. Update the version (Increment the build number)
86-
IFS='.' read -r -a version_array <<< "$version" # Split the version into an array
87-
version_array[2]=$((version_array[2] + 1)) # Increment the last element (patch version)
88-
new_version="${version_array[0]}.${version_array[1]}.${version_array[2]}" # Join back into a string
89-
90-
# 3. Ask the user to update or confirm the new version number
91-
PrintColor "Cyan" "Current SAF CLI version is: $version"
92-
prompt="Enter the new SAF CLI version number (default is: $new_version)"
93-
while true; do
94-
read -p "$(echo -e ${CYAN}$prompt: ${RESET})" next_version
95-
if [ -z "$next_version" ]; then
96-
next_version=$new_version
97-
fi
98-
99-
# Ask for confirmation
100-
read -p "$(echo -e ${CYAN}Use version $next_version [y/n] exit to quit: ${RESET})" srtInput
101-
if [[ "$srtInput" =~ ^(exit|Exit|EXIT)$ ]]; then
102-
TerminateScript
103-
elif [ "$srtInput" == "y" ]; then
104-
break
105-
fi
106-
done
107-
PrintColor "Green" "Setting SAF CLI version to: $next_version"
108-
109-
# 4. Update the package.json and VERSION files
110-
updated_json=$(echo "$json_content" | jq --arg version "$next_version" '.version = $version')
111-
echo "$updated_json" > package.json
112-
echo "$next_version" > VERSION
113-
114-
PrintColor "Green" "Done"
115-
echo
116-
117-
#------------------------------------------------------------------------------
118-
# Update MITRE dependencies to latest version
119-
PrintColor "Yellow" "Update MITRE dependencies to latest version..."
120-
# List of MITRE packages to be checked - Add as needed
121-
packages=("@mitre/hdf-converters" "@mitre/heimdall-lite" "@mitre/inspec-objects" "@mitre/emass_client")
122-
123-
# Iterate over each package
124-
for package in "${packages[@]}"; do
125-
PrintColor "Cyan" " Processing package: $package"
126-
# Get the latest version of the package from npm
127-
latest_version=$(npm show "$package" version)
128-
# Get the current version from package.json
129-
current_version=$(jq -r ".dependencies[\"$package\"]" package.json)
130-
# Compare and update package.json as needed
131-
if [[ "$latest_version" != "$current_version" ]]; then
132-
PrintColor "Yellow" " Updated package to version: $latest_version"
133-
# Update the package version in package.json
134-
jq ".dependencies[\"$package\"] = \"$latest_version\"" package.json > temp.json && mv temp.json package.json
135-
else
136-
PrintColor "Cyan" " Package version is current: $current_version"
137-
fi
138-
done
139-
PrintColor "Green" "Done"
140-
echo
141-
142-
143-
#------------------------------------------------------------------------------
144-
# Delete node_modules if it exists, install all supporting modules
145-
PrintColor "Yellow" "Delete node_modules if it exists, install supporting modules..."
146-
if [ -d "node_modules" ]; then
147-
PrintColor "Cyan" " Removing the node_modules directory"
148-
rm -rf node_modules
149-
fi
150-
151-
PrintColor "Cyan" " Installing node modules"
152-
npm install
153-
PrintColor "Green" "Done"
154-
echo
155-
156-
#------------------------------------------------------------------------------
157-
# Build the SAF CLI package and run all tests
158-
PrintColor "Yellow" "Build the SAF CLI package and run all tests..."
159-
PrintColor "Cyan" " Building the SAF CLI package"
160-
npm pack
161-
162-
PrintColor "Cyan" " Running the SAF CLI tests"
163-
npm run test
164-
# $? holds exit status of last command run, npm run test returns non-zero exit status if all tests don't pass
165-
if [ $? -ne 0 ]; then
166-
PrintColor "Red" " Failed the SAF CLI test(s)"
167-
TerminateScript
168-
fi
169-
PrintColor "Green" "Done"
170-
echo
17152

17253
#------------------------------------------------------------------------------
17354
# Add unstaged files to the staging area - Files with modified flag (M) set

test/commands/convert/ckl2hdf.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ describe('Test invalid checklist metadata example', () => {
7272
'-i', path.resolve('./test/sample_data/checklist/sample_input_report/ckl_with_invalid_metadata.ckl'),
7373
'-o', `${tmpobj.name}/invalid_output.json`,
7474
])
75-
expect(stderr).to.equal('Error converting to hdf:\nError: Invalid checklist metadata fields:\n\tHost FQDN (invalid)\n\tHost IP (invalid)\n\tHost MAC (invalid)\n')
75+
const expected_error_message = 'Error converting to hdf:\nError: Invalid checklist metadata fields:\n\tHost FQDN (invalid)\n\tHost IP (invalid)\n\tHost MAC addresses must be valid and separated by newline, space, or comma. (invalid)\n'
76+
// const expected_error_message2 = 'Error converting to hdf:\nError: Invalid checklist metadata fields:\n\tHost FQDN (invalid)\n\tHost IP (invalid)\n\tHost MAC (invalid)\n'
77+
expect(stderr).to.equal(expected_error_message)
7678
})
7779
})

0 commit comments

Comments
 (0)