Got the rest of the tests to pass.

Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
Ryan Davis 2019-05-25 01:33:26 -07:00
parent 9ec91484fc
commit 82c9aa6ed6
252 changed files with 562 additions and 24 deletions

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
# Verifies apt and ppa repositories
#

View file

@ -1,3 +1,5 @@
require 'inspec/resources/command'
# copyright: 2015, Vulcano Security GmbH
# Advanced Auditing:

View file

@ -1,6 +1,6 @@
require 'inspec/resources/file'
require 'inspec/utils/file_reader'
require 'inspec/utils/simpleconfig'
module Inspec::Resources
class Bond < FileResource

View file

@ -1,3 +1,4 @@
require 'inspec/resources/file'
# Usage:
# describe bridge('br0') do

View file

@ -1,5 +1,8 @@
# frozen_string_literal: true
require 'inspec/resources/command'
require 'inspec/resources/powershell'
# Check for Chocolatey packages to be installed
module Inspec::Resources
class ChocoPkg < Inspec.resource(1)

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
# Usage:
# describe cpan('DBD::Pg') do

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
# Usage:
# describe cran('DBI') do

View file

@ -1,4 +1,4 @@
require 'inspec/resources/file'
require 'inspec/utils/parser'
require 'inspec/utils/filter'

View file

@ -1,3 +1,4 @@
require 'inspec/resources/json'
# Parses a csv document
# This implementation was inspired by a blog post

View file

@ -2,6 +2,7 @@
# Copyright 2017, Christoph Hartmann
#
require 'inspec/resources/command'
require 'inspec/utils/filter'
require 'hashie/mash'

View file

@ -1,6 +1,7 @@
#
# Copyright 2017, Christoph Hartmann
require 'inspec/resources/docker'
require_relative 'docker_object'
module Inspec::Resources

View file

@ -1,6 +1,7 @@
#
# Copyright 2017, Christoph Hartmann
require 'inspec/resources/docker'
require_relative 'docker_object'
module Inspec::Resources

View file

@ -1,3 +1,4 @@
require 'inspec/resources/docker'
module Inspec::Resources
class DockerPlugin < Inspec.resource(1)

View file

@ -1,6 +1,7 @@
#
# Copyright 2017, Christoph Hartmann
require 'inspec/resources/docker'
require_relative 'docker_object'
module Inspec::Resources

View file

@ -1,3 +1,5 @@
require 'inspec/resources/command'
module Inspec::Resources
class FileSystemResource < Inspec.resource(1)
name 'filesystem'

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
module Inspec::Resources
class FirewallD < Inspec.resource(1)

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
module Inspec::Resources
class GemPackage < Inspec.resource(1)

View file

@ -1,4 +1,6 @@
require 'inspec/resources/etc_group'
require 'inspec/resources/powershell'
require 'inspec/resources/parse_config'
require 'inspec/utils/filter'
module Inspec::Resources

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
# Usage:
# describe host('example.com') do

View file

@ -2,6 +2,7 @@
# copyright: 2017, Chef Software Inc
# license: Apache v2
require 'inspec/resources/command'
require 'faraday'
require 'faraday_middleware'
require 'hashie'

View file

@ -1,4 +1,7 @@
# frozen_string_literal: true
require 'inspec/resources/powershell'
# check for web applications in IIS
# Note: this is only supported in windows 2012 and later

View file

@ -1,4 +1,7 @@
# frozen_string_literal: true
require 'inspec/resources/command'
# check for site in IIS
# Usage:
# describe iis_site('Default Web Site') do

View file

@ -1,4 +1,4 @@
require 'inspec/resources/json'
require 'inspec/utils/simpleconfig'
module Inspec::Resources

View file

@ -1,5 +1,6 @@
require 'inspec/resources/command'
require 'inspec/utils/convert'
require 'inspec/utils/simpleconfig'
module Inspec::Resources
class NetworkInterface < Inspec.resource(1)

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
# Usage:
# describe iptables do

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
module Inspec::Resources
class KernelModule < Inspec.resource(1)

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
module Inspec::Resources
class KernelParameter < Inspec.resource(1)

View file

@ -1,6 +1,3 @@
require 'inspec/utils/simpleconfig'
module Inspec::Resources
class Mount < Inspec.resource(1)
name 'mount'

View file

@ -1,4 +1,4 @@
require 'inspec/resources/command'
require 'hashie/mash'
require 'inspec/utils/database_helpers'

View file

@ -1,5 +1,6 @@
# copyright: 2015, Vulcano Security GmbH
require 'inspec/resources/command'
require 'shellwords'
module Inspec::Resources

View file

@ -1,6 +1,7 @@
require 'pathname'
require 'hashie/mash'
require 'inspec/resources/command'
module Inspec::Resources
class Nginx < Inspec.resource(1)

View file

@ -1,4 +1,4 @@
require 'inspec/resources/command'
require 'shellwords'
module Inspec::Resources

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
# This resource talks with OneGet (https://github.com/OneGet/oneget)
# Its part of Windows Management Framework 5.0 and part of Windows 10

View file

@ -1,4 +1,4 @@
require 'inspec/resources/command'
require 'hashie/mash'
require 'inspec/utils/database_helpers'
require 'htmlentities'

View file

@ -1,3 +1,5 @@
require 'inspec/resources/directory'
require 'inspec/utils/simpleconfig'
# Resource to determine package information
#

View file

@ -1,6 +1,7 @@
# copyright: 2017, Chef Software, Inc. <legal@chef.io>
require 'inspec/utils/filter'
require 'inspec/resources/command'
module Inspec::Resources
class Packages < Inspec.resource(1)

View file

@ -10,6 +10,7 @@
# describe parse_config(audit, options ) do
require 'inspec/utils/file_reader'
require 'inspec/utils/simpleconfig'
module Inspec::Resources
class PConfig < Inspec.resource(1)

View file

@ -1,9 +1,10 @@
require 'inspec/resources/command'
require 'inspec/utils/simpleconfig'
# Usage:
# describe pip('Jinja2') do
# it { should be_installed }
# end
#
module Inspec::Resources
class PipPackage < Inspec.resource(1)

View file

@ -2,6 +2,7 @@
require 'inspec/utils/filter'
require 'ostruct'
require 'inspec/resources/command'
module Inspec::Resources
class Processes < Inspec.resource(1)

View file

@ -1,6 +1,7 @@
# copyright: 2015, Vulcano Security GmbH
require 'json'
require 'inspec/resources/powershell'
# Three constructor methods are available:
# 1. resistry_key(path'):

View file

@ -1,5 +1,7 @@
# frozen_string_literal: true
require 'inspec/resources/command'
module Inspec::Resources
class SecurityIdentifier < Inspec.resource(1)
name 'security_identifier'

View file

@ -11,6 +11,8 @@
# parameters. Therefore we need a combination of Registry and secedit output
require 'hashie'
require 'inspec/resources/command'
require 'inspec/utils/simpleconfig'
module Inspec::Resources
# known and supported MS privilege rights

View file

@ -1,3 +1,6 @@
require 'inspec/resources/command'
require 'inspec/resources/powershell'
module Inspec::Resources
# this resource returns additional system informatio
class System < Inspec.resource(1)

View file

@ -1,4 +1,4 @@
require 'inspec/resources/powershell'
require 'securerandom'
module Inspec::Resources

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
module Inspec::Resources
class WindowsFeature < Inspec.resource(1)

View file

@ -1,3 +1,4 @@
require 'inspec/resources/powershell'
module Inspec::Resources
class WindowsHotfix < Inspec.resource(1)

View file

@ -1,3 +1,5 @@
require 'inspec/resources/powershell'
module Inspec::Resources
class WindowsTasks < Inspec.resource(1) # TODO: rename singular
name 'windows_task'

View file

@ -1,4 +1,4 @@
require 'inspec/resources/powershell'
require 'inspec/utils/object_traversal'
module Inspec::Resources

View file

@ -1,3 +1,4 @@
require 'inspec/resources/json'
module Inspec::Resources
class XmlConfig < JsonConfig

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
# Usage:
# describe yum do

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
module Inspec::Resources
class ZfsDataset < Inspec.resource(1)

View file

@ -1,3 +1,4 @@
require 'inspec/resources/command'
module Inspec::Resources
class ZfsPool < Inspec.resource(1)

View file

@ -1,4 +1,6 @@
require 'inspec/resources/command'
module PasswdParser
# Parse /etc/passwd files.
#
@ -269,3 +271,5 @@ module XinetdParser
res
end
end
require 'inspec/utils/simpleconfig'

View file

@ -1,3 +1,6 @@
require 'resource_support/aws/aws_resource_mixin'
require 'resource_support/aws/aws_backend_factory_mixin'
module AwsPluralResourceMixin
include AwsResourceMixin
attr_reader :table

View file

@ -1,3 +1,6 @@
require 'resource_support/aws/aws_resource_mixin'
require 'resource_support/aws/aws_backend_factory_mixin'
module AwsSingularResourceMixin
include AwsResourceMixin

View file

@ -1,3 +1,10 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-costandusagereportservice.rb'
class AwsBillingReport < Inspec.resource(1)
name 'aws_billing_report'
supports platform: 'aws'

View file

@ -1,4 +1,7 @@
require 'inspec/utils/filter'
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-costandusagereportservice'
class AwsBillingReports < Inspec.resource(1)
name 'aws_billing_reports'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-cloudtrail'
class AwsCloudTrailTrail < Inspec.resource(1)
name 'aws_cloudtrail_trail'
desc 'Verifies settings for an individual AWS CloudTrail Trail'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-cloudtrail'
class AwsCloudTrailTrails < Inspec.resource(1)
name 'aws_cloudtrail_trails'
desc 'Verifies settings for AWS CloudTrail Trails in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-cloudwatch'
class AwsCloudwatchAlarm < Inspec.resource(1)
name 'aws_cloudwatch_alarm'
desc <<~EXAMPLE

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-cloudwatchlogs'
class AwsCloudwatchLogMetricFilter < Inspec.resource(1)
name 'aws_cloudwatch_log_metric_filter'
desc 'Verifies individual Cloudwatch Log Metric Filters'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-configservice'
class AwsConfigDeliveryChannel < Inspec.resource(1)
name 'aws_config_delivery_channel'
desc 'Verifies settings for AWS Config Delivery Channel'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-configservice'
class AwsConfigurationRecorder < Inspec.resource(1)
name 'aws_config_recorder'
desc 'Verifies settings for AWS Configuration Recorder'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsEbsVolume < Inspec.resource(1)
name 'aws_ebs_volume'
desc 'Verifies settings for an EBS volume'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsEbsVolumes < Inspec.resource(1)
name 'aws_ebs_volumes'
desc 'Verifies settings for AWS EBS Volumes in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsEc2Instance < Inspec.resource(1)
name 'aws_ec2_instance'
desc 'Verifies settings for an EC2 instance'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsEc2Instances < Inspec.resource(1)
name 'aws_ec2_instances'
desc 'Verifies settings for AWS EC2 Instances in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ecs'
class AwsEcsCluster < Inspec.resource(1)
name 'aws_ecs_cluster'
desc 'Verifies settings for an ECS cluster'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-eks'
class AwsEksCluster < Inspec.resource(1)
name 'aws_eks_cluster'
desc 'Verifies settings for an EKS cluster'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-elasticloadbalancing'
class AwsElb < Inspec.resource(1)
name 'aws_elb'
desc 'Verifies settings for AWS Elastic Load Balancer'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-elasticloadbalancing'
class AwsElbs < Inspec.resource(1)
name 'aws_elbs'
desc 'Verifies settings for AWS ELBs (classic Elastic Load Balancers) in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsFlowLog < Inspec.resource(1)
name 'aws_flow_log'
supports platform: 'aws'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
class AwsIamAccessKey < Inspec.resource(1)
name 'aws_iam_access_key'
desc 'Verifies settings for an individual IAM access key'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
class AwsIamAccessKeys < Inspec.resource(1)
name 'aws_iam_access_keys'
desc 'Verifies settings for AWS IAM Access Keys in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
class AwsIamGroup < Inspec.resource(1)
name 'aws_iam_group'
desc 'Verifies settings for AWS IAM Group'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
class AwsIamGroups < Inspec.resource(1)
name 'aws_iam_groups'
desc 'Verifies settings for AWS IAM groups in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
class AwsIamPasswordPolicy < Inspec.resource(1)
name 'aws_iam_password_policy'
desc 'Verifies iam password policy'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
class AwsIamPolicies < Inspec.resource(1)
name 'aws_iam_policies'
desc 'Verifies settings for AWS IAM Policies in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
require 'json'
require 'set'
require 'uri'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
class AwsIamRole < Inspec.resource(1)
name 'aws_iam_role'
desc 'Verifies settings for an IAM Role'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
class AwsIamRootUser < Inspec.resource(1)
name 'aws_iam_root_user'
desc 'Verifies settings for AWS root account'

View file

@ -1,4 +1,6 @@
require 'resource_support/aws'
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
class AwsIamUser < Inspec.resource(1)
name 'aws_iam_user'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-iam'
class AwsIamUsers < Inspec.resource(1)
name 'aws_iam_users'
desc 'Verifies settings for AWS IAM users'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-kms'
class AwsKmsKey < Inspec.resource(1)
name 'aws_kms_key'
desc 'Verifies settings for an individual AWS KMS Key'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-kms'
class AwsKmsKeys < Inspec.resource(1)
name 'aws_kms_keys'
desc 'Verifies settings for AWS KMS Keys in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-rds'
class AwsRdsInstance < Inspec.resource(1)
name 'aws_rds_instance'
desc 'Verifies settings for an rds instance'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsRouteTable < Inspec.resource(1)
name 'aws_route_table'
desc 'Verifies settings for an AWS Route Table'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsRouteTables < Inspec.resource(1)
name 'aws_route_tables'
desc 'Verifies settings for AWS Route Tables in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-s3'
class AwsS3Bucket < Inspec.resource(1)
name 'aws_s3_bucket'
desc 'Verifies settings for a s3 bucket'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-s3'
class AwsS3BucketObject < Inspec.resource(1)
name 'aws_s3_bucket_object'
desc 'Verifies settings for a s3 bucket object'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-s3'
class AwsS3Buckets < Inspec.resource(1)
name 'aws_s3_buckets'
desc 'Verifies settings for AWS S3 Buckets in bulk'

View file

@ -1,6 +1,10 @@
require 'set'
require 'ipaddr'
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsSecurityGroup < Inspec.resource(1)
name 'aws_security_group'
desc 'Verifies settings for an individual AWS Security Group.'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsSecurityGroups < Inspec.resource(1)
name 'aws_security_groups'
desc 'Verifies settings for AWS Security Groups in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-sns'
class AwsSnsSubscription < Inspec.resource(1)
name 'aws_sns_subscription'
desc 'Verifies settings for an SNS Subscription'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-sns'
class AwsSnsTopic < Inspec.resource(1)
name 'aws_sns_topic'
desc 'Verifies settings for an SNS Topic'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-sns'
class AwsSnsTopics < Inspec.resource(1)
name 'aws_sns_topics'
desc 'Verifies settings for SNS Topics in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-sqs'
require 'uri'
class AwsSqsQueue < Inspec.resource(1)

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsSubnet < Inspec.resource(1)
name 'aws_subnet'
desc 'This resource is used to test the attributes of a VPC subnet'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_plural_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsSubnets < Inspec.resource(1)
name 'aws_subnets'
desc 'Verifies settings for VPC Subnets in bulk'

View file

@ -1,3 +1,7 @@
require 'resource_support/aws/aws_singular_resource_mixin'
require 'resource_support/aws/aws_backend_base'
require 'aws-sdk-ec2'
class AwsVpc < Inspec.resource(1)
name 'aws_vpc'
desc 'Verifies settings for AWS VPC'

Some files were not shown because too many files have changed in this diff Show more