![](https://cdn.prod.website-files.com/642bc0503c18643741329fb0/64312823b89d6659ef541805_SecOps%20Solution%20Logo%20Dark.png)
Agentless security for your infrastructure and applications - to build faster, more securely and in a fraction of the operational cost of other solutions
![](https://cdn.prod.website-files.com/642bc0503c18643741329fb0/642bc0503c1864898332a0ae_Vector-1.png)
hello@secopsolution.com
![](https://cdn.prod.website-files.com/642bc0503c18643741329fb0/642bc0503c18646de632a0ad_Vector.png)
+569-231-213
With growing concerns over data privacy and potential unauthorized data sharing, organizations need to ensure that AI tools like DeepSeek AI do not pose a security risk. SecOps Solution provides a seamless way to block DeepSeek AI across all enterprise systems using its Script Execution Policy.
By implementing this policy, organizations can manage restrictions and ensure that all devices remain compliant with security standards.
Before applying the policy, we must check whether the target devices are already compliant. The compliance verification script will:
# Rule name to check
$ruleName = "Block-Deepseek"
try {
# Check if rule exists
$existingRule = Get-NetFirewallRule -DisplayName $ruleName -ErrorAction SilentlyContinue
if ($existingRule) {
Write-Host "Deepseek is already blocked"
exit 1
} else {
Write-Host "Deepseek is accessible"
exit 0
}
} catch {
Write-Error "An error occurred while checking firewall rules: $_"
exit 1
}
If a device is found to be non-compliant, the following script will be executed to enforce the policy by blocking DeepSeek AI domains.
# Check for administrator privileges
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
$isAdmin = $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
Write-Error "This script requires administrator privileges. Please run as administrator."
exit 1
}
# Rule parameters
$ruleName = "Block-Deepseek"
$mainDomain = "deepseek.com"
$commonSubdomains = @(
$mainDomain,
"chat.$mainDomain",
"www.$mainDomain",
"api.$mainDomain"
)
try {
# Check if rule already exists
$existingRule = Get-NetFirewallRule -DisplayName $ruleName -ErrorAction SilentlyContinue
if ($existingRule) {
Write-Host "Firewall rule already exists. Removing old rule..."
Remove-NetFirewallRule -DisplayName $ruleName
}
# Array to store all resolved IP addresses
$allIPs = @()
# Resolve each domain to IP addresses
foreach ($domain in $commonSubdomains) {
try {
$ips = Resolve-DnsName -Name $domain -ErrorAction Stop |
Where-Object {$_.Type -eq "A"} |
Select-Object -ExpandProperty IPAddress
if ($ips) {
$allIPs += $ips
}
} catch {
Write-Warning "Could not resolve IP addresses for $domain"
}
}
if ($allIPs.Count -eq 0) {
Write-Error "Could not resolve any IP addresses to block"
exit 1
}
# Remove any duplicate IPs
$allIPs = $allIPs | Select-Object -Unique
# Create outbound blocking rule
New-NetFirewallRule -DisplayName $ruleName `
-Direction Outbound `
-Action Block `
-RemoteAddress $allIPs `
-Protocol TCP `
-LocalPort Any `
-RemotePort 80,443 `
-Profile Any `
-Description "Blocks access to deepseek.com domains and common subdomains" | Out-Null
Write-Host "`nSuccessfully created firewall rule to block deepseek.com domains"
} catch {
Write-Error "An error occurred: $_"
exit 1
}
By leveraging SecOps Solution, organizations can ensure enterprise-wide enforcement of this policy without manual intervention.
For those who prefer a manual approach, the policy can still be enforced using the following steps:
Important Note:
SecOps Solution is a Full-stack Patch and Vulnerability Management Platform that helps organizations identify, prioritize, and remediate security vulnerabilities and misconfigurations in seconds.
To learn more, get in touch.