-
Notifications
You must be signed in to change notification settings - Fork 24
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
Cis v3 #35
Merged
Cis v3 #35
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
8863b52
tidy up workflow and variables
uk-bolly 5055f80
updated git files
uk-bolly 13021cb
removed arg warn
uk-bolly c31fd92
lint fqcn
uk-bolly 71c63e6
reboot option and warning
uk-bolly c82b079
update checks and reboot added
uk-bolly 87fb55c
section1 and 2 updates
uk-bolly 6ae08b3
updated and aligned for v3
uk-bolly 5aa4a13
v3_updates
uk-bolly 615a594
audit_only_updates
uk-bolly 620cdc6
updated audit
uk-bolly 1310ee4
Added auditd post file
uk-bolly a091ad4
lint
uk-bolly b04665e
fix firewall variable
uk-bolly b404200
fix layout 4.2.16
uk-bolly 9b96b9e
updated requirements
uk-bolly 5125d72
improve idempotency
uk-bolly 05964f6
fix rule numbers
uk-bolly 7ca66aa
fix logic
uk-bolly 855344f
updated control
uk-bolly 85ef725
updated
uk-bolly 8c63696
updated 4.5.1.1
uk-bolly 60cbf6e
fix loop
uk-bolly 5056ba2
updated authtok
uk-bolly 6e0652b
fix typo
uk-bolly 19c2d0b
updated grub handler
uk-bolly e441188
updated prelim passwd parse
uk-bolly 05d7dc0
fixed
uk-bolly 7eae1ec
updated
uk-bolly 14897b1
aligned
uk-bolly e51cf1e
disruption high added
uk-bolly 3f8ba31
remove skip lint var update
uk-bolly 9fb1b84
fix notify
uk-bolly 2f4f9fe
Updated README
uk-bolly 536fb0c
Enabled 2.11 compatible
uk-bolly 7b76f47
updated optional controls
uk-bolly 80fe150
removed container
uk-bolly f3611a3
updated
uk-bolly 562d164
improve idempotency
uk-bolly 81c0ad9
removed container checks
uk-bolly 1796359
updated for galaxy_ng reqs
uk-bolly 8308ad9
updated Credits
uk-bolly 51a87f4
tidy up
uk-bolly 52e26f6
fixed 5.2.4.x sections and prelim
uk-bolly 0b97ec7
fixed vars for arch naming for bin
uk-bolly 8dfc933
add levels and audit setting
uk-bolly 2bd36ed
improve controls
uk-bolly 74921cc
aligned with audit
uk-bolly ae6e4e9
remove audit entries moved to vars
uk-bolly 9f5ba29
file not required
uk-bolly 0334eeb
updated
uk-bolly 42e6160
updated 4.5.1.1
uk-bolly 1dac122
changed default not to force passwd change
uk-bolly d30df1d
updated workflow for v3
uk-bolly 92a411d
updated maks logic and values
uk-bolly 7bb0c2f
lint updates
uk-bolly 9fcb558
updates
uk-bolly 6bf65cd
updated audit
uk-bolly ab0dfb7
pipelineupdates
uk-bolly c415011
typo tidyup
uk-bolly 623319b
audit moved to prelim
uk-bolly 49d4df7
control tidy up
uk-bolly 69a1c91
Merge pull request #1 from ansible-lockdown/v3_updates
uk-bolly 92e8581
updated file
uk-bolly 6bf9641
updated with correct handler name
uk-bolly 96e3b6b
Merge pull request #2 from ansible-lockdown/v3_updates
uk-bolly d8002e8
V3 updates - workflow updates (#3)
uk-bolly d675ccc
Merge branch 'devel' into cis_v3
uk-bolly 38f53b8
added for legacy pipeline while new pipeline implemented
uk-bolly 273aa22
added for legacy pipeline while new pipeline implemented
uk-bolly fb622bf
added for legacy pipeline while new pipeline implemented
uk-bolly 420e62b
added vars to skip
uk-bolly 3e24f07
lint
uk-bolly 566c2f0
Tidy up and lint
uk-bolly e6ce41c
fix title of 5.2.3.6
uk-bolly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
# Amazon Linux 2 | ||
ami_id = "ami-03e0b06f01d45a4eb" | ||
ami_os = "AmazonLinux2" | ||
ami_username = "ec2-user" | ||
ami_user_home = "/home/ec2-user" | ||
benchmark_os = "Amazon2" | ||
privsubnet_id = "subnet-0ce2cd3c739f6421c" | ||
vpc_secgrp_id = "sg-0c0593968712e684d" | ||
benchmark_type = "CIS" |
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,159 @@ | ||
--- | ||
|
||
name: Devel pipeline | ||
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request_target: | ||
types: [opened, reopened, synchronize] | ||
branches: | ||
- devel | ||
paths: | ||
- '**.yml' | ||
- '**.sh' | ||
- '**.j2' | ||
- '**.ps1' | ||
- '**.cfg' | ||
# Allow manual running of workflow | ||
workflow_dispatch: | ||
|
||
# Allow permissions for AWS auth | ||
permissions: | ||
id-token: write | ||
contents: read | ||
pull-requests: read | ||
|
||
# A workflow run is made up of one or more jobs | ||
# that can run sequentially or in parallel | ||
jobs: | ||
# This will create messages for first time contributers and direct them to the Discord server | ||
welcome: | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- uses: actions/first-interaction@main | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
pr-message: |- | ||
Congrats on opening your first pull request and thank you for taking the time to help improve Ansible-Lockdown! | ||
Please join in the conversation happening on the [Discord Server](https://www.lockdownenterprise.com/discord) as well. | ||
|
||
# This workflow contains a single job that tests the playbook | ||
playbook-test: | ||
# The type of runner that the job will run on | ||
runs-on: self-hosted | ||
env: | ||
ENABLE_DEBUG: ${{ vars.ENABLE_DEBUG }} | ||
# Imported as a variable by terraform | ||
TF_VAR_repository: ${{ github.event.repository.name }} | ||
AWS_REGION: "us-east-1" | ||
ANSIBLE_VERSION: ${{ vars.ANSIBLE_RUNNER_VERSION }} | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: .github/workflows/github_linux_IaC | ||
# working-directory: .github/workflows | ||
|
||
steps: | ||
|
||
- name: Git clone the lockdown repository to test | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: If a variable for IAC_BRANCH is set use that branch | ||
working-directory: .github/workflows | ||
run: | | ||
if [ ${{ vars.IAC_BRANCH }} != '' ]; then | ||
echo "IAC_BRANCH=${{ vars.IAC_BRANCH }}" >> $GITHUB_ENV | ||
echo "Pipeline using the following IAC branch ${{ vars.IAC_BRANCH }}" | ||
else | ||
echo IAC_BRANCH=main >> $GITHUB_ENV | ||
fi | ||
|
||
|
||
# Pull in terraform code for linux servers | ||
- name: Clone GitHub IaC plan | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ansible-lockdown/github_linux_IaC | ||
path: .github/workflows/github_linux_IaC | ||
ref: ${{ env.IAC_BRANCH }} | ||
|
||
# Uses dedicated restricted role and policy to enable this only for this task | ||
# No credentials are part of github for AWS auth | ||
- name: configure aws credentials | ||
uses: aws-actions/configure-aws-credentials@main | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE }} | ||
role-session-name: ${{ secrets.AWS_ROLE_SESSION }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: DEBUG - Show IaC files | ||
if: env.ENABLE_DEBUG == 'true' | ||
run: | | ||
echo "OSVAR = $OSVAR" | ||
echo "benchmark_type = $benchmark_type" | ||
echo "PRIVSUBNET_ID = $AWS_PRIVSUBNET_ID" | ||
echo "VPC_ID" = $AWS_VPC_SECGRP_ID" | ||
pwd | ||
ls | ||
env: | ||
# Imported from GitHub variables this is used to load the relevant OS.tfvars file | ||
OSVAR: ${{ vars.OSVAR }} | ||
benchmark_type: ${{ vars.BENCHMARK_TYPE }} | ||
PRIVSUBNET_ID: ${{ secrets.AWS_PRIVSUBNET_ID }} | ||
VPC_ID: ${{ secrets.AWS_VPC_SECGRP_ID }} | ||
|
||
- name: Tofu init | ||
id: init | ||
run: tofu init | ||
env: | ||
# Imported from GitHub variables this is used to load the relevant OS.tfvars file | ||
OSVAR: ${{ vars.OSVAR }} | ||
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }} | ||
|
||
- name: Tofu validate | ||
id: validate | ||
run: tofu validate | ||
env: | ||
# Imported from GitHub variables this is used to load the relevant OS.tfvars file | ||
OSVAR: ${{ vars.OSVAR }} | ||
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }} | ||
|
||
- name: Tofu apply | ||
id: apply | ||
env: | ||
OSVAR: ${{ vars.OSVAR }} | ||
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }} | ||
TF_VAR_privsubnet_id: ${{ secrets.AWS_PRIVSUBNET_ID }} | ||
TF_VAR_vpc_secgrp_id: ${{ secrets.AWS_VPC_SECGRP_ID }} | ||
run: tofu apply -var-file "${OSVAR}.tfvars" --auto-approve -input=false | ||
|
||
## Debug Section | ||
- name: DEBUG - Show Ansible hostfile | ||
if: env.ENABLE_DEBUG == 'true' | ||
run: cat hosts.yml | ||
|
||
# Aws deployments taking a while to come up insert sleep or playbook fails | ||
|
||
- name: Sleep to allow system to come up | ||
run: sleep ${{ vars.BUILD_SLEEPTIME }} | ||
|
||
# Run the Ansible playbook | ||
- name: Run_Ansible_Playbook | ||
env: | ||
ANSIBLE_HOST_KEY_CHECKING: "false" | ||
ANSIBLE_DEPRECATION_WARNINGS: "false" | ||
run: | | ||
/opt/ansible_${{ env.ANSIBLE_VERSION }}_venv/bin/ansible-playbook -i hosts.yml --private-key ~/.ssh/le_runner ../../../site.yml | ||
|
||
# Remove test system - User secrets to keep if necessary | ||
|
||
- name: Tofu Destroy | ||
if: always() && env.ENABLE_DEBUG == 'false' | ||
env: | ||
OSVAR: ${{ vars.OSVAR }} | ||
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }} | ||
TF_VAR_privsubnet_id: ${{ secrets.AWS_PRIVSUBNET_ID }} | ||
TF_VAR_vpc_secgrp_id: ${{ secrets.AWS_VPC_SECGRP_ID }} | ||
run: tofu destroy -var-file "${OSVAR}.tfvars" --auto-approve -input=false |
2 changes: 1 addition & 1 deletion
2
.github/workflows/github_networks.tf → .github/workflows/github_network.tf
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you use the centralized repo for testing ?
https://github.com/ansible-lockdown/github_linux_IaC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be moved to that workflow and a new config we have, due to the way we have restricted direct changes to the workflow files we have to go through a few PRs ensuring pipelines pass before files are commited. Its on its way. :)