-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move SQS branch from pe-reports to ATC-Framework
- Loading branch information
Showing
866 changed files
with
260,863 additions
and
355 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,22 @@ | ||
{ | ||
"workbench.colorCustomizations": { | ||
"activityBar.activeBackground": "#3399ff", | ||
"activityBar.background": "#3399ff", | ||
"activityBar.foreground": "#15202b", | ||
"activityBar.inactiveForeground": "#15202b99", | ||
"activityBarBadge.background": "#bf0060", | ||
"activityBarBadge.foreground": "#e7e7e7", | ||
"commandCenter.border": "#e7e7e799", | ||
"sash.hoverBorder": "#3399ff", | ||
"statusBar.background": "#007fff", | ||
"statusBar.foreground": "#e7e7e7", | ||
"statusBarItem.hoverBackground": "#3399ff", | ||
"statusBarItem.remoteBackground": "#007fff", | ||
"statusBarItem.remoteForeground": "#e7e7e7", | ||
"titleBar.activeBackground": "#007fff", | ||
"titleBar.activeForeground": "#e7e7e7", | ||
"titleBar.inactiveBackground": "#007fff99", | ||
"titleBar.inactiveForeground": "#e7e7e799" | ||
}, | ||
"peacock.color": "#007fff" | ||
} |
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 @@ | ||
Requirement already satisfied: Flask-SQLAlchemy in /Users/stewartc/.pyenv/versions/3.11.1/envs/pe-reports/lib/python3.11/site-packages/Flask_SQLAlchemy-3.0.3-py3.11.egg (3.0.3) |
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 |
---|---|---|
@@ -1,39 +1,146 @@ | ||
# ATC-Framework # | ||
# Posture & Exposure Reports (P&E Reports) # | ||
|
||
[](https://github.com/cisagov/ATC-Framework/actions) | ||
[](https://github.com/cisagov/ATC-Framework/actions/workflows/codeql-analysis.yml) | ||
[](https://coveralls.io/github/cisagov/ATC-Framework?branch=develop) | ||
[](https://snyk.io/test/github/cisagov/ATC-Framework) | ||
[](https://github.com/cisagov/pe-reports/actions) | ||
[](https://github.com/cisagov/pe-reports/actions/workflows/codeql-analysis.yml) | ||
[](https://coveralls.io/github/cisagov/pe-reports?branch=develop) | ||
[](https://snyk.io/test/github/cisagov/pe-reports) | ||
|
||
This is a generic skeleton project that can be used to quickly get a | ||
new [cisagov](https://github.com/cisagov) Python library GitHub | ||
project started. This skeleton project contains [licensing | ||
information](LICENSE), as well as | ||
[pre-commit hooks](https://pre-commit.com) and | ||
[GitHub Actions](https://github.com/features/actions) configurations | ||
appropriate for a Python library project. | ||
This package is used to generate and deliver CISA Posture & Exposure Reports | ||
(P&E Reports). Reports are delivered by email and include an encrypted PDF | ||
attachment with a series of embedded raw-data files of the collected materials. | ||
The reports are delivered in a two step process. First the `pe_reports` module | ||
collects the raw data and creates the encrypted PDFs. The `pe_mailer` then | ||
securely delivers the content. | ||
|
||
## New Repositories from a Skeleton ## | ||
Topics of interest include *Exposed Credentials, Domain Masquerading, Malware, | ||
Inferred Vulnerabilities and the Dark Web*. The data collected for the reports | ||
is gathered on the 1st and 15th of each month. | ||
|
||
Please see our [Project Setup guide](https://github.com/cisagov/development-guide/tree/develop/project_setup) | ||
for step-by-step instructions on how to start a new repository from | ||
a skeleton. This will save you time and effort when configuring a | ||
new repository! | ||
## Requirements ## | ||
|
||
- [Python Environment](CONTRIBUTING.md#creating-the-python-virtual-environment) | ||
|
||
- [cisagov MongoDB](https://github.com/cisagov/mongo-db-from-config) | ||
|
||
- [cisagov AWS SES](https://github.com/cisagov/cool-dns-cyber.dhs.gov) | ||
|
||
## Installation ## | ||
|
||
- `git clone https://github.com/cisagov/pe-reports.git` | ||
|
||
- `pip install -e .` | ||
|
||
## Create P&E Reports ## | ||
|
||
- Configure [cisagov MongoDB connection](https://github.com/cisagov/mongo-db-from-config) | ||
|
||
```console | ||
Usage: | ||
pe-reports REPORT_DATE DATA_DIRECTORY OUTPUT_DIRECTORY [--log-level=LEVEL] | ||
|
||
Arguments: | ||
REPORT_DATE Date of the report, format YYYY-MM-DD. | ||
OUTPUT_DIRECTORY The directory where the final PDF reports should be saved. | ||
Options: | ||
-h --help Show this message. | ||
-v --version Show version information. | ||
--log-level=LEVEL If specified, then the log level will be set to | ||
the specified value. Valid values are "debug", "info", | ||
"warning", "error", and "critical". [default: info] | ||
``` | ||
|
||
## Deliver P&E Reports ## | ||
|
||
- Configure [cisagov MongoDB connection](https://github.com/cisagov/mongo-db-from-config) | ||
|
||
- Load an AWS profile that assumes [this role](https://github.com/cisagov/cool-dns-cyber.dhs.gov/blob/develop/sessendemail_rolerole.tf#L33-L39) | ||
|
||
```console | ||
Usage: | ||
pe-mailer [--pe-report-dir=DIRECTORY] [--db-creds-file=FILENAME] [--log-level=LEVEL] | ||
|
||
Arguments: | ||
-p --pe-report-dir=DIRECTORY Directory containing the pe-reports output. | ||
-c --db-creds-file=FILENAME A YAML file containing the Cyber | ||
Hygiene database credentials. | ||
[default: /secrets/database_creds.yml] | ||
Options: | ||
-h --help Show this message. | ||
-v --version Show version information. | ||
-s --summary-to=EMAILS A comma-separated list of email addresses | ||
to which the summary statistics should be | ||
sent at the end of the run. If not | ||
specified then no summary will be sent. | ||
-t --test_emails=EMAILS A comma-separated list of email addresses | ||
to which to test email send process. If not | ||
specified then no test will be sent. | ||
-l --log-level=LEVEL If specified, then the log level will be set to | ||
the specified value. Valid values are "debug", "info", | ||
"warning", "error", and "critical". [default: info] | ||
``` | ||
|
||
## Database backup/restore ## | ||
|
||
Follow the instructions below to backup the P&E database instance and restore locally. | ||
|
||
In the P&E database environment: | ||
|
||
- Pull the latest repository | ||
- If necessary, edit ./src/pe_reports/pe_db/pg_backup.sh and replace the | ||
default output path ($PWD) with your preferred output path. | ||
- Open terminal and run: | ||
`bash ./src/pe_reports/pe_db/pg_backup.sh` | ||
- Export resulting .zip file | ||
|
||
In your local environment: | ||
|
||
- Pull the latest repository | ||
- If necessary, edit ./src/pe_reports/pe_db/pg_restore.sh and replace | ||
the default path to the backup files ($PWD) with your preferred path. | ||
- Start local postgres | ||
- Open terminal and run: | ||
`bash ./src/pe_reports/pe_db/pg_restore.sh` | ||
|
||
## Collect P&E Source Data ## | ||
|
||
- Add database and data source credentials to src/pe_reports/data/config.ini | ||
|
||
```console | ||
Usage: | ||
pe-source DATA_SOURCE [--log-level=LEVEL] [--orgs=ORG_LIST] [--cybersix-methods=METHODS] | ||
|
||
Arguments: | ||
DATA_SOURCE Source to collect data from. Valid values are "cybersixgill", | ||
"dnstwist", "hibp", and "shodan". | ||
Options: | ||
-h --help Show this message. | ||
-v --version Show version information. | ||
-l --log-level=LEVEL If specified, then the log level will be set to | ||
the specified value. Valid values are "debug", "info", | ||
"warning", "error", and "critical". [default: info] | ||
-o --orgs=ORG_LIST A comma-separated list of orgs to collect data for. | ||
If not specified, data will be collected for all | ||
orgs in the pe database. Orgs in the list must match the | ||
IDs in the cyhy-db. E.g. DHS,DHS_ICE,DOC | ||
[default: all] | ||
-csg --cybersix-methods=METHODS A comma-separated list of cybersixgill methods. | ||
If not specified, all will run. Valid values are "alerts", | ||
"credentials", "mentions", "topCVEs". E.g. alerts,mentions. | ||
[default: all] | ||
``` | ||
|
||
## Contributing ## | ||
|
||
We welcome contributions! Please see [`CONTRIBUTING.md`](CONTRIBUTING.md) for | ||
details. | ||
We welcome contributions! Please see [`CONTRIBUTING.md`](CONTRIBUTING.md) for details. | ||
|
||
## License ## | ||
|
||
This project is in the worldwide [public domain](LICENSE). | ||
|
||
This project is in the public domain within the United States, and | ||
copyright and related rights in the work worldwide are waived through | ||
the [CC0 1.0 Universal public domain | ||
dedication](https://creativecommons.org/publicdomain/zero/1.0/). | ||
This project is in the public domain within the United States, and copyright | ||
and related rights in the work worldwide are waived through the | ||
[CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/). | ||
|
||
All contributions to this project will be released under the CC0 | ||
dedication. By submitting a pull request, you are agreeing to comply | ||
with this waiver of copyright interest. | ||
All contributions to this project will be released under the CC0 dedication. | ||
By submitting a pull request, you are agreeing to comply with this waiver | ||
of copyright interest. |
Binary file not shown.
Empty file.
Oops, something went wrong.