Skip to content

Commit

Permalink
Merge pull request #137 from cisagov/lineage/skeleton
Browse files Browse the repository at this point in the history
Lineage pull request for: skeleton
  • Loading branch information
jsf9k authored Jul 12, 2023
2 parents f839bc5 + e3d2654 commit 046a0eb
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 38 deletions.
7 changes: 3 additions & 4 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
# See https://ansible-lint.readthedocs.io/en/latest/configuring.html
# for a list of the configuration elements that can exist in this
# file.
# See https://ansible-lint.readthedocs.io/configuring/ for a list of
# the configuration elements that can exist in this file.
enable_list:
# Useful checks that one must opt-into. See here for more details:
# https://ansible-lint.readthedocs.io/en/latest/rules.html
# https://ansible-lint.readthedocs.io/rules/
- fcqn-builtins
- no-log-password
- no-same-owner
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ jobs:
- id: setup-go
uses: actions/setup-go@v4
with:
go-version: "1.19"
# There is no expectation for actual Go code so we disable caching as
# it relies on the existence of a go.sum file.
cache: false
go-version: "1.20"
- name: Lookup Go cache directory
id: go-cache
run: |
Expand Down
41 changes: 30 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,54 @@ repos:

# Text file hooks
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
rev: v0.34.0
hooks:
- id: markdownlint
args:
- --config=.mdl_config.yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
rev: v3.0.0-alpha.9-for-vscode
hooks:
- id: prettier
- repo: https://github.com/adrienverge/yamllint
rev: v1.30.0
rev: v1.32.0
hooks:
- id: yamllint
args:
- --strict

# GitHub Actions hooks
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.22.0
rev: 0.23.1
hooks:
- id: check-github-actions
- id: check-github-workflows

# pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit
rev: v3.2.1
rev: v3.3.2
hooks:
- id: validate_manifest

# Go hooks
- repo: https://github.com/TekWizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
# Style Checkers
- id: go-critic
# StaticCheck
- id: go-staticcheck-repo-mod
# Go Build
- id: go-build-repo-mod
# Go Mod Tidy
- id: go-mod-tidy-repo
# Go Test
- id: go-test-repo-mod
# Go Vet
- id: go-vet-repo-mod
# GoSec
- id: go-sec-repo-mod

# Shell script hooks
- repo: https://github.com/cisagov/pre-commit-shfmt
rev: v0.0.2
Expand Down Expand Up @@ -98,7 +117,7 @@ repos:
name: bandit (everything else)
exclude: tests
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
Expand All @@ -112,7 +131,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
rev: v1.3.0
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -121,27 +140,27 @@ repos:
- types-pytz
- types-requests
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.4.0
hooks:
- id: pyupgrade

# Ansible hooks
- repo: https://github.com/ansible-community/ansible-lint
rev: v5.4.0
rev: v6.17.0
hooks:
- id: ansible-lint
# files: molecule/default/playbook.yml

# Terraform hooks
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.77.1
rev: v1.80.0
hooks:
- id: terraform_fmt
- id: terraform_validate

# Docker hooks
- repo: https://github.com/IamTheFij/docker-pre-commit
rev: v2.1.1
rev: v3.0.1
hooks:
- id: docker-compose-check

Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ An example assessment JSON can be found [here](src/assessment/sample_assessment.

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-------:|:--------:|
| id | Assessment identifier. (e.g. "RV0000") | string | | yes |
| timezone | Timezone name based on [pytz](http://pytz.sourceforge.net/) timezones. (e.g. "US/Eastern") | string | | yes |
| domain | Assessment domain for Gophish public interface. (e.g. "domain.tld") | string | | yes |
| target_domain | Approved target domains where all email recipients must reside. (e.g. ["target1.tld", "target2.tld"]) | list(string) | | yes |
| start_date | Assessment start date in 24-hr ISO format with offset. (e.g. "2020-01-01T14:00:00-04:00") | string | | yes |
| end_date | Assessment end date in 24-hr ISO format with offset. (e.g. "2020-01-06T15:30:00-04:00") | string | | yes |
| id | Assessment identifier. (e.g. `RV0000`) | string | | yes |
| timezone | Timezone name based on [pytz](http://pytz.sourceforge.net/) timezones. (e.g. `US/Eastern`) | string | | yes |
| domain | Assessment domain for Gophish public interface. (e.g. `domain.tld`) | string | | yes |
| target_domain | Approved target domains where all email recipients must reside. (e.g. `[target1.tld, target2.tld]`) | list(string) | | yes |
| start_date | Assessment start date in 24-hr ISO format with offset. (e.g. `2020-01-01T14:00:00-04:00`) | string | | yes |
| end_date | Assessment end date in 24-hr ISO format with offset. (e.g. `2020-01-06T15:30:00-04:00`) | string | | yes |
| reschedule | Indicates if the assessment json is a rescheduled assessment. | boolean | | yes |
| start_campaign | The campaign that the assessment should start at. | integer | `1` | no |
| groups | Consolidated list of email recipients grouped to receive campaigns, [example](#group-dictionary). | list(dict) | | yes |
Expand All @@ -112,7 +112,7 @@ with the command `pca-wizard-templates --targets`.

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-------:|:--------:|
| name | Group name in the format of `{assessment identifier}-G{integer}` (e.g. "RV0000-G1"). | string | | yes |
| name | Group name in the format of `{assessment identifier}-G{integer}` (e.g. `RV0000-G1`). | string | | yes |
| targets | List of email recipients, [example](#target-dictionary). | list(dict) | | yes |

### Target Dictionary ###
Expand All @@ -121,14 +121,14 @@ with the command `pca-wizard-templates --targets`.
|------|-------------|:----:|:-------:|:--------:|
| first_name | Recipient's first name. | string | | yes |
| last_name | Recipient's last name. | string | | yes |
| email | Recipient's email address. (e.g. "[email protected]") | string | | yes |
| email | Recipient's email address. (e.g. `[email protected]`) | string | | yes |
| position | Position name for use in creating sub-groups of recipients within the organization such as "HR", "IT", etc. | string | | no |

### Page Dictionary ###

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-------:|:--------:|
| name | Page name in the format of `{assessment identifier}-{integer}-{descriptor}` (e.g. "RV0000-1-AutoForward"). | string | | yes |
| name | Page name in the format of `{assessment identifier}-{integer}-{descriptor}` (e.g. `RV0000-1-AutoForward`). | string | | yes |
| capture_credentials | Capture all non-password input with Gophish. Supports forwarding after submit action. | boolean | | yes |
| capture_passwords | Capture password input by the user, but note that captured input is **stored in plain text as of Gophish version 0.9.0.** | boolean | `False` | no |
| html | Content of the landing page in HTML format. | string | | yes |
Expand All @@ -137,10 +137,10 @@ with the command `pca-wizard-templates --targets`.

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-------:|:--------:|
| name | Campaign name in the format of `{assessment identifier}-C{integer}` (e.g. "RV0000-C1"). | string | | yes |
| launch_date | Campaign launch date in 24-hr ISO format with offset. (e.g. "2020-01-01T14:00:00-04:00") | string | | yes |
| completed_date | Campaign completion date in 24-hr ISO format with offset. (e.g. "2020-01-01T15:30:00-04:00") | string | | yes |
| url | Full URL for the campaign's landing page. (e.g. "http://domain.tld/camp/1") | string | | yes |
| name | Campaign name in the format of `{assessment identifier}-C{integer}` (e.g. `RV0000-C1`). | string | | yes |
| launch_date | Campaign launch date in 24-hr ISO format with offset. (e.g. `2020-01-01T14:00:00-04:00`) | string | | yes |
| completed_date | Campaign completion date in 24-hr ISO format with offset. (e.g. `2020-01-01T15:30:00-04:00`) | string | | yes |
| url | Full URL for the campaign's landing page. (e.g. `http://domain.tld/camp/1`) | string | | yes |
| page_name | Landing page name as defined in the assessment json. | string | | yes |
| group_name | Group name as defined in the assessment json. | string | | yes |
| template | Email template for the campaign, [example](#email-template-dictionary). | dict | | yes |
Expand All @@ -153,7 +153,7 @@ with the command `pca-wizard-templates --emails`.

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-------:|:--------:|
| name | Template name in the format of `{assessment identifier}-T{integer}-{template identifier}` (e.g. "RV0000-T1-1A2B3D"). | string | | yes |
| name | Template name in the format of `{assessment identifier}-T{integer}-{template identifier}` (e.g. `RV0000-T1-1A2B3D`). | string | | yes |
| subject | Email subject as seen by recipients. | string | | yes |
| html | HTML representation of the email. | string | | yes |
| text | Plain text representation of the email. | string | | yes |
Expand All @@ -162,10 +162,10 @@ with the command `pca-wizard-templates --emails`.

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-------:|:--------:|
| name | Sending profile name in the format of `{assessment identifier}-SP-{integer}` (e.g. "RV0000-SP-1"). | string | | yes |
| from_address | From email address with display name, required format: `{display name}<{sending email address}>`. (e.g. "John Doe\<[email protected]\>") | string | | yes |
| host | Email server for Gophish to send email through. | string | "postfix:587" | no |
| interface_type | Type of interface Gophish will use with mail server. | string | "SMTP" | no |
| name | Sending profile name in the format of `{assessment identifier}-SP-{integer}` (e.g. `RV0000-SP-1`). | string | | yes |
| from_address | From email address with display name, required format: `{display name}<{sending email address}>`. (e.g. `John Doe<[email protected]>`) | string | | yes |
| host | Email server for Gophish to send email through. | string | `postfix:587` | no |
| interface_type | Type of interface Gophish will use with mail server. | string | `SMTP` | no |
| ignore_cert | Indicate if Gophish should ignore certs with mail server. | boolean | `True` | no |

## User Report Field Dictionary ##
Expand All @@ -179,7 +179,7 @@ campaign.
| assessment | Assessment ID that this user report is associated with. | string |
| campaign | Campaign ID that this user report is associated with. | string |
| customer | Customer ID that this user report document is associated with. Note that Gophish does not contain this information, so `gophish-export` will always export it as an empty string. | string |
| first_report | First report (click) generated by a targeted user. Format: "YYYY-MM-DDThh:mm.ss" | datetime |
| first_report | First report (click) generated by a targeted user. Format: `YYYY-MM-DDThh:mm.ss` | datetime |
| total_num_reports | Total number of user reports received during a campaign. | integer |

## Campaign Summary Field Dictionary ##
Expand All @@ -196,7 +196,7 @@ all assessments in a campaign is reported in the following format.
| redirect | The URL the Gophish-generated email will redirect to. | string |
| clicks | The total number of clicks reported by a campaign. | integer |
| unique_clicks | The total number of clicks generated by unique users. | integer |
| percent_clicks | The percentage of emails sent versus how many were clicks by a targeted user | float |
| percent_clicks | The percentage of emails sent versus how many were clicks by a targeted user. | float |

## Contributing ##

Expand Down
4 changes: 2 additions & 2 deletions setup-env
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ done
eval set -- "$PARAMS"

# Check to see if pyenv is installed
if [ -z "$(command -v pyenv)" ] || [ -z "$(command -v pyenv-virtualenv)" ]; then
if [ -z "$(command -v pyenv)" ] || { [ -z "$(command -v pyenv-virtualenv)" ] && [ ! -f "$(pyenv root)/plugins/pyenv-virtualenv/bin/pyenv-virtualenv" ]; }; then
echo "pyenv and pyenv-virtualenv are required."
if [[ "$OSTYPE" == "darwin"* ]]; then
cat << 'END_OF_LINE'
Expand Down Expand Up @@ -189,5 +189,5 @@ else:
END_OF_LINE
)"

# Qapla
# Qapla'
echo "Success!"

0 comments on commit 046a0eb

Please sign in to comment.