-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
237 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Run Tests | ||
on: push | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Generate Nudge file | ||
run: | | ||
python3 -m pip install -r requirements.txt | ||
./nudge-auto-updater.py -s file://${GITHUB_WORKSPACE}/tests/test-latest/feed.json -c ${GITHUB_WORKSPACE}/tests/test-latest/configuration.yml -n ${GITHUB_WORKSPACE}/tests/test-latest/nudge-config.json | ||
- name: Run tests | ||
run: | | ||
[[ $(jq -r '.OSVersions.[0].SecurityReleases.[0].ProductVersion' ${GITHUB_WORKSPACE}/tests/test-latest/feed.json) == $(jq -r '.osVersionRequirements.[0].requiredMinimumOSVersion' ${GITHUB_WORKSPACE}/tests/test-latest/nudge-config.json) ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# nudge-auto-updater | ||
A tool to demo how you can update [Nudge](https://github.com/macadmins/Nudge) JSON configuration definitions automatically. | ||
`nudge-auto-updater` is a tool that leverages [SOFA](https://sofa.macadmins.io) in combination with [VulnCheck](https://docs.vulncheck.com/) to detect new macOS updates, triage the severity of the CVEs fixed, and update your JSON [Nudge](https://github.com/macadmins/Nudge) configuration appropriately. | ||
|
||
Leverages [SOFA](https://sofa.macadmins.io) for the macOS update feed, and [NIST's National Vulnerability Database REST API](https://nvd.nist.gov/developers/vulnerabilities) for grabbing info about CVEs. | ||
A VulnCheck API key is currently required to use this script - without it, CVE lookups can't be performed. | ||
|
||
## Configuration | ||
You can configure this program by putting a `configuration.yml` file in the same directory as the script. | ||
Under the ket `targets`, this `configuration.yml` file should contain a list of `osVersionRequirements`, the keys of which are documented below: | ||
Under the key `targets`, this `configuration.yml` file should contain a list of `osVersionRequirements`, the keys of which are documented below: | ||
| Key | Type | Description | | ||
|-----------------------|--------|----------------------| | ||
| `target` | string | Specifies the `targetedOSVersionsRule` in Nudge. | | ||
| `update_to` | string | Specifies the macOS version this target should update to. This value can be "latest" if the `requiredMinimumOSVersion` should be the latest version of macOS. Otherwise this value can be a major version (e.g. 13), a minor version (e.g. 13.1) or a specific patch version (e.g. 13.1.1). In this case the `requiredMinimumOSVersion` will be set to the newest macOS version with a major version, minor version or patch version less than or equal to the specified value. | | ||
|
||
To do: describe rest of keys | ||
|
||
If the `configuration.yml` file is missing this program will only update the Nudge configuration `osVersionRequirements` for the default `targetedOSVersionsRule` to the latest version of macOS. | ||
If the `configuration.yml` file is missing this script will only update the Nudge configuration `osVersionRequirements` for the default `targetedOSVersionsRule` to the latest version of macOS. | ||
The specified configuration will only update existing `osVersionRequirements` - it will not create new ones. | ||
An example file is included in this project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
targets: | ||
- target : "default" | ||
update_to : "latest" | ||
cve_urgency_conditions: | ||
max_baseScore : 10 | ||
average_baseScore : 8 | ||
max_exploitabilityScore : 10 | ||
average_exploitabilityScore : 8 | ||
max_impactScore : 10 | ||
average_impactScore : 8 | ||
number_CVEs : 10 | ||
number_actively_exploited_CVEs : 5 | ||
fraction_actively_exploited_CVEs : 0.7 | ||
formulas: | ||
- comparison : "average" | ||
formula : "baseScore * exploitabilityScore * impactScore" | ||
threshhold : 500 | ||
- comparison : "max" | ||
formula : "baseScore * exploitabilityScore * impactScore * is_actively_exploited" | ||
threshhold : 200 | ||
- comparison : "sum" | ||
formula : "baseScore * impactScore * is_actively_exploited" | ||
threshhold : 300 | ||
- comparison : "n_above" | ||
formula : "baseScore * impactScore * is_actively_exploited" | ||
n : 2 | ||
threshhold : 300 | ||
default_deadline_days : 14 | ||
urgent_deadline_days : 7 |
Oops, something went wrong.