Giter Site home page Giter Site logo

veridevops / rqcode Goto Github PK

View Code? Open in Web Editor NEW
3.0 6.0 1.0 2.31 MB

Java implementation of Requirement as Code concept. STIG requiremeents testing for Windows 10 platform

License: Apache License 2.0

Java 89.55% Shell 0.64% Dockerfile 0.12% PowerShell 9.68%
java requirements security

rqcode's Introduction

Quality Gate Status

About the repository

The RQCODE repository contains security requirement idioms represented as Java code. The purpose of this is twofold:

  1. Rigorously checking whether a given system meets a given security requirement.
  2. Programmatically enforcing a given requirement on a given system.

RQCODE requirements that can be checked implement the Checkable interface. RQCODE requirements that can be enforced implement the Enforceable interface.

Temporal patterns

Classes located under the src/main/java/rqcode/patterns/temporal directory implement some of the idiomatic temporal specification patterns (https://matthewbdwyer.github.io/psp/patterns.html), as well as their timed versions. These classes only implement the Checkable interface. Temporal specification patterns are generic -- for example, the ``always globally P'' pattern does not specify what P is. Replacement of P with a meaningful property turns the pattern into a requirement. The RQCODE classes representing the temporal patterns have constructors that expect formal arguments implementing the Checkable interface. These arguments are objects that encode meaningful properties, such as P in the above example. In particular, these objects may be instantiated from other RQCODE temporal patterns, for all these patterns implement the Checkable interface.

For a detailed example, please read the corresponding documentation.

STIGs

STIG stands for "Security Technical Implementation Guide'' (https://www.stigviewer.com/stigs). Each STIG is a collection of security findings for a given software system (for example, for APACHE Server 2.0 for Unix https://www.stigviewer.com/stig/apache_server_2.0unix/). Each finding includes:

  • A human-friendly explanation of why this finding represents a security problem.
  • Technical steps required to identify the finding.
  • Technical steps required to fix the finding.

The problem with the original collection of STIGs is that the technical steps take the form of non-runnable natural language. RQCODE classes under the src/main/java/rqcode/stigs directory implement STIG findings in an executable and reusable form. Each RQCODE STIG finding class implements at least the Checkable interface, which makes it usable in combination with the temporal patterns. Some finding classes also implement the Enforceable interface, which makes them usable for fixing the identified finding right after the identification.

Example: Windows 10 STIG Rules as RQCODE style requirements

To demonstrate the approach we will illustrate it with an example of specific STIG rules for systems run by the Windows 10 operating system. These rules are provided in the Windows 10 Security Technical Implementation Guide. For many systems, STIG rules come with scripts for verifying the conformance and enforcing the rules. For Windows 10, PowerShell scripts exist that check the conformance of systems to these rules. For some rules, such checks are complemented with scripts that enforce conformance to the respective rules.

We analyzed the STIG rules for Windows 10 and found subgroups of rules that look very similar - both in their textual descriptions and in the PowerShell scripts (where applicable) that check and enforce conformance to these rules. This is bad, because a decision to modify one rule from such a subgroup would require synchronizing the change with all the similar rules, and this process is prone to errors. We decided to apply the object-oriented software construction process to remove the repetition. The below class tree depicts a subset of the resulting collection of classes: image10 The leaves of the tree correspond to actual STIG rules. The abstract classes encode the commonalities shared by their descendant classes. Each class implementing a STIG rule features up to three public methods:

  • toString(), which prints out the textual representation of the STIG rule;
  • check(), which performs conformance-checking of the target system against the rule;
  • enforce(), which enforces conformance of the target system against the rule.

For more details, please read the corresponding documentation.

rqcode's People

Contributors

agilebotanist avatar ildar1 avatar anaumchev avatar khaledismaeel avatar nufusrufus avatar andrew174194 avatar rufusnufus avatar

Stargazers

 avatar  avatar

Watchers

 avatar Bilal Said avatar Etienne Brosse avatar  avatar  avatar  avatar

Forkers

sophieebersold

rqcode's Issues

The type V_63703 must implement the inherited abstract method

public class V_63703 extends UserRightsAssignRequirement {

rqcode.stigs.win10.V_63703
The type V_63703 must implement the inherited abstract method Requirement.checkText()Java(67109264)
The type V_63703 must implement the inherited abstract method Requirement.description()Java(67109264)
The type V_63703 must implement the inherited abstract method Requirement.fixText()Java(67109264)
The type V_63703 must implement the inherited abstract method LocalPolicyRequirement.getSubcategory()Java(67109264)

V_63647 must implement the inherited abstract method

public class V_63703 extends UserRightsAssignRequirement {

The type V_63647 must implement the inherited abstract method Requirement.checkText()Java(67109264)
The type V_63647 must implement the inherited abstract method Requirement.description()Java(67109264)
The type V_63647 must implement the inherited abstract method Requirement.fixText()Java(67109264)
The type V_63647 must implement the inherited abstract method LocalPolicyRequirement.getSubcategory()Java(67109264)

Add comments to Win STIGs

public class V_63709 extends SoftwareRegEditRequirement {

Please add STIG description and the link in comments to each V_ class

Repo:
https://github.com/VeriDevOps/RQCODE/tree/master/src/main/java/rqcode/stigs/win10

Example;

/**

  • Maintaining an audit trail of system activity logs can help identify configuration errors, troubleshoot service disruptions, and analyze compromises that have occurred, as well as detect attacks. Audit logs are necessary to provide a trail of evidence in case the system or network is compromised. Collecting this data is essential for analyzing the security of information assets and detecting signs of suspicious and unexpected behavior. Logon records user logons. If this is an interactive logon, it is recorded on the local system. If it is to a network share, it is recorded on the system accessed.
  • https://www.stigviewer.com/stig/windows_10/2016-10-28/finding/V-63467
    */

V_63863 must implement the inherited abstract method

public class V_63863 extends UserRightsAssignRequirement {

rqcode.stigs.win10.V_63863
The type V_63863 must implement the inherited abstract method Requirement.checkText()Java(67109264)
The type V_63863 must implement the inherited abstract method Requirement.description()Java(67109264)
The type V_63863 must implement the inherited abstract method Requirement.fixText()Java(67109264)
The type V_63863 must implement the inherited abstract method LocalPolicyRequirement.getSubcategory()Java(67109264)

V_63931 must implement the inherited abstract method

public class V_63931 extends UserRightsAssignRequirement {

rqcode.stigs.win10.V_63931
The type V_63931 must implement the inherited abstract method Requirement.checkText()Java(67109264)
The type V_63931 must implement the inherited abstract method Requirement.description()Java(67109264)
The type V_63931 must implement the inherited abstract method Requirement.fixText()Java(67109264)
The type V_63931 must implement the inherited abstract method LocalPolicyRequirement.getSubcategory()Java(67109264)

V_63843 must implement the inherited abstract method

public class V_63843 extends UserRightsAssignRequirement {

rqcode.stigs.win10.V_63843
The type V_63843 must implement the inherited abstract method Requirement.checkText()Java(67109264)
The type V_63843 must implement the inherited abstract method Requirement.description()Java(67109264)
The type V_63843 must implement the inherited abstract method Requirement.fixText()Java(67109264)
The type V_63843 must implement the inherited abstract method LocalPolicyRequirement.getSubcategory()Java(67109264)

V_63703 must implement the inherited abstract method

public class V_63703 extends UserRightsAssignRequirement {

rqcode.stigs.win10.V_63703
The type V_63703 must implement the inherited abstract method Requirement.checkText()Java(67109264)
The type V_63703 must implement the inherited abstract method Requirement.description()Java(67109264)
The type V_63703 must implement the inherited abstract method Requirement.fixText()Java(67109264)
The type V_63703 must implement the inherited abstract method LocalPolicyRequirement.getSubcategory()Java(67109264)

V_63851 must implement the inherited abstract method

The type V_63851 must implement the inherited abstract method Requirement.checkText()Java(67109264)
The type V_63851 must implement the inherited abstract method Requirement.description()Java(67109264)
The type V_63851 must implement the inherited abstract method Requirement.fixText()Java(67109264)
The type V_63851 must implement the inherited abstract method LocalPolicyRequirement.getSubcategory()Java(67109264)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.