Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI support for Microsoft SecureScore report conversion #2742

Merged
merged 45 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6ddeed6
initial commit
meme112233 Jul 19, 2024
e0b1afa
fix comments copy-pasta issues/add feature pull from Msft Graph API
meme112233 Jul 22, 2024
b9b506b
fix required/optional params
meme112233 Jul 22, 2024
c540050
bugfix/Graph API read response comes in as object
meme112233 Jul 22, 2024
79b6558
lint fix
meme112233 Jul 23, 2024
f444a28
update package-lock.json
meme112233 Jul 23, 2024
0441cb9
commit for external testing change of secureScore API read
meme112233 Jul 24, 2024
6beed05
remove unused imports in msftSecureScore2hdf.ts
meme112233 Jul 24, 2024
5a9012d
rename converter command to msft_secure2hdf, update cli flags docs, e…
meme112233 Jul 24, 2024
a5d3a35
Merge remote-tracking branch 'origin/meme-working' into meme-working
meme112233 Jul 24, 2024
44ef860
update usage string
meme112233 Jul 24, 2024
a180a50
update flags to reflect Microsoft terminology
meme112233 Jul 24, 2024
c4694f1
pass with-raw parameter to msft_secure2hdf
meme112233 Jul 24, 2024
268a78b
implement SecureScore converter in the generic command
meme112233 Jul 25, 2024
3d0319a
add unit test
meme112233 Jul 25, 2024
6b89156
Clean up
charleshu-8 Jul 25, 2024
6e44b0f
Clean up import
charleshu-8 Jul 25, 2024
a5de165
handle pagination of SecureScoreControlProfile
meme112233 Jul 29, 2024
dcd6949
update cli conversion flags to be mutually exclusive and inter-dependent
meme112233 Jul 29, 2024
06aa80d
update usage string in accordance with POSIX format
meme112233 Jul 30, 2024
b1aa946
update README usage. add msft_secure to convert/index.ts. add unit te…
meme112233 Jul 30, 2024
69d7d53
update README, bugfix test, update usage
meme112233 Jul 30, 2024
cc76a91
Update README.md
meme112233 Jul 30, 2024
1e7be9d
revert formatting changes to commands/convert/index.ts
meme112233 Jul 30, 2024
c3a0ffd
update usage, description, and examples msft_secure2hdf.ts
meme112233 Jul 30, 2024
9eb02c2
README formatting cleanup
meme112233 Jul 30, 2024
0e8e189
msft_secure2hdf adds -i option for combined input (mapper input format)
meme112233 Jul 30, 2024
dfd903a
draft of passing TLS insecure and CA flags to msft_secure2hdf
meme112233 Jul 31, 2024
55bb750
merge from master
meme112233 Aug 6, 2024
2147d26
output multiple hdf reports by secureScore.id as name
meme112233 Aug 6, 2024
906b35b
handle null auxData
meme112233 Aug 6, 2024
cfbb9be
Update README.md
meme112233 Aug 6, 2024
3b92650
Update README.md
meme112233 Aug 6, 2024
402619d
Update README.md
meme112233 Aug 6, 2024
3c0bbdc
update function signature any->void
meme112233 Aug 6, 2024
5c0ea35
expand msft -> Microsoft README.md
meme112233 Aug 6, 2024
982cf0e
cleanup README.md
meme112233 Aug 6, 2024
e675819
cleanup README.md
meme112233 Aug 6, 2024
52bbe1c
update README.md annotate file types and cmds to acquire
meme112233 Aug 6, 2024
6e002e1
Update src/commands/convert/msft_secure2hdf.ts
meme112233 Aug 6, 2024
18066b5
README cleanup
meme112233 Aug 6, 2024
9683a78
fix linting and Typescript pedantic typing challenges
meme112233 Aug 6, 2024
295feb2
use latest heimdall release which includes the securescore mapper
Amndeep7 Aug 7, 2024
e0897a9
needed to update sample files to the latest versions coming out of th…
Amndeep7 Aug 7, 2024
71b8a40
fix deepsource complaints
Amndeep7 Aug 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ The SAF CLI is the successor to [Heimdall Tools](https://github.com/mitre/heimda
* [Ion Channel 2 HDF](#ion-channel-2-hdf)
* [JFrog Xray to HDF](#jfrog-xray-to-hdf)
* [Tenable Nessus to HDF](#tenable-nessus-to-hdf)
* [Microsoft Secure Score to HDF](#msft_secure-to-hdf)
* [Netsparker to HDF](#netsparker-to-hdf)
* [Nikto to HDF](#nikto-to-hdf)
* [Prisma to HDF](#prisma-to-hdf)
Expand Down Expand Up @@ -476,6 +477,7 @@ AWS SecurityHub enabled standards json|Get all the enabled standards so you can
AWS SecurityHub standard controls json|Get all the controls for a standard that will be fed into the mapper|aws securityhub describe-standards-controls --standards-subscription-arn "arn:aws:securityhub:us-east-1:123456789123:subscription/cis-aws-foundations-benchmark/v/1.2.0" > asff_cis_standard.json



```
convert asff2hdf Translate a AWS Security Finding Format JSON into a
Heimdall Data Format JSON file(s)
Expand Down Expand Up @@ -676,6 +678,42 @@ convert nessus2hdf Translate a Nessus XML results file into a Heimdal
$ saf convert nessus2hdf -i nessus_results.xml -o output-hdf-name.json
```

[top](#convert-other-formats-to-hdf)
#### Microsoft Secure Score to HDF
Output|Use|Command
---|---|---
Microsoft Secure Score JSON|This file contains the Graph API response for the `security/secureScore` endpoint|PowerShell$ `Get-MgSecuritySecureScore -Top 500`
Microsoft Secure Score Control Profiles JSON|This file contains the Graph API response for the `security/secureScoreControlProfiles` endpoint|PowerShell$ `Get-MgSecuritySecureScoreControlProfile -Top 500`
Combined JSON|Combine the outputs from `security/secureScore` and `security/secureScoreControlProfiles` endpoints|`jq -s \'{"secureScore": .[0], "profiles": .[1]}\' secureScore.json secureScoreControlProfiles.json`


```
convert msft_secure2hdf Translate a Microsoft Secure Score report and Secure Score Control to a Heimdall Data Format JSON file

USAGE
$ saf convert msft_secure2hdf -r <secureScore-json> -p <secure-score-control-profiles> -o <hdf-scan-results-json> [-h]
$ saf convert msft_secure2hdf -t <azure-tenant-id> -a <azure-app-id> -s <azure-app-secret> -o <hdf-scan-results-json> [-h]
$ saf convert msft_secure2hdf -i <combined-inputs> -o <hdf-scan-results-json> [-h]

FLAGS
-h, --help Show CLI help.
-i, --combinedInputs JSON File combining the outputs from the Microsoft Graph API endpoints
-r, --inputScoreDoc=<secure-score-json> Input Secure Scores JSON File
-p, --inputProfiles=<secure-score-control-profiles-json> Input Secure Score Control Profiles JSON File
-t, --tenantId=<azure-tenant-id> Azure Tenant ID
-a, --appId=<azure-app-id> Azure App ID
-s, --appSecreet=<azure-app-id> Azure App Secret
-o, --output=<hdf-scan-results-json> Output HDF JSON File

EXAMPLES
$ saf convert msft_secure2hdf -r secureScore.json -p secureScoreControlProfile.json -o output-hdf-name.json
$ saf convert msft_secure2hdf -t "12345678-1234-1234-1234-1234567890abcd" \
-a "12345678-1234-1234-1234-1234567890abcd" \
-s "aaaaa~bbbbbbbbbbbbbbbbbbbbbbbbb-cccccccc" \
-o output-hdf-name.json
$ saf convert msft_secure2hdf -i <(jq -s \'{"secureScore": .[0], "profiles": .[1]}\' secureScore.json secureScoreControlProfiles.json) -o output-hdf-name.json
```

[top](#convert-other-formats-to-hdf)
#### Netsparker to HDF
```
Expand Down
Loading
Loading