Skip to content

Commit f23cb34

Browse files
authored
Merge pull request #60 from ansible-lockdown/devel
workflow run devel -> main
2 parents 9b29660 + 3d7ee65 commit f23cb34

File tree

3 files changed

+78
-3
lines changed

3 files changed

+78
-3
lines changed

.pre-commit-config.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
##### CI for use by github no need for action to be added
3+
##### Inherited
4+
ci:
5+
autofix_prs: false
6+
skip: [detect-aws-credentials, ansible-lint ]
7+
8+
repos:
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v3.2.0
11+
hooks:
12+
# Safety
13+
- id: detect-aws-credentials
14+
- id: detect-private-key
15+
16+
# git checks
17+
- id: check-merge-conflict
18+
- id: check-added-large-files
19+
- id: check-case-conflict
20+
21+
# General checks
22+
- id: trailing-whitespace
23+
name: Trim Trailing Whitespace
24+
description: This hook trims trailing whitespace.
25+
entry: trailing-whitespace-fixer
26+
language: python
27+
types: [text]
28+
args: [--markdown-linebreak-ext=md]
29+
- id: end-of-file-fixer
30+
31+
# Scan for passwords
32+
- repo: https://github.com/Yelp/detect-secrets
33+
rev: v1.4.0
34+
hooks:
35+
- id: detect-secrets
36+
args: [ '--baseline', '.config/.secrets.baseline' ]
37+
exclude: .config/.gitleaks-report.json
38+
39+
- repo: https://github.com/gitleaks/gitleaks
40+
rev: v8.17.0
41+
hooks:
42+
- id: gitleaks
43+
args: ['--baseline-path', '.config/.gitleaks-report.json']
44+
45+
- repo: https://github.com/ansible-community/ansible-lint
46+
rev: v6.17.2
47+
hooks:
48+
- id: ansible-lint
49+
name: Ansible-lint
50+
description: This hook runs ansible-lint.
51+
entry: python3 -m ansiblelint --force-color site.yml -c .ansible-lint
52+
language: python
53+
# do not pass files to ansible-lint, see:
54+
# https://github.com/ansible/ansible-lint/issues/611
55+
pass_filenames: false
56+
always_run: true
57+
additional_dependencies:
58+
# https://github.com/pre-commit/pre-commit/issues/1526
59+
# If you want to use specific version of ansible-core or ansible, feel
60+
# free to override `additional_dependencies` in your own hook config
61+
# file.
62+
- ansible-core>=2.10.1
63+
64+
- repo: https://github.com/adrienverge/yamllint.git
65+
rev: v1.32.0 # or higher tag
66+
hooks:
67+
- id: yamllint

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,11 @@ uses:
113113
- ansible collections - pulls in the latest version based on requirements file
114114
- runs the audit using the devel branch
115115
- This is an automated test that occurs on pull requests into devel
116+
117+
## Added Extras
118+
119+
- [pre-commit](https://pre-commit.com) can be tested and can be run from within the directory
120+
121+
```sh
122+
pre-commit run
123+
```

tasks/post_remediation_audit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
ansible.builtin.shell: "{{ audit_conf_dir }}/run_audit.sh -v {{ audit_vars_path }} -o {{ post_audit_outfile }} -g {{ group_names }}"
55
changed_when: true
66
environment:
7-
AUDIT_BIN: "{{ audit_bin }}"
8-
AUDIT_CONTENT_LOCATION: "{{ audit_out_dir }}"
9-
AUDIT_FILE: "goss.yml"
7+
AUDIT_BIN: "{{ audit_bin }}"
8+
AUDIT_CONTENT_LOCATION: "{{ audit_out_dir }}"
9+
AUDIT_FILE: "goss.yml"
1010

1111
- name: Post Audit | ensure audit files readable by users
1212
ansible.builtin.file:

0 commit comments

Comments
 (0)