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

Add a security policy validation mechanism #128

Merged
merged 179 commits into from
Nov 7, 2022
Merged

Conversation

imobachgs
Copy link
Contributor

@imobachgs imobachgs commented Aug 5, 2022

This PR adds security policy validation to the installer (see https://www.open-scap.org/security-policies/choosing-policy/).

Related PRs:

How it works

See the screenshots below to get an idea of how it works. Once the user enables a security profile (at this point only DISA STIG), YaST:

  • Add the required package (ssg-apply) and enable the service at the end of the installation.
  • Runs a set of checks and displays the rules that are not passing.
    • If the problem can be fixed automatically, it displays a link to do it.
    • Otherwise, it might display a link to take the user to the right place of the installer to solve it.
Installation settings including a 'Security Policy' section

stig-installation-settings

Storage proposal showing found problems with the current configuration

stig-installation-summary

YaST warning about an issue in the expert partitioner

stig-partitioner

AutoYaST confirmation mode when some rule failed

stig-autoyast-confirm-mode

Do not allow installing the system until all problems are solved

stig-enabled-blocked

Enabling security policy validation

There are three different ways to enable policy checks:

What is missing?

Write the name of the enabled policies and disabled rules to the file system, so ssg-apply can take that information into account.

Implementation details

  • The API is defined in the Y2Security::SecurityPolicies module.
    • Policy represents the security policies. There is one instance for each policy.
    • Rule represents the rules to check. It implements the check and, if possible, the fix to apply.
    • Manager represents a singleton class to manage the policies. Its API allows getting the known policies, enabling or disabling a policy and getting the issues from the enabled policies.

@imobachgs imobachgs changed the title [WIP] Add a security policy [WIP] Add a security policy validation mechanism Aug 5, 2022
@kobliha

This comment was marked as outdated.

@mvidner
Copy link
Member

mvidner commented Aug 8, 2022

Not so stupid question: who is STIG and what are they doing in YaST?!

@mvidner
Copy link
Member

mvidner commented Aug 8, 2022

I guess it is a Security Technical Implementation Guide but the Wikipedia article is quite vague. I assume we have openSUSE/SLE specific pointers, please add them.

@dgdavid

This comment was marked as outdated.

@imobachgs imobachgs changed the base branch from master to SLE-15-SP4 August 9, 2022 07:25
def missing_encryption?(blk_filesystem)
return false if blk_filesystem.encrypted? || blk_filesystem.mount_point.nil?

!PLAIN_MOUNT_POINTS.include?(blk_filesystem.mount_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we are sure there are enough validations in place (in AutoYaST and in the UI) to ensure we never get something like "/boot/efi/" here (trailing bar).

Copy link
Contributor

Choose a reason for hiding this comment

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

I hope so ...

Copy link
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

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

I did a quick check since I hope most code to be already double-checked due to the amount of people already involved in the pull request. That being said, it looks good.

@joseivanlopez joseivanlopez merged commit 9cad641 into SLE-15-SP4 Nov 7, 2022
@joseivanlopez joseivanlopez deleted the security-policy branch November 7, 2022 17:05
@yast-bot
Copy link
Contributor

yast-bot commented Nov 7, 2022

✔️ Internal Jenkins job #5 successfully finished
✔️ Created IBS submit request #283897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants