Giter VIP home page Giter VIP logo

mitre / canonical-ubuntu-16.04-lts-stig-baseline Goto Github PK

View Code? Open in Web Editor NEW
11.0 23.0 3.0 697 KB

InSpec profile to validate the secure configuration of Canonical Ubuntu 16.04 LTS against DISA's Canonical Ubuntu 16.04 LTS Security Technical Implementation Guide (STIG) Version 1 Release 1.

License: Other

Ruby 100.00%
inspec baseline mitre-corporation mitre-inspec difz ubuntu1604 ubuntu stig disa mitre-saf

canonical-ubuntu-16.04-lts-stig-baseline's Introduction

Build Status

Travis CI Build History

canonical_ubuntu_16.04_lts_stig_baseline

InSpec profile to validate the secure configuration of Canonical Ubuntu 16.04 LTS against DISA's Canonical Ubuntu 16.04 LTS Security Technical Implementation Guide (STIG) Version 1 Release 1.

Getting Started

It is intended and recommended that InSpec run this profile from a "runner" host (such as a DevOps orchestration server, an administrative management system, or a developer's workstation/laptop) against the target remotely over winrm.

For the best security of the runner, always install on the runner the latest version of InSpec and supporting Ruby language components.

Latest versions and installation options are available at the InSpec site.

Tailoring to Your Environment

The following inputs must be configured in an inputs ".yml" file for the profile to run correctly for your specific environment. More information about InSpec inputs can be found in the InSpec Profile Documentation.

  - name: emergency_accounts
    description: Emergency user accounts
    type: Array
    value: []

  - name: temporary_accounts
    description: Temporary user accounts
    type: Array
    value: []

  - name: application_groups
    description: Known Application Groups
    type: Array
    value: []

  - name: known_system_accounts
    description: System accounts that support approved system activities
    type: Array
    value: []

  - name: disallowed_accounts
    description: Accounts that are not allowed on the system
    type: Array
    value: []

  - name: user_accounts
    description: Accounts of known managed users
    type: Array
    value: []

  - name: exempt_home_users
    description: These are `home dir` exempt interactive accounts
    type: Array
    value: []

  - name: security_accounts
    description: Security Personnel accounts
    type: Array
    value: []

Running This Baseline Directly from Github

# How to run
inspec exec https://github.com/mitre/canonical-ubuntu-16.04-lts-stig-baseline/archive/master.tar.gz -t winrm://<hostname>:<port> --sudo --input-file=<path_to_your_inputs_file/name_of_your_inputs_file.yml> --reporter=cli json:<path_to_your_output_file/name_of_your_output_file.json>

Different Run Options

Full exec options

Running This Baseline from a local Archive copy

If your runner is not always expected to have direct access to GitHub, use the following steps to create an archive bundle of this baseline and all of its dependent tests:

(Git is required to clone the InSpec profile using the instructions below. Git can be downloaded from the Git site.)

When the "runner" host uses this profile baseline for the first time, follow these steps:

mkdir profiles
cd profiles
git clone https://github.com/mitre/canonical-ubuntu-16.04-lts-stig-baseline
inspec archive canonical-ubuntu-16.04-lts-stig-baseline
inspec exec <name of generated archive> -t winrm://<hostname>:<port> --sudo --input-file=<path_to_your_inputs_file/name_of_your_inputs_file.yml> --reporter=cli json:<path_to_your_output_file/name_of_your_output_file.json>

For every successive run, follow these steps to always have the latest version of this baseline:

cd canonical-ubuntu-16.04-lts-stig-baseline
git pull
cd ..
inspec archive canonical-ubuntu-16.04-lts-stig-baseline --overwrite
inspec exec <name of generated archive> -t winrm://<hostname>:<port> --sudo --input-file=<path_to_your_inputs_file/name_of_your_inputs_file.yml> --reporter=cli json:<path_to_your_output_file/name_of_your_output_file.json>

Viewing the JSON Results

The JSON results output file can be loaded into heimdall-lite for a user-interactive, graphical view of the InSpec results.

The JSON InSpec results file may also be loaded into a full heimdall server, allowing for additional functionality such as to store and compare multiple profile runs.

Authors

  • Krishna Kola
  • Amol Shah

Special Thanks

Contributing and Getting Help

To report a bug or feature request, please open an issue.

NOTICE

© 2018-2020 The MITRE Corporation.

Approved for Public Release; Distribution Unlimited. Case Number 18-3678.

NOTICE

MITRE hereby grants express written permission to use, reproduce, distribute, modify, and otherwise leverage this software to the extent permitted by the licensed terms provided in the LICENSE.md file included with this project.

NOTICE

This software was produced for the U. S. Government under Contract Number HHSM-500-2012-00008I, and is subject to Federal Acquisition Regulation Clause 52.227-14, Rights in Data-General.

No other use other than that granted to the U. S. Government, or to those acting on behalf of the U. S. Government under that Clause is authorized without the express written permission of The MITRE Corporation.

For further information, please contact The MITRE Corporation, Contracts Management Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000.

NOTICE

DISA STIGs are published by DISA IASE, see: https://iase.disa.mil/Pages/privacy_policy.aspx.

canonical-ubuntu-16.04-lts-stig-baseline's People

Contributors

aaronlippold avatar ejaronne avatar hackershark avatar karikarshivani avatar sardhapu avatar wdower avatar xtreme-nitin-ravindran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canonical-ubuntu-16.04-lts-stig-baseline's Issues

V-75511 - Looping Directory

When looping a directory it's best to consolidate the find command as much as possible so as not to have a long running control. Preferable to add the -maxdepth 0 with the max directory depth you require as well as -xdev options.

auditd architecture

Controls are written expecting a 64bit architecture. Consider having an 'input' or else statements in the controls to test if they use a 32bit architecture instead.

Controls affected:

    • V-75605
    • V-75607
    • V-75609
    • V-75689
    • V-75717
    • V-75719
    • V-75721
    • V-75723
    • V-75725
    • V-75727
    • V-75729
    • V-75731
    • V-75733
    • V-75735
    • V-75737
    • V-75739
    • V-75741
    • V-75743
    • V-75745
    • V-75747
    • V-75749
    • V-75751
    • V-75753
    • V-75791
    • V-75793
    • V-75795

repo rename

Our convention is vendor-product-version-edition[-stig|cis]-baseline

So the name should be:
canonical-ubuntu-16.04-lts-stig-baseline

V-75393 has check text from V-75391

The check and text on V-75393 is incorrect:

desc 'check', "Verify the Ubuntu operating system security patches and updates
are installed and up to date. Updates are required to be applied with a
frequency determined by the site or Program Management Office (PMO).
Obtain the list of available package security updates from Ubuntu. The URL for
updates is https://www.Ubuntu.com/usn/. It is important to note that updates
provided by Ubuntu may not be present on the system if the underlying packages
are not installed.
Check that the available package security updates have been installed on the
system with the following command:
# /usr/lib/update-notifier/apt-check --human-readable
246 packages can be updated.
0 updates are security updates.
If security package updates have not been performed on the system within the
timeframe that the site/program documentation requires, this is a finding.
Typical update frequency may be overridden by Information Assurance
Vulnerability Alert (IAVA) notifications from JFHQ-DoDIN.
If the Ubuntu operating system is in non-compliance with the Information
Assurance Vulnerability Management (IAVM) process, this is a finding."

V-75393 is the check for banner text.

Issues with V-75469 and V-75491

In V-75469 there is the following block of code:

    describe 'Emergency accounts' do
      it { should be_empty }
    end

and similarly in V-75491:

    describe 'Temporary accounts' do
      it { should be_empty }
    end

These blocks cause unreadable failure messages, such as:
expected "Emergency accounts".empty? to be truthy, got false

Depending on the intent of the code, a fix may be to check if the input arrays are empty.

Remove comments from the following controls

Control list with comments that need to be removed:

  • V-75445
  • V-75517
  • V-75523
  • V-75527
  • V-75535
  • V-75555
  • V-75571
  • V-75573
  • V-75587
  • V-75661
  • V-75663
  • V-75665
  • V-75667
  • V-75687
  • V-75691
  • V-75693
  • V-75695
  • V-75697
  • V-75699
  • V-75707
  • V-75709
  • V-75711
  • V-75713
  • V-75715
  • V-75755
  • V-75757
  • V-75759
  • V-75761
  • V-75765
  • V-75767
  • V-75769
  • V-75771
  • V-75773
  • V-75775
  • V-75777
  • V-75779
  • V-75781
  • V-75783
  • V-75785
  • V-75787
  • V-75789
  • V-75825
  • V-78007
  • V-80969

V-75437 - Change impact

For control V-75437 the logic goes like this:

gnome_installed = (package('ubuntu-gnome-desktop').installed? || package('ubuntu-desktop').installed?)

  if gnome_installed
    lock_enabled = command('gsettings get org.gnome.desktop.screensaver lock-enabled')
    describe lock_enabled do
      its('stdout') { should cmp 'true' }
    end
  else
    describe "Not Applicable as GNOME dekstop environment is installed" do
      subject { gnome_installed }
      it { should be false }
    end
  end
end

If you run into a Not Applicable scenario as you do in your else block, we want the impact to be 0 as this check is not applicable to the environment. So make sure to add a line impact 0 within that else block to update the impact score.

Sample Data

Create sample data folder and put output results of the profile for an unhardened and hardened box.

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.