Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into lineage/skeleton

# Conflicts:
#	.github/dependabot.yml
#	README.md
#	meta/main.yml
#	meta/requirements.yml
#	molecule/default/requirements.yml
  • Loading branch information
mcdonnnj committed Oct 20, 2023
2 parents ab3ef2e + 0cc9d7d commit 0c8a5fc
Show file tree
Hide file tree
Showing 12 changed files with 175 additions and 55 deletions.
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
41 changes: 27 additions & 14 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,47 @@
# 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
# # Managed by cisagov/skeleton-ansible-role-with-test-user
# - dependency-name: aws-actions/configure-aws-credentials
package-ecosystem: github-actions
schedule:
interval: "weekly"
interval: weekly

- directory: /
ignore:
# Managed by cisagov/skeleton-ansible-role
- dependency-name: "ansible"
- dependency-name: "ansible-lint"

- package-ecosystem: "terraform"
directory: "/terraform"
- dependency-name: ansible
- dependency-name: ansible-lint
package-ecosystem: pip
schedule:
<<<<<<< HEAD
interval: "weekly"

Check failure on line 36 in .github/dependabot.yml

View workflow job for this annotation

GitHub Actions / lint

36:15 syntax error: could not find expected ':' (syntax)

Check failure on line 36 in .github/dependabot.yml

View workflow job for this annotation

GitHub Actions / lint

36:15 syntax error: could not find expected ':' (syntax)
ignore:
# Managed by cisagov/skeleton-ansible-role-with-test-user
- dependency-name: "hashicorp/aws"
=======
interval: weekly

- directory: /terraform
# ignore:
# # Managed by cisagov/skeleton-ansible-role-with-test-user
# - dependency-name: hashicorp/aws
package-ecosystem: terraform
schedule:
interval: weekly
version: 2
>>>>>>> 0cc9d7dd32f3ca2f4dbdfa849030a0ffc0ee3891
54 changes: 50 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,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 @@ -81,11 +105,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 All @@ -103,14 +142,21 @@ jobs:
uses: mxschmitt/action-tmate@v3
if: env.RUN_TMATE
test:
needs:
- diagnostics
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scenario:
- default
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: harden-runner
name: Harden the runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- uses: actions/checkout@v4
- id: setup-python
uses: actions/setup-python@v4
with:
Expand All @@ -131,7 +177,7 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade --requirement requirements-test.txt
- name: Assume AWS test role
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"
name: CodeQL

on:
push:
Expand Down Expand Up @@ -37,8 +37,14 @@ jobs:
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- id: harden-runner
name: Harden the runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
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
32 changes: 19 additions & 13 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 All @@ -105,15 +111,15 @@ repos:
hooks:
- id: bandit
# Bandit complains about the use of assert() in tests
exclude: molecule/default/tests
exclude: molecule/(default|systemd_enabled)/tests
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 @@ -123,24 +129,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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ None.
Here's how to use it in a playbook:

```yaml
<<<<<<< HEAD
- hosts: commander
become: yes
=======
- hosts: all
become: true
>>>>>>> 0cc9d7dd32f3ca2f4dbdfa849030a0ffc0ee3891
become_method: sudo
tasks:
- name: Install the CyHy commander
Expand Down
27 changes: 27 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
<<<<<<< HEAD
dependencies:

Check failure on line 3 in meta/main.yml

View workflow job for this annotation

GitHub Actions / lint

3:13 syntax error: mapping values are not allowed here (syntax)

Check failure on line 3 in meta/main.yml

View workflow job for this annotation

GitHub Actions / lint

3:13 syntax error: mapping values are not allowed here (syntax)
- name: pip
src: https://github.com/cisagov/ansible-role-pip
Expand All @@ -8,6 +9,14 @@ dependencies:
src: https://github.com/cisagov/ansible-role-python
vars:
python_install_python2: true
=======
# Note that dependencies listed here are automatically installed
# before this role. Role variables for any roles listed here can be
# assigned static variables.
#
# See also cisagov/skeleton-ansible-role#153.
dependencies: []
>>>>>>> 0cc9d7dd32f3ca2f4dbdfa849030a0ffc0ee3891
galaxy_info:
author: Shane Frasier
company: CISA Cyber Assessments
Expand All @@ -29,4 +38,22 @@ galaxy_info:
- name: Debian
versions:
- buster
<<<<<<< HEAD
role_name: cyhy_commander
=======
- bullseye
- bookworm
- name: Fedora
versions:
- "37"
- "38"
- name: Kali
versions:
- "2023"
- name: Ubuntu
versions:
- focal
- jammy
role_name: skeleton_with_test_user
standalone: true
>>>>>>> 0cc9d7dd32f3ca2f4dbdfa849030a0ffc0ee3891
14 changes: 14 additions & 0 deletions meta/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
---
<<<<<<< HEAD
- name: cyhy_core

Check failure on line 3 in meta/requirements.yml

View workflow job for this annotation

GitHub Actions / lint

3:7 syntax error: mapping values are not allowed here (syntax)

Check failure on line 3 in meta/requirements.yml

View workflow job for this annotation

GitHub Actions / lint

3:7 syntax error: mapping values are not allowed here (syntax)
src: https://github.com/cisagov/ansible-role-cyhy-core
=======
# Note that dependencies listed here are made available to the role
# but _are not_ automatically installed. Role variables cannot be
# specified here.
#
# It _is_ possible to list both collections and roles in this file,
# but unfortunately ansible-galaxy attempts to naively merge the
# dependencies listed in meta/main.yml with these. That means that
# both sets of dependencies must be lists. :(
#
# See also cisagov/skeleton-ansible-role#153.
[]
>>>>>>> 0cc9d7dd32f3ca2f4dbdfa849030a0ffc0ee3891
Loading

0 comments on commit 0c8a5fc

Please sign in to comment.