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

devel -> main cis 2.0.1 #97

Merged
merged 148 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
01e70f8
1.1.1.7 now level2
uk-bolly Jul 6, 2023
0072409
1.1.2.x controls updated
uk-bolly Jul 6, 2023
3a33af2
updated ansible version
uk-bolly Jul 6, 2023
6328a0f
renamed file
uk-bolly Jul 6, 2023
64e558f
1.1.3.x updated
uk-bolly Jul 7, 2023
86b596e
1.1.4.x updated
uk-bolly Jul 7, 2023
41b5ddd
1.1.5.x updated
uk-bolly Jul 7, 2023
b7d1495
1.1.6.x updated
uk-bolly Jul 7, 2023
2427936
1.1.7.x updated
uk-bolly Jul 7, 2023
6ccdd65
1.1.8.x updated
uk-bolly Jul 7, 2023
b12b09e
1.2.x updated
uk-bolly Jul 7, 2023
2de8517
1.3.x updated
uk-bolly Jul 7, 2023
dab5c04
1.4.x updated
uk-bolly Jul 7, 2023
032345f
1.5.x updated
uk-bolly Jul 7, 2023
c5e377b
1.6.x updated
uk-bolly Jul 7, 2023
ed0cb4a
1.7 updated
uk-bolly Jul 7, 2023
e04f157
1.8.x updated
uk-bolly Jul 7, 2023
fbdfa71
1.9 removed
uk-bolly Jul 7, 2023
368ba9f
2.1.x updated
uk-bolly Jul 7, 2023
a4df444
2.2.x updated
uk-bolly Jul 7, 2023
9c12095
2.3.x and 2.4 updates
uk-bolly Jul 7, 2023
6a4a482
3.1.x updated
uk-bolly Jul 7, 2023
2818b1d
3.4.x updated
uk-bolly Jul 7, 2023
ec8afec
4.1.x and 4.2.x updated
uk-bolly Jul 7, 2023
6772c87
4.3.x updated
uk-bolly Jul 7, 2023
c67bed4
4.4.x updated
uk-bolly Jul 7, 2023
e97de44
fix typos
uk-bolly Jul 7, 2023
1b7a05c
4.5.x updated
uk-bolly Jul 7, 2023
e63c12c
section 4 update
uk-bolly Jul 7, 2023
4732e9a
5.1.1.x updated
uk-bolly Jul 10, 2023
d5d214d
5.1.2 and 5.1.3 updated
uk-bolly Jul 10, 2023
ba2267c
5.2.1/2/3 updated
uk-bolly Jul 10, 2023
1e5874c
updated
uk-bolly Jul 10, 2023
ca7b3ba
removed files
uk-bolly Jul 10, 2023
0f3da84
fixed labels
uk-bolly Jul 10, 2023
ced5620
5.2.4 updated
uk-bolly Jul 10, 2023
28e4988
5.2.4 rules added
uk-bolly Jul 10, 2023
7f9d81f
6.1 updated
uk-bolly Jul 10, 2023
d3cff66
lint and tidyup
uk-bolly Jul 10, 2023
553d5ec
version updates
uk-bolly Jul 10, 2023
0e969bb
fixed rule is for root passwd
uk-bolly Jul 10, 2023
f1de825
amened order of rules
uk-bolly Jul 10, 2023
f13bdbc
updated rules
uk-bolly Jul 10, 2023
2ae6dbb
updated tags and control ids
uk-bolly Jul 10, 2023
9a989ab
fixed case
uk-bolly Jul 10, 2023
85c87f1
reorder conditional
uk-bolly Jul 10, 2023
0a0e018
update variable name
uk-bolly Jul 10, 2023
1ce0024
add conditionals
uk-bolly Jul 10, 2023
e120f3d
Added files
uk-bolly Jul 10, 2023
ea067d7
updated default vars
uk-bolly Jul 10, 2023
561f399
improved bluetooth control
uk-bolly Jul 10, 2023
d5d77a3
updated vars
uk-bolly Jul 10, 2023
8c9927c
updated sudo vars
uk-bolly Jul 10, 2023
ae783ab
updated sudoers file discovery
uk-bolly Jul 10, 2023
630cb4d
fixed 1.5.3 with create
uk-bolly Jul 10, 2023
4faaa7b
updated to add chrony sources.d directory
uk-bolly Jul 10, 2023
0d97fa8
fixed notify naming
uk-bolly Jul 10, 2023
98b36b9
updated vars
uk-bolly Jul 10, 2023
25e307c
changed to system from service
uk-bolly Jul 10, 2023
4b7bb9a
fixed naming
uk-bolly Jul 10, 2023
e7a8bb9
update notify
uk-bolly Jul 10, 2023
a41a3d7
update var
uk-bolly Jul 10, 2023
26ae789
fixed multiple rule names
uk-bolly Jul 10, 2023
da9eb2f
changed syslog service handler naming
uk-bolly Jul 10, 2023
e5aee70
fixed conditional
uk-bolly Jul 10, 2023
9651d6f
fixed path and name 5.2.3.3
uk-bolly Jul 10, 2023
29fa9f3
Added new prelim check and discovery
uk-bolly Jul 11, 2023
bdbb70b
fixed typos
uk-bolly Jul 11, 2023
4a2e862
fix typos
uk-bolly Jul 11, 2023
2bf0a92
improve logic
uk-bolly Jul 11, 2023
23334f9
Added new default vars and container default
uk-bolly Jul 11, 2023
f75656d
Add container discovery
uk-bolly Jul 11, 2023
788c836
Time source options for chrony pools or servers
uk-bolly Jul 11, 2023
c1cdc77
rework of chrony control
uk-bolly Jul 11, 2023
8244b01
fix permissions
uk-bolly Jul 11, 2023
999c8be
make idempotent
uk-bolly Jul 11, 2023
738923b
fix conditional name match
uk-bolly Jul 11, 2023
352c5b7
fix conditional name match
uk-bolly Jul 11, 2023
90c7c16
fixed handler and removed state
uk-bolly Jul 11, 2023
ff317e1
fixed logic
uk-bolly Jul 11, 2023
1ae870e
Added template
uk-bolly Jul 11, 2023
7635923
removed file not required
uk-bolly Jul 11, 2023
358a90d
initial
uk-bolly Jul 11, 2023
ca5ac5a
fix logic
uk-bolly Jul 11, 2023
7e20e05
default time sync timesyncd
uk-bolly Jul 11, 2023
efa969e
improve logic
uk-bolly Jul 11, 2023
0a0609b
idempotency improvement
uk-bolly Jul 11, 2023
98085a2
fix conditional
uk-bolly Jul 11, 2023
1371f4f
updated
uk-bolly Jul 12, 2023
8693696
updated template
uk-bolly Jul 18, 2023
1188655
fix logic
uk-bolly Jul 18, 2023
a5be1f5
Added directory if missing
uk-bolly Jul 18, 2023
8b14261
reboot in post tasks only
uk-bolly Jul 18, 2023
424a80f
var alignment
uk-bolly Jul 18, 2023
e92b5c0
fixed var name
uk-bolly Jul 19, 2023
f2f4ecf
Added step to stop service
uk-bolly Jul 19, 2023
c4f565c
removed invalid entries and tidy up
uk-bolly Jul 19, 2023
737c58d
fixed rules
uk-bolly Jul 19, 2023
0d44075
Added missing mode
uk-bolly Jul 19, 2023
734002a
add min_uid var
uk-bolly Jul 19, 2023
c03dacb
lint updates
uk-bolly Jul 19, 2023
928bcbe
syslog service var added
uk-bolly Jul 19, 2023
5902dea
ufw default firewall
uk-bolly Jul 19, 2023
b87ca2e
fixed loop
uk-bolly Jul 19, 2023
792478a
fixed control 3.4.1.7
uk-bolly Jul 19, 2023
7ef3f26
Add sudo user password check
uk-bolly Jul 26, 2023
90b80d7
Merge branch 'devel' into cis_2.0.1
uk-bolly Sep 11, 2023
71b2757
updated handler naming
uk-bolly Sep 11, 2023
3463ae0
4.1.8 group updated
uk-bolly Sep 11, 2023
b7581cd
update handler & blacklist added
uk-bolly Sep 11, 2023
a2b7b00
blacklist added
uk-bolly Sep 11, 2023
f046ed0
added pre-commit setup
uk-bolly Sep 11, 2023
0d9ee73
added pre-commit
uk-bolly Sep 11, 2023
b198a6b
updated
uk-bolly Sep 11, 2023
3580160
updated secrets
uk-bolly Sep 11, 2023
06e3cc9
updated passwd_hash_algo line
uk-bolly Sep 11, 2023
d22a744
aligned var naming
uk-bolly Sep 11, 2023
492a486
Added precommit
uk-bolly Sep 13, 2023
20ed92b
updated .github content workflow
uk-bolly Sep 13, 2023
ccba850
updated secrets scan
uk-bolly Sep 13, 2023
11db92a
yamllint updates
uk-bolly Sep 13, 2023
f0f3a28
workflow updates
uk-bolly Sep 13, 2023
be4da56
updated truth value
uk-bolly Sep 13, 2023
f0e2e67
updated commits
uk-bolly Sep 13, 2023
17c7401
Merge pull request #91 from ansible-lockdown/cis_2.0.1
uk-bolly Sep 13, 2023
d2e4b58
updated discord link
uk-bolly Sep 18, 2023
47fc6e8
Merge pull request #92 from ansible-lockdown/discord_link
uk-bolly Sep 18, 2023
dd7eb09
added to create when configured logfile does not exist
uk-bolly Sep 19, 2023
c8f5ebf
updated
uk-bolly Sep 19, 2023
073df00
lint updates
uk-bolly Sep 19, 2023
a9f7ef4
audited
uk-bolly Sep 19, 2023
82ba1c3
updated baselines
uk-bolly Sep 19, 2023
03d1b7b
updated secrets
uk-bolly Sep 19, 2023
e68ea6c
Merge pull request #94 from ansible-lockdown/issue_#90
uk-bolly Sep 19, 2023
7321713
Merge pull request #95 from ansible-lockdown/issue_#90
uk-bolly Sep 19, 2023
9370aee
updated badges
uk-bolly Sep 19, 2023
d57debb
Merge pull request #96 from ansible-lockdown/badges
uk-bolly Sep 20, 2023
c48b7c9
Fixes remount /tmp typo
dderemiah Sep 20, 2023
32cbc8f
Merge pull request #93 from dderemiah/typo_fix
uk-bolly Sep 21, 2023
8223dc8
updated for grub password settings
uk-bolly Sep 21, 2023
c9881b9
updated
uk-bolly Sep 22, 2023
d236a18
updated
uk-bolly Sep 22, 2023
7b9281e
updated template for bootloader hash
uk-bolly Sep 22, 2023
a1c073c
Merge pull request #98 from ansible-lockdown/grub_passwd
MrSteve81 Sep 22, 2023
a652e11
typo fix
uk-bolly Sep 25, 2023
ebafd8d
updated goss link
uk-bolly Sep 25, 2023
5afca4c
added attributes file
uk-bolly Sep 25, 2023
9b87264
Merge pull request #99 from ansible-lockdown/readme
uk-bolly Sep 25, 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
4 changes: 4 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
---

parseable: true
quiet: true
skip_list:
- 'schema'
- 'no-changed-when'
- 'var-spacing'
- 'fqcn-builtins'
- 'experimental'
- 'name[play]'
- 'name[casing]'
- 'name[template]'
- 'fqcn[action]'
- 'key-order[task]'
- '204'
- '305'
- '303'
Expand Down
1 change: 1 addition & 0 deletions .config/.gitleaks-report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
119 changes: 119 additions & 0 deletions .config/.secrets.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"version": "1.4.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
},
{
"name": "AWSKeyDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
},
{
"name": "CloudantDetector"
},
{
"name": "DiscordBotTokenDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3.0
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "JwtTokenDetector"
},
{
"name": "KeywordDetector",
"keyword_exclude": ""
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
},
{
"path": "detect_secrets.filters.regex.should_exclude_file",
"pattern": [
".config/.gitleaks-report.json",
"tasks/parse_etc_password.yml"
]
}
],
"results": {},
"generated_at": "2023-09-19T12:32:59Z"
}
20 changes: 20 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github
# Default behaviour
* text=auto

# https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
# Ensure to read artcile prior to adding
# Scripts should have Unix endings
*.py text eol=lf
*.sh text eol=lf

# Windows Batch or PowerShell scripts should have CRLF endings
*.bat text eol=crlf
*.ps1 text eol=crlf

# adding github settings to show correct language
*.sh linguist-detectable=true
*.yml linguist-detectable=true
*.ps1 linguist-detectable=true
*.j2 linguist-detectable=true
*.md linguist-documentation
32 changes: 0 additions & 32 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE/feature-request-or-enhancement.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/question.md

This file was deleted.

11 changes: 0 additions & 11 deletions .github/pull_request_template.md

This file was deleted.

9 changes: 0 additions & 9 deletions .github/workflows/OS.tfvars

This file was deleted.

138 changes: 138 additions & 0 deletions .github/workflows/devel_pipeline_validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---

name: Devel pipeline

on: # yamllint disable-line rule:truthy
pull_request_target:
types: [opened, reopened, synchronize]
branches:
- devel
paths:
- '**.yml'
- '**.sh'
- '**.j2'
- '**.ps1'
- '**.cfg'

# 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: ubuntu-latest

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 which tests the playbook
playbook-test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
ENABLE_DEBUG: ${{ vars.ENABLE_DEBUG }}
# Imported as a variable by terraform
TF_VAR_repository: ${{ github.event.repository.name }}
defaults:
run:
shell: bash
working-directory: .github/workflows/github_linux_IaC

steps:
- name: Clone ${{ github.event.repository.name }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

# Pull in terraform code for linux servers
- name: Clone github IaC plan
uses: actions/checkout@v3
with:
repository: ansible-lockdown/github_linux_IaC
path: .github/workflows/github_linux_IaC

- name: Add_ssh_key
working-directory: .github/workflows
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
PRIVATE_KEY: "${{ secrets.SSH_PRV_KEY }}"
run: |
mkdir .ssh
chmod 700 .ssh
echo $PRIVATE_KEY > .ssh/github_actions.pem
chmod 600 .ssh/github_actions.pem

- name: DEBUG - Show IaC files
if: env.ENABLE_DEBUG == 'true'
run: |
echo "OSVAR = $OSVAR"
echo "benchmark_type = $benchmark_type"
pwd
ls
env:
# Imported from github variables this is used to load the relvent OS.tfvars file
OSVAR: ${{ vars.OSVAR }}
benchmark_type: ${{ vars.BENCHMARK_TYPE }}

- name: Terraform_Init
id: init
run: terraform init
env:
# Imported from github variables this is used to load the relvent OS.tfvars file
OSVAR: ${{ vars.OSVAR }}
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }}

- name: Terraform_Validate
id: validate
run: terraform validate
env:
# Imported from github variables this is used to load the relvent OS.tfvars file
OSVAR: ${{ vars.OSVAR }}
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }}

- name: Terraform_Apply
id: apply
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
OSVAR: ${{ vars.OSVAR }}
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }}
run: terraform apply -var-file "github_vars.tfvars" -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 for 60 seconds
run: sleep 60s

# Run the ansible playbook
- name: Run_Ansible_Playbook
uses: arillso/action.playbook@master
with:
playbook: site.yml
inventory: .github/workflows/github_linux_IaC/hosts.yml
galaxy_file: collections/requirements.yml
private_key: ${{ secrets.SSH_PRV_KEY }}
# verbose: 3
env:
ANSIBLE_HOST_KEY_CHECKING: "false"
ANSIBLE_DEPRECATION_WARNINGS: "false"

# Remove test system - User secrets to keep if necessary

- name: Terraform_Destroy
if: always() && env.ENABLE_DEBUG == 'false'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
OSVAR: ${{ vars.OSVAR }}
TF_VAR_benchmark_type: ${{ vars.BENCHMARK_TYPE }}
run: terraform destroy -var-file "github_vars.tfvars" -var-file "${OSVAR}.tfvars" --auto-approve -input=false
Loading
Loading