GithubHelp home page GithubHelp logo

metablaster / windowsfirewallruleset Goto Github PK

View Code? Open in Web Editor NEW
156.0 10.0 35.0 14.86 MB

PowerShell scripts to automatically create rules for Windows firewall

Home Page: https://metablaster.github.io/WindowsFirewallRuleset/

License: MIT License

PowerShell 99.23% JavaScript 0.04% Shell 0.01% C# 0.72%
windows firewall powershell security ruleset gpo rules firewall-rules windows-firewall gpo-firewall

windowsfirewallruleset's People

Contributors

metablaster avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windowsfirewallruleset's Issues

Alternative implementation for Get-AppSID

Is your feature request related to a problem? Please describe

Thanks for inspiration for scripting my own firewall rules with PowerShell.

Here's an alternative solution for Get-AppSID, which does not rely on the filesystem, if you'd like to integrate into your scripts.

Describe the solution you'd like

function Get-AppSID {
    [CmdletBinding()]
    Param(
        [Parameter(Mandatory = $True)]
        [string]$AppContainerName
    )

    $sha256 = [System.Security.Cryptography.HashAlgorithm]::Create("sha256")
    $hash = $sha256.ComputeHash([System.Text.Encoding]::Unicode.GetBytes($AppContainerName.ToLowerInvariant()))

    $sid = "S-1-15-2"
    for ($i = 0; $i -lt 28; $i += 4) {
        $sid += "-" + [System.BitConverter]::ToUInt32($hash, $i)
    }

    $sid
}

Additional context

Some tests:

> Get-Acl C:\Users\Me\AppData\Local\Packages\Microsoft.MicrosoftEdge.Stable_8wekyb3d8bbwe\AC\| ForEach-Object { $_.Access | Where-Object { $_.IdentityReference.Value -like "S-1-15-2-*" } | ForEach-Object { $_.IdentityReference.Value } }
S-1-15-2-543634040-274359014-2226501544-3561766748-3991453649-3543631192-522786984
> Get-AppSID "Microsoft.MicrosoftEdge.Stable_8wekyb3d8bbwe"
S-1-15-2-543634040-274359014-2226501544-3561766748-3991453649-3543631192-522786984

>  Get-Acl C:\Users\Me\AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\ | ForEach-Object { $_.Access | Where-Object { $_.IdentityReference.Value -like "S-1-15-2-*" } | ForEach-Object { $_.IdentityReference.Value } }
S-1-15-2-3624051433-2125758914-1423191267-1740899205-1073925389-3782572162-737981194
> Get-AppSID "Microsoft.MicrosoftEdge_8wekyb3d8bbwe"
S-1-15-2-3624051433-2125758914-1423191267-1740899205-1073925389-3782572162-737981194

> Get-Acl C:\Users\Me\AppData\Local\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\AC\ | ForEach-Object { $_.Access | Where-Object { $_.IdentityReference.Value -like "S-1-15-2-*" } | ForEach-Object { $_.IdentityReference.Value } }
S-1-15-2-1609473798-1231923017-684268153-4268514328-882773646-2760585773-1760938157
> Get-AppSID "Microsoft.WindowsStore_8wekyb3d8bbwe"
S-1-15-2-1609473798-1231923017-684268153-4268514328-882773646-2760585773-1760938157

> Get-Acl C:\Users\Me\AppData\Local\Packages\TheDebianProject.DebianGNULinux_76v4gfsz19hv4\AC\ | ForEach-Object { $_.Access | Where-Object { $_.IdentityReference.Value -like "S-1-15-2-*" } | ForEach-Object { $_.IdentityReference.Value } }
S-1-15-2-924832536-4127917372-3117263579-2243186587-3749335480-97027950-1331681895
> Get-AppSID "TheDebianProject.DebianGNULinux_76v4gfsz19hv4"
S-1-15-2-924832536-4127917372-3117263579-2243186587-3749335480-97027950-1331681895

League of Legends Firewall Settings [Request]

Hi metablaster,

I'm here to ask you, if you could provide the correct port configuration for league of legends, I'm trying to configure myself for is hard to find the right ones.

Monitoring Firewall Readme

Hello,
I would suggest you to add the tool "Firewall Log Viewer for Windows" to the page "Monitoring Firewall" into the Readme folder.
If you contact the developer it's likely they will send you a coupon code for the open source project.
Cheers,

The network path was not found Windows 10 20H2

Describe the bug
After applying some security settings in Windows 10 20H2, like enabling Attack Surface Reduction rules (all the rules available), Enable Block at First Sight feature, potentially unwanted applications, cloud protection,extended cloud check and also a in the exploit protection in system settings put everything to on by default, and add a few programs to program settings. It seems to appear the error described in the title.
A clear and concise description of what the bug is.

To Reproduce
Please describe the steps to reproduce the behavior, for example:

  1. Go to '...'
  2. Click on '....'
  3. Enable '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

If applicable, add screenshots to help explain your problem.

Actual behavior
Describe what is the actual result as opposed to "Expected behavior"

Environment information:
Please provide detailed information about your system as needed:

  • OS: [ex. Windows 10 Pro v1903] (run: Winver.exe)
  • PowerShell: [ex. PowerShell core 7.0.3] (run: $PSVersionTable)
  • Network Adapter: (run: Get-NetAdapter | ? HardwareInterface | select *)
  • IP Configuration: (run: ipconfig /all)

Any other system information which you consider relevant for the problem, such as:

  • firewall logs
  • ping output
  • DNS query results etc.
  • Network related software you use such as: VPN, DNS, proxy etc...

Additional context
Add any other context about the problem here.

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.