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

⚠️ CONFLICT! Lineage pull request for: skeleton #26

Merged
merged 53 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
4cb9a4b
Add steps to setup go packages for pre-commit
jasonodoom Jul 10, 2023
53f56b0
Update action/checkout to use same version
jasonodoom Jul 10, 2023
f261099
Set specific gocritic version
jasonodoom Jul 10, 2023
097b573
Update build workflow with package installtion
jasonodoom Jul 10, 2023
254282a
Group go tools together with comment
jasonodoom Jul 11, 2023
ecf3299
Update staticcheck id
jasonodoom Jul 11, 2023
1eaedf5
Update tool names to match author stylization
jasonodoom Jul 11, 2023
fd04757
Update statcicheck stylization
jasonodoom Jul 11, 2023
ddbf6f7
Temporarily use a different branch of cisagov/setup-env-github-action
jsf9k Jul 12, 2023
a8af336
Move go packages install to separate section
jasonodoom Jul 12, 2023
1675b12
Update go-critic name
jasonodoom Jul 12, 2023
c6ab22e
Update staticcheck name
jasonodoom Jul 12, 2023
29de034
Use the correct repo name for the ansible-lint pre-commit hook
jsf9k Jul 13, 2023
1e7cb4f
Correct staticcheck reference to setup-env, sort alphabetically and …
jasonodoom Jul 12, 2023
5f3bc13
Remove Go section coment
jasonodoom Jul 13, 2023
d311825
Remove unnecessary quotes in the dependabot configuration
mcdonnnj Jul 14, 2023
2294d49
Sort the keys in the Dependabot configuration
mcdonnnj Jul 14, 2023
e678502
Delete duplicate word "are"
jsf9k Jul 18, 2023
948ebde
Fix gosec stylization
jasonodoom Aug 16, 2023
98d3d3f
Revert "Temporarily use a different branch of cisagov/setup-env-githu…
jsf9k Aug 22, 2023
82db36a
Add nixfmt pre-commit hook
jasonodoom Aug 28, 2023
c0b5d5b
Bump actions/checkout from 3 to 4
dependabot[bot] Sep 4, 2023
b04654e
Bump crazy-max/ghaction-github-labeler from 4 to 5
mcdonnnj Sep 11, 2023
49ac8c5
Update the dependabot ignore configuration
mcdonnnj Sep 11, 2023
4ec50ab
Merge pull request #138 from cisagov/add-go-packages
mcdonnnj Sep 13, 2023
8145a93
Merge pull request #139 from cisagov/improvement/use-correct-repo-name
mcdonnnj Sep 13, 2023
ce74358
Merge pull request #140 from cisagov/improvement/update_dependabot_co…
mcdonnnj Sep 13, 2023
338e3e1
Merge pull request #141 from cisagov/documentation/grammar
mcdonnnj Sep 13, 2023
8432f1e
Merge pull request #143 from cisagov/add-nixfmt
mcdonnnj Sep 13, 2023
8cdbc7b
Merge pull request #145 from cisagov/dependabot/github_actions/action…
mcdonnnj Sep 13, 2023
ca49bea
Merge pull request #146 from cisagov/improvement/update_labeler_action
mcdonnnj Sep 13, 2023
94d753d
Update pre-commit hook versions
mcdonnnj Aug 3, 2023
1bc2056
Switch to the pre-commit mirror for black
mcdonnnj Sep 11, 2023
a62ebe7
Add the crazy-max/ghaction-github-status GitHub action
jsf9k Aug 29, 2023
3619c45
Make the lint job depend on the diagnostics job
jsf9k Aug 30, 2023
f437066
Add a GH Action to dump the context
jsf9k Aug 30, 2023
c5e56a2
Give the diagnostics job a descriptive name
jsf9k Aug 30, 2023
9afb516
Add the step-security/harden-runner GH Action
jsf9k Aug 30, 2023
9dc773c
Add a harden-runner task to the lint job as well
jsf9k Aug 30, 2023
bb81ec3
Add a reminder
jsf9k Aug 30, 2023
94903ae
Merge pull request #142 from cisagov/maintenance/update_pre-commit_hooks
mcdonnnj Sep 13, 2023
8d8577c
Merge pull request #148 from cisagov/improvement/change_black_repository
mcdonnnj Sep 13, 2023
c0eed09
Merge pull request #144 from cisagov/improvement/add-github-status-jazz
mcdonnnj Sep 13, 2023
df22430
Merge remote-tracking branch 'skeleton-generic/develop' into lineage/…
jsf9k Sep 13, 2023
03d5a4b
Update hashicorp/aws requirement from ~> 3.38 to ~> 4.9
mcdonnnj Nov 6, 2023
503d378
Use a consistent AWS provider version constraint
mcdonnnj Nov 6, 2023
c2b4c6c
Add a configuration file for terraform-docs
mcdonnnj Nov 13, 2023
1c77ac9
Correctly alphabetize YAML keys
jsf9k Sep 13, 2023
ea9e90b
Move attribution comment to just before first dependency to which it …
jsf9k Sep 14, 2023
c12915d
Merge pull request #187 from cisagov/lineage/skeleton
mcdonnnj Nov 29, 2023
6397a1c
Merge pull request #188 from cisagov/improvement/update_to_aws_provid…
mcdonnnj Nov 29, 2023
ca595f9
Merge pull request #189 from cisagov/improvement/add_terraform-docs_c…
mcdonnnj Nov 29, 2023
4ae7af7
Merge remote-tracking branch 'skeleton-tf-module/develop' into lineag…
jsf9k Dec 1, 2023
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
2 changes: 1 addition & 1 deletion .bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# https://bandit.readthedocs.io/en/latest/config.html

# Tests are first included by `tests`, and then excluded by `skips`.
# If `tests` is empty, all tests are are considered included.
# If `tests` is empty, all tests are considered included.

tests:
# - B101
Expand Down
32 changes: 18 additions & 14 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,34 @@
# these updates when the pull request(s) in the appropriate skeleton are merged
# and Lineage processes these changes.

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- directory: /
ignore:
# Managed by cisagov/skeleton-generic
- dependency-name: actions/cache
- dependency-name: actions/checkout
- dependency-name: actions/setup-go
- dependency-name: actions/setup-python
- dependency-name: crazy-max/ghaction-dump-context
- dependency-name: crazy-max/ghaction-github-labeler
- dependency-name: crazy-max/ghaction-github-status
- dependency-name: hashicorp/setup-terraform
- dependency-name: mxschmitt/action-tmate

- package-ecosystem: "pip"
directory: "/"
- dependency-name: step-security/harden-runner
package-ecosystem: github-actions
schedule:
interval: "weekly"
interval: weekly

- package-ecosystem: "terraform"
directory: "/"
- directory: /
package-ecosystem: pip
schedule:
interval: "weekly"
# Managed by cisagov/skeleton-tf-module
interval: weekly

- directory: /
ignore:
- dependency-name: "hashicorp/aws"
# Managed by cisagov/skeleton-tf-module
- dependency-name: hashicorp/aws
package-ecosystem: terraform
schedule:
interval: weekly
version: 2
41 changes: 40 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,36 @@ env:
RUN_TMATE: ${{ secrets.RUN_TMATE }}

jobs:
diagnostics:
name: Run diagnostics
runs-on: ubuntu-latest
steps:
# Note that a duplicate of this step must be added at the top of
# each job.
- id: harden-runner
name: Harden the runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- id: github-status
name: Check GitHub status
uses: crazy-max/ghaction-github-status@v3
- id: dump-context
name: Dump context
uses: crazy-max/ghaction-dump-context@v2
lint:
needs:
- diagnostics
runs-on: ubuntu-latest
steps:
- id: harden-runner
name: Harden the runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- id: setup-env
uses: cisagov/setup-env-github-action@develop
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: setup-python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -80,11 +104,26 @@ jobs:
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ steps.setup-env.outputs.terraform-version }}
- name: Install go-critic
env:
PACKAGE_URL: github.com/go-critic/go-critic/cmd/gocritic
PACKAGE_VERSION: ${{ steps.setup-env.outputs.go-critic-version }}
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
- name: Install gosec
env:
PACKAGE_URL: github.com/securego/gosec/v2/cmd/gosec
PACKAGE_VERSION: ${{ steps.setup-env.outputs.gosec-version }}
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
- name: Install shfmt
env:
PACKAGE_URL: mvdan.cc/sh/v3/cmd/shfmt
PACKAGE_VERSION: ${{ steps.setup-env.outputs.shfmt-version }}
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
- name: Install staticcheck
env:
PACKAGE_URL: honnef.co/go/tools/cmd/staticcheck
PACKAGE_VERSION: ${{ steps.setup-env.outputs.staticcheck-version }}
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
- name: Install Terraform-docs
env:
PACKAGE_URL: github.com/terraform-docs/terraform-docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Sync repository labels
if: success()
uses: crazy-max/ghaction-github-labeler@v4
uses: crazy-max/ghaction-github-labeler@v5
with:
# This is a hideous ternary equivalent so we only do a dry run unless
# this workflow is triggered by the develop branch.
Expand Down
30 changes: 18 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ repos:

# Text file hooks
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.34.0
rev: v0.36.0
hooks:
- id: markdownlint
args:
- --config=.mdl_config.yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: v3.0.3
hooks:
- id: prettier
- repo: https://github.com/adrienverge/yamllint
Expand All @@ -49,14 +49,14 @@ repos:

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

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

Expand All @@ -79,6 +79,12 @@ repos:
# GoSec
- id: go-sec-repo-mod

# Nix hooks
- repo: https://github.com/nix-community/nixpkgs-fmt
rev: v1.3.0
hooks:
- id: nixpkgs-fmt

# Shell script hooks
- repo: https://github.com/cisagov/pre-commit-shfmt
rev: v0.0.2
Expand Down Expand Up @@ -106,12 +112,12 @@ repos:
- id: bandit
args:
- --config=.bandit.yml
- repo: https://github.com/psf/black
rev: 23.3.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -121,24 +127,24 @@ repos:
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.5.1
hooks:
- id: mypy
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.10.1
hooks:
- id: pyupgrade

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

# Terraform hooks
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.80.0
rev: v1.83.2
hooks:
- id: terraform_fmt
- id: terraform_validate
Expand Down
13 changes: 13 additions & 0 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
formatter: markdown table
output:
file: README.md
mode: inject
template: |-
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->
settings:
anchor: false
html: false
lockfile: false
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,21 @@ users allowed to provision assessment environments in the COOL.
1. Run the command `terraform init`.
1. Run the command `terraform apply -var-file=<workspace_name>.tfvars`.

<!-- BEGIN_TF_DOCS -->
## Requirements ##

| Name | Version |
|------|---------|
| terraform | ~> 1.0 |
| aws | ~> 3.38 |
| aws | ~> 4.9 |

## Providers ##

| Name | Version |
|------|---------|
| aws | ~> 3.38 |
| aws.organizationsreadonly | ~> 3.38 |
| aws.users | ~> 3.38 |
| aws | ~> 4.9 |
| aws.organizationsreadonly | ~> 4.9 |
| aws.users | ~> 4.9 |
| terraform | n/a |

## Modules ##
Expand Down Expand Up @@ -96,6 +97,7 @@ No modules.
|------|-------------|
| assessment\_provisioners\_group | The IAM group whose members are allowed to provision assessment environments. |
| assessment\_provisioners\_policy | The IAM policy in the Users account that allows the assessment provisioners group to assume the provisioning role in assessment accounts. |
<!-- END_TF_DOCS -->

## Notes ##

Expand Down
14 changes: 10 additions & 4 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ terraform {
# major version currently being used. This practice will help us
# avoid unwelcome surprises.
required_providers {
# Version 3.38.0 of the Terraform AWS provider is the first
# version to support default tags.
# https://www.hashicorp.com/blog/default-tags-in-the-terraform-aws-provider
# Version 4.9 of the Terraform AWS provider made changes to the S3 bucket
# refactor that is in place for versions 4.0-4.8 of the provider. With v4.9
# only non-breaking changes and deprecation notices are introduced. Using
# this version will simplify migration to the new, broken out AWS S3 bucket
# configuration resources. Please see
# https://github.com/hashicorp/terraform-provider-aws/pull/23985
# for more information about the changes in v4.9 and
# https://www.hashicorp.com/blog/terraform-aws-provider-4-0-refactors-s3-bucket-resource
# for more information about the S3 bucket refactor.
aws = {
source = "hashicorp/aws"
version = "~> 3.38"
version = "~> 4.9"
}
}
}