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

Added GitHub actions and added gitgnore #1

Merged
merged 6 commits into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 38 additions & 0 deletions .github/workflows/communitytodevel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is a basic workflow to help you get started with Actions

name: CommunityToDevel

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the devel branch
on:
pull_request:
branches: [ devel ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Refactr pipeline for devel pull request/merge
- name: Refactr - Run Pipeline (to devel)
# You may pin to the exact commit or the version.
# uses: refactr/action-run-pipeline@be91e2796aa225268e4685c0e01a26d5f800cd53
uses: refactr/[email protected]
with:
# API token
api_token: '${{ secrets.REFACTR_KEY }}'
# Project ID
project_id: 5f47f0c4a13c7b18373e5556
# Job ID
job_id: 5f933cbcf9c74e86b1609c00
# Variables
variables: '{ "gitrepo": "https://github.com/ansible-lockdown/RHEL8-STIG.git", "image": "ami-066df92ac6f03efca", "githubBranch": "${{ github.head_ref }}" }'
# Refactr API base URL
api_url: # optional
38 changes: 38 additions & 0 deletions .github/workflows/develtomaster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is a basic workflow to help you get started with Actions

name: DevelToMaster

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the devel branch
on:
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Refactr pipeline for devel pull request/merge
- name: Refactr - Run Pipeline (to master)
# You may pin to the exact commit or the version.
# uses: refactr/action-run-pipeline@be91e2796aa225268e4685c0e01a26d5f800cd53
uses: refactr/[email protected]
with:
# API token
api_token: '${{ secrets.REFACTR_KEY }}'
# Project ID
project_id: 5f47f0c4a13c7b18373e5556
# Job ID
job_id: 5f90ad90f9c74e6d1e606e33
# Variables
variables: '{ "gitrepo": "https://github.com/ansible-lockdown/RHEL8-STIG.git", "image": "ami-066df92ac6f03efca" }'
# Refactr API base URL
api_url: # optional
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ benchparse/
*xccdf.xml
*.retry

# GitHub Action/Workflow files
.github/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure you don't want to ignore these?

4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ rhel8stig_system_is_chroot: "{{ ansible_is_chroot | default(False) }}"
# tweak role to run in a non-privileged container
rhel8stig_system_is_container: false

# rhel8cis is left off the front of this var for consistency in testing pipeline
# system_is_ec2 toggle will disable tasks that fail on Amazon EC2 instances. Set true to skip and false to run tasks
system_is_ec2: false

# These variables correspond with the STIG IDs defined in the STIG and allows you to enable/disable specific rules.
# PLEASE NOTE: These work in coordination with the cat1, cat2, cat3 group variables. You must enable an entire group
# in order for the variables below to take effect.
Expand Down
1 change: 1 addition & 0 deletions tasks/fix-cat1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
insertafter: '### BEGIN /etc/grub.d/01_users ###'
notify: confirm grub2 user cfg
when:
- not system_is_ec2
- rhel_08_010140 or
rhel_08_010150
tags:
Expand Down
56 changes: 29 additions & 27 deletions tasks/fix-cat2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: "*"
state: latest
when:
- not system_is_ec2
- rhel_08_010010
tags:
- RHEL-08-010010
Expand Down Expand Up @@ -31,6 +32,7 @@
mode: '0644'
notify: restart sshd
when:
# - not system_is_ec2
- rhel_08_010040 or
rhel_08_010060
tags:
Expand Down Expand Up @@ -3103,6 +3105,32 @@
- RHEL-08-040080
- usb_devices

- name: "MEDIUM | RHEL-08-040100 | PATCH | A firewall must be installed on RHEL 8."
block:
- name: "MEDIUM | RHEL-08-040100 | PATCH | A firewall must be installed on RHEL 8. | Install firewalld"
dnf:
name: firewalld
state: present
when: rhel8stig_firewall_service == "firewalld"

- name: "MEDIUM | RHEL-08-040100 | PATCH | A firewall must be installed on RHEL 8. | Install IPTables"
dnf:
name: iptables-services
state: present
when: rhel8stig_firewall_service == "iptables"

- name: "MEDIUM | RHEL-08-040100 | PATCH | A firewall must be installed on RHEL 8. | Start and enable service"
service:
name: "{{ rhel8stig_firewall_service }}"
state: started
enabled: yes
when:
- rhel_08_040100
tags:
- RHEL-08-040100
- firewall
- "{{ rhel8stig_firewall_service }}"

- name: "MEDIUM | RHEL-08-040090 | PATCH | A RHEL 8 firewall must employ a deny-all, allow-by-exception policy for allowing connections to other systems."
block:
- name: "MEDIUM | RHEL-08-040090 | PATCH | A RHEL 8 firewall must employ a deny-all, allow-by-exception policy for allowing connections to other systems. | Set new zone"
Expand Down Expand Up @@ -3135,33 +3163,7 @@
- rhel_08_040090
tags:
- RHEL-08-040090
- firewall

- name: "MEDIUM | RHEL-08-040100 | PATCH | A firewall must be installed on RHEL 8."
block:
- name: "MEDIUM | RHEL-08-040100 | PATCH | A firewall must be installed on RHEL 8. | Install firewalld"
dnf:
name: firewalld
state: present
when: rhel8stig_firewall_service == "firewalld"

- name: "MEDIUM | RHEL-08-040100 | PATCH | A firewall must be installed on RHEL 8. | Install IPTables"
dnf:
name: iptables-services
state: present
when: rhel8stig_firewall_service == "iptables"

- name: "MEDIUM | RHEL-08-040100 | PATCH | A firewall must be installed on RHEL 8. | Start and enable service"
service:
name: "{{ rhel8stig_firewall_service }}"
state: started
enabled: yes
when:
- rhel_08_040100
tags:
- RHEL-08-040100
- firewall
- "{{ rhel8stig_firewall_service }}"
- firewall

- name: "MEDIUM | RHEL-08-040110 | PATCH | RHEL 8 wireless network adapters must be disabled."
block:
Expand Down
2 changes: 0 additions & 2 deletions tasks/prelim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,5 +334,3 @@
- name: "PRELIM | Setting the fact"
set_fact:
rhel8stig_interactive_uid_min: "{{ rhel8stig_interactive.stdout | int }}"

- debug: var=rhel8stig_interactive_uid_min