Skip to content

Commit 32b9d9b

Browse files
Merge pull request #23 from ansible-lockdown/devel
2023 October Updates based on CIS Benchmark v2.0.0 + Typo Fixes
2 parents 045361d + 07747f3 commit 32b9d9b

40 files changed

+4778
-4574
lines changed

.ansible-lint

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
---
2+
23
parseable: true
34
quiet: true
45
skip_list:
56
- 'schema'
67
- 'no-changed-when'
7-
- 'var-spacing'
8-
- 'fqcn-builtins'
98
- 'experimental'
10-
- 'name[play]'
119
- 'name[casing]'
1210
- 'name[template]'
13-
- 'fqcn[action]'
11+
- 'jinja[spacing]'
12+
- 'yaml[line-length]'
13+
- 'key-order[task]'
14+
- 'var-naming' # Older playbook no new release
1415
- '204'
16+
- '208'
1517
- '305'
1618
- '303'
1719
- '403'
1820
- '306'
1921
- '602'
20-
- '208'
2122
use_default_rules: true
2223
verbosity: 0

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/feature-request-or-enhancement.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
3+
# This is a basic workflow to help you get started with Actions
4+
5+
name: Devel Pipeline Validation
6+
7+
# Controls when the action will run.
8+
# Triggers the workflow on push or pull request
9+
# events but only for the devel branch
10+
on: # yamllint disable-line rule:truthy
11+
pull_request_target:
12+
types: [opened, reopened, synchronize]
13+
branches:
14+
- devel
15+
paths:
16+
- '**.yml'
17+
- '**.sh'
18+
- '**.j2'
19+
- '**.ps1'
20+
- '**.cfg'
21+
22+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
23+
# This section contains all the jobs below that are running in the workflow.
24+
jobs:
25+
# This will create messages for the first time contributors and direct them to the Discord server
26+
welcome:
27+
# The type of runner that the job will run on.
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/first-interaction@main
31+
with:
32+
repo-token: ${{ secrets.GITHUB_TOKEN }}
33+
pr-message: |-
34+
Congrats on opening your first pull request and thank you for taking the time to help improve Ansible-Lockdown!
35+
Please join in the conversation happening on the [Discord Server](https://www.lockdownenterprise.com/discord) as well.
36+
37+
# This workflow will run Terraform to load an instance in Azure to test the playbook against a live cloud-based instance.
38+
playbook-test:
39+
# The type of runner that the job will run on.
40+
runs-on: ubuntu-latest
41+
42+
env:
43+
ENABLE_DEBUG: false
44+
# Imported as a variable by terraform.
45+
TF_VAR_repository: ${{ github.event.repository.name }}
46+
ARM_CLIENT_ID: ${{ secrets.AZURE_AD_CLIENT_ID }}
47+
ARM_CLIENT_SECRET: ${{ secrets.AZURE_AD_CLIENT_SECRET }}
48+
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
49+
ARM_TENANT_ID: ${{ secrets.AZURE_AD_TENANT_ID }}
50+
WIN_USERNAME: ${{ secrets.WIN_USERNAME }}
51+
WIN_PASSWORD: ${{ secrets.WIN_PASSWORD }}
52+
53+
defaults:
54+
run:
55+
shell: bash
56+
working-directory: .github/workflows/github_windows_IaC
57+
58+
# Steps represent a sequence of tasks that will be executed as part of the job.
59+
steps:
60+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
61+
- name: Clone ${{ github.event.repository.name }}
62+
uses: actions/checkout@v3
63+
with:
64+
ref: ${{ github.event.pull_request.head.sha }}
65+
66+
# Pull In Terraform Code For Windows Azure
67+
- name: Clone github IaC plan
68+
uses: actions/checkout@v3
69+
with:
70+
repository: ansible-lockdown/github_windows_IaC
71+
path: .github/workflows/github_windows_IaC
72+
73+
# Sensitive Data Stored And Passed To Terraform
74+
# Default Working Dir Defined In Defaults Above.
75+
- name: user details
76+
run: echo "{\"username\":\"${WIN_USERNAME}\",\"password\":\"${WIN_PASSWORD}\"}" >> sensitive_info.json
77+
78+
# Show the Os Var and Benchmark Type And Load
79+
- name: DEBUG - Show IaC files
80+
if: env.ENABLE_DEBUG == 'true'
81+
run: |
82+
echo "OSVAR = $OSVAR"
83+
echo "benchmark_type = $benchmark_type"
84+
pwd
85+
ls
86+
env:
87+
# Imported from github variables this is used to load the relevant OS.tfvars file
88+
OSVAR: ${{ vars.OSVAR }}
89+
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }}
90+
91+
# Initialize The Terraform Working Directory
92+
- name: Terraform_Init
93+
id: init
94+
run: terraform init
95+
env:
96+
# Imported from github variables this is used to load the relevant OS.tfvars file
97+
OSVAR: ${{ vars.OSVAR }}
98+
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }}
99+
100+
# Validate The Syntax Of Terraform Files
101+
- name: Terraform_Validate
102+
id: validate
103+
run: terraform validate
104+
env:
105+
# Imported from github variables this is used to load the relevant OS.tfvars file
106+
OSVAR: ${{ vars.OSVAR }}
107+
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }}
108+
109+
# Execute The Actions And Build Azure Server
110+
- name: Terraform_Apply
111+
id: apply
112+
env:
113+
# Imported from github variables this is used to load the relevant OS.tfvars file
114+
WIN_USERNAME: ${{ secrets.WIN_USERNAME }}
115+
WIN_PASSWORD: ${{ secrets.WIN_PASSWORD }}
116+
OSVAR: ${{ vars.OSVAR }}
117+
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }}
118+
run: terraform apply -var-file "${OSVAR}.tfvars" --auto-approve
119+
120+
# Debug Section
121+
- name: DEBUG - Show Ansible Hostfile
122+
if: env.ENABLE_DEBUG == 'true'
123+
run: cat hosts.yml
124+
125+
# Run the Ansible Playbook
126+
- name: Run_Ansible_Playbook
127+
uses: arillso/action.playbook@master
128+
with:
129+
playbook: site.yml
130+
inventory: .github/workflows/github_windows_IaC/hosts.yml
131+
galaxy_file: collections/requirements.yml
132+
# verbose: 3
133+
env:
134+
ANSIBLE_HOST_KEY_CHECKING: "false"
135+
ANSIBLE_DEPRECATION_WARNINGS: "false"
136+
137+
# Destroy The Azure Test System
138+
- name: Terraform_Destroy
139+
if: always() && env.ENABLE_DEBUG == 'false'
140+
env:
141+
OSVAR: ${{ vars.OSVAR }}
142+
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }}
143+
run: terraform destroy -var-file "${OSVAR}.tfvars" --auto-approve

0 commit comments

Comments
 (0)