Skip to content

Commit

Permalink
Merge pull request #38 from dhoppe/readme
Browse files Browse the repository at this point in the history
Add missing badges
  • Loading branch information
bastelfreak committed Nov 2, 2016
2 parents 6f0b4ee + 4674afb commit fbbd017
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 96 deletions.
154 changes: 94 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,131 +1,165 @@
# windows_firewall
# Windows Firewall module for Puppet

####Table of Contents
[![Build Status](https://travis-ci.org/voxpupuli/puppet-windows_firewall.png?branch=master)](https://travis-ci.org/voxpupuli/puppet-windows_firewall)
[![Code Coverage](https://coveralls.io/repos/github/voxpupuli/puppet-windows_firewall/badge.svg?branch=master)](https://coveralls.io/github/voxpupuli/puppet-windows_firewall)
[![Puppet Forge](https://img.shields.io/puppetforge/v/puppet/windows_firewall.svg)](https://forge.puppetlabs.com/puppet/windows_firewall)
[![Puppet Forge - downloads](https://img.shields.io/puppetforge/dt/puppet/windows_firewall.svg)](https://forge.puppetlabs.com/puppet/windows_firewall)
[![Puppet Forge - endorsement](https://img.shields.io/puppetforge/e/puppet/windows_firewall.svg)](https://forge.puppetlabs.com/puppet/windows_firewall)
[![Puppet Forge - scores](https://img.shields.io/puppetforge/f/puppet/windows_firewall.svg)](https://forge.puppetlabs.com/puppet/windows_firewall)

#### Table of Contents

1. [Overview - What is the windows_firewall module?](#overview)
2. [Module Description - What does the module do?](#module-description)
3. [Setup - The basics of getting started with windows_firewall](#setup)
1. [Module Description - What does the module do?](#module-description)
1. [Setup - The basics of getting started with windows_firewall](#setup)
* [Beginning with windows_firewall - Installation](#beginning-with-windows_firewall)
* [Configuring an exception - Basic options for for getting started](#configure-an-exception)
4. [Usage - The classes, defined types, and their parameters available for configuration](#usage)
1. [Usage - The classes, defined types, and their parameters available for configuration](#usage)
* [Classes and Defined Types](#classes-and-defined-types)
* [Class: windows_firewall](#class-windows_firewall)
* [Defined Type: windows_firewall::exception](#defined-type-exception)
5. [Implementation - An under-the-hood peek at what the module is doing](#implementation)
1. [Implementation - An under-the-hood peek at what the module is doing](#implementation)
* [Classes and Defined Types](#classes-and-defined-types)
* [Templates](#templates)
6. [Limitations - OS compatibility, etc.](#limitations)
7. [Development - Guide for contributing to the module](#development)
8. [Release Notes - Notes on the most recent updates to the module](#release-notes)
1. [Limitations - OS compatibility, etc.](#limitations)
1. [Development - Guide for contributing to the module](#development)
1. [Release Notes - Notes on the most recent updates to the module](#release-notes)

##Overview
This is a module that will manage the Microsoft Windows Firewall and it's exceptions.
## Overview

[![Build Status](https://travis-ci.org/voxpupuli/puppet-windows_firewall.svg?branch=master)](https://travis-ci.org/voxpupuli/puppet-windows_firewall)
This is a module that will manage the Microsoft Windows Firewall and it's exceptions.

##Module Description
## Module Description

The windows_firewall module will primarily manage the state of the windows firewall application on your windows system. Optionally it will also
allow you to configure any exceptions that you need to have in place.
The windows_firewall module will primarily manage the state of the windows firewall
application on your windows system. Optionally it will also allow you to configure
any exceptions that you need to have in place.

##Setup
## Setup

###What windows_firewall affects:
### What windows_firewall affects

* windows firewall service and corrisponding Windows Registry keys
* windows registry keys and values for any defined exception rules

###Beginning with windows_firewall
### Beginning with windows_firewall

The windows_firewall resource allows you to manage the firewall service itself.

class { 'windows_firewall': ensure => 'stopped' }
```
class { 'windows_firewall': ensure => 'stopped' }
```

Once the windows firewall is managed you may then want to start managing the rules and exceptions within it.
Once the windows firewall is managed you may then want to start managing the rules
and exceptions within it.

windows_firewall::exception { 'WINRM':
ensure => present,
direction => 'in',
action => 'Allow',
enabled => 'yes',
protocol => 'TCP',
local_port => '5985',
remote_port => 'any',
display_name => 'Windows Remote Management HTTP-In',
description => 'Inbound rule for Windows Remote Management via WS-Management. [TCP 5985]',
}
```
windows_firewall::exception { 'WINRM':
ensure => present,
direction => 'in',
action => 'Allow',
enabled => 'yes',
protocol => 'TCP',
local_port => '5985',
remote_port => 'any',
display_name => 'Windows Remote Management HTTP-In',
description => 'Inbound rule for Windows Remote Management via WS-Management. [TCP 5985]',
}
```

##Usage
## Usage

###Classes and Defined Types:
### Classes and Defined Types

####Class: `windows_firewall`
#### Class: `windows_firewall`

**Parameters within `windows_firewall`:**

#####`ensure`
Determines whether or not the service must be running and enabled. If not included, the module will assume that the windows firewall service should be running and enabled. Valid values are 'running' and 'stopped'.
##### `ensure`

###Defined Type: `windows_firewall::exception`
Determines whether or not the service must be running and enabled. If not
included, the module will assume that the windows firewall service should be
running and enabled. Valid values are 'running' and 'stopped'.

#### Defined Type: `windows_firewall::exception`

**Parameters within `windows_firewall::exception`:**

#####`ensure`
##### `ensure`

Determines whether or not the firewall exception is 'present' or 'absent'

#####`direction`
##### `direction`

Sets the direction of the exception rule, either: 'in' or 'out'.

#####`action`
##### `action`

Sets the action type of the excepton, either: 'allow' or 'block'.

#####`enabled`
##### `enabled`

Determines whether the exception is enabled, either: 'yes' or 'no'. Defaults to 'yes'.

#####`protocol`
##### `protocol`

Sets the protocol to be included in the exception rule, either: 'TCP' or 'UDP'.

#####`local_port`
##### `local_port`

Defines the local port to be included in the exception for port-based exception rules.

#####`remote_port`
Defines the remote port to be included in the exception for port-based exception rules.
##### `remote_port`

Defines the remote port to be included in the exception for port-based exception
rules.

##### `remote_ip`

#####`remote_ip`
Specifies remote hosts that can use this rule.

#####`program`
Defines the full path to the program to be included in the exception for program-based exception rules
##### `program`

Defines the full path to the program to be included in the exception for
program-based exception rules

##### `display_name`

#####`display_name`
Sets the Display Name of the exception rule. Defaults to the title of the resource.

#####`description`
##### `description`

A description of the exception to apply.

#####`allow_edge_traversal`
##### `allow_edge_traversal`

Specifies that the traffic for this exception traverses an edge device

##Reference
## Reference

### Classes

#### Public Classes

* [`windows_firewall`](#class-windows_firewall): The main class of the module for
managing the state of the windows firewall.

### Defined Types

###Classes
####Public Classes
* [`windows_firewall`](#class-windows_firewall): The main class of the module for managing the state of the windows firewall.
#### Public Types

###Defined Types
####Public Types:
* [`windows_firewall::exception`] Manages the configuration of firewall exceptions

##Limitations
## Limitations

This module is tested on the following platforms:

* Windows 2008 R2

It is tested with the OSS version of Puppet only.

##Development
## Development

###Contributing
### Contributing

Please read CONTRIBUTING.md for full details on contributing to this project.
34 changes: 17 additions & 17 deletions spec/classes/windows_firewall/windows_firewall_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@
end

it do
should contain_service('windows_firewall').with(
is_expected.to contain_service('windows_firewall').with(
'name' => 'SharedAccess',
'ensure' => 'running',
'enable' => 'true'
)
end

it do
should contain_registry_value('EnableFirewallDomainProfile').with(
is_expected.to contain_registry_value('EnableFirewallDomainProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\EnableFirewall',
'data' => '1'
)
end
it do
should contain_registry_value('EnableFirewallPublicProfile').with(
is_expected.to contain_registry_value('EnableFirewallPublicProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\EnableFirewall',
'data' => '1'
)
end
it do
should contain_registry_value('EnableFirewallStandardProfile').with(
is_expected.to contain_registry_value('EnableFirewallStandardProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\EnableFirewall',
'data' => '1'
Expand All @@ -51,29 +51,29 @@
{ ensure: 'running' }
end
it do
should contain_service('windows_firewall').with(
is_expected.to contain_service('windows_firewall').with(
'name' => 'MpsSvc',
'ensure' => 'running',
'enable' => 'true'
)
end

it do
should contain_registry_value('EnableFirewallDomainProfile').with(
is_expected.to contain_registry_value('EnableFirewallDomainProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\EnableFirewall',
'data' => '1'
)
end
it do
should contain_registry_value('EnableFirewallPublicProfile').with(
is_expected.to contain_registry_value('EnableFirewallPublicProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\EnableFirewall',
'data' => '1'
)
end
it do
should contain_registry_value('EnableFirewallStandardProfile').with(
is_expected.to contain_registry_value('EnableFirewallStandardProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\EnableFirewall',
'data' => '1'
Expand All @@ -92,29 +92,29 @@
end

it do
should contain_service('windows_firewall').with(
is_expected.to contain_service('windows_firewall').with(
'name' => 'SharedAccess',
'ensure' => 'stopped',
'enable' => 'false'
)
end

it do
should contain_registry_value('EnableFirewallDomainProfile').with(
is_expected.to contain_registry_value('EnableFirewallDomainProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\EnableFirewall',
'data' => '0'
)
end
it do
should contain_registry_value('EnableFirewallPublicProfile').with(
is_expected.to contain_registry_value('EnableFirewallPublicProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\EnableFirewall',
'data' => '0'
)
end
it do
should contain_registry_value('EnableFirewallStandardProfile').with(
is_expected.to contain_registry_value('EnableFirewallStandardProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\EnableFirewall',
'data' => '0'
Expand All @@ -132,29 +132,29 @@
{ ensure: 'stopped' }
end
it do
should contain_service('windows_firewall').with(
is_expected.to contain_service('windows_firewall').with(
'name' => 'MpsSvc',
'ensure' => 'stopped',
'enable' => 'false'
)
end

it do
should contain_registry_value('EnableFirewallDomainProfile').with(
is_expected.to contain_registry_value('EnableFirewallDomainProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\EnableFirewall',
'data' => '0'
)
end
it do
should contain_registry_value('EnableFirewallPublicProfile').with(
is_expected.to contain_registry_value('EnableFirewallPublicProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\EnableFirewall',
'data' => '0'
)
end
it do
should contain_registry_value('EnableFirewallStandardProfile').with(
is_expected.to contain_registry_value('EnableFirewallStandardProfile').with(
'ensure' => 'present',
'path' => '32:HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\EnableFirewall',
'data' => '0'
Expand All @@ -169,7 +169,7 @@
end
it do
expect do
should contain_registry_value('EnableFirewall')
is_expected.to contain_registry_value('EnableFirewall')
end.to raise_error(Puppet::Error)
end
end
Expand Down
Loading

0 comments on commit fbbd017

Please sign in to comment.