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

Extend oscap-bootc to install SCE dependencies #2171

Merged
merged 1 commit into from
Nov 4, 2024
Merged
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
14 changes: 14 additions & 0 deletions utils/oscap-bootc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ def ensure_sce_installed():
"installed.")


def install_sce_dependencies():
required_packages = [
"setools-console" # seinfo is used by the sebool template
]
install_cmd = ["dnf", "-y", "install"] + required_packages
install_process = subprocess.run(
install_cmd, universal_newlines=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if install_process.returncode != 0:
raise RuntimeError(
f"{install_process.stdout}\nFailed to install SCE dependencies.")


def add_args(option_args_list, cmd):
for o, a in option_args_list:
if a:
Expand Down Expand Up @@ -112,6 +125,7 @@ def scan_and_remediate(args):
def main():
args = parse_args()
ensure_sce_installed()
install_sce_dependencies()
pre_scan_fix(args)
scan_and_remediate(args)

Expand Down
Loading