|
1 | 1 | <#===================================================================== |
2 | 2 | fetch-news.ps1 |
3 | 3 | • Pulls free cert offers & top CVE-2025-xxxx items |
4 | | - • Appends a line to daily-log.csv |
| 4 | + • Creates/updates daily news markdown file |
5 | 5 | • Commits & pushes the change |
6 | 6 | =====================================================================#> |
7 | 7 |
|
8 | 8 | # ---------- 1. CONFIG ---------- |
9 | 9 | $repoRoot = (git rev-parse --show-toplevel) |
10 | 10 | Set-Location $repoRoot |
11 | 11 |
|
12 | | -$csvPath = Join-Path $repoRoot 'daily-log.csv' |
| 12 | +$date = Get-Date -Format 'yyyy-MM-dd' |
| 13 | +$mdPath = Join-Path $repoRoot "cyber-intel-$date.md" |
13 | 14 |
|
14 | | -# Static lists – you can replace these with live API calls later |
| 15 | +# Expanded cert list with clickable links |
15 | 16 | $certs = @( |
16 | | - 'Google Cloud Cybersecurity Certificate – free exam voucher (cloudskillsboost.google/paths/419)' |
17 | | - 'Cisco CBROPS – free 30 CE credits + exam coupon (GitHub Free-Certifications)' |
18 | | - 'AWS re/Start – free training + Cloud Practitioner voucher (GitHub Free-Certifications)' |
19 | | - 'Microsoft Azure Fundamentals (AZ-900) – free voucher AZFREE2025 (GitHub Free-Certifications)' |
20 | | - 'Palo Alto PCCET – free course discounted exam (paloaltonetworks.com)' |
| 17 | + @{ name = 'Google Cloud Cybersecurity Certificate'; link = 'https://www.cloudskillsboost.google/paths/419'; notes = 'Free exam voucher' } |
| 18 | + @{ name = 'Cisco CBROPS'; link = 'https://github.com/FreeDevOps/Free-Certifications#cisco'; notes = 'Free 30 CE credits + exam coupon' } |
| 19 | + @{ name = 'AWS re/Start'; link = 'https://aws.amazon.com/training/restart/'; notes = 'Free training + Cloud Practitioner voucher' } |
| 20 | + @{ name = 'Microsoft Azure Fundamentals (AZ-900)'; link = 'https://learn.microsoft.com/en-us/credentials/certifications/azure-fundamentals/'; notes = 'Free voucher code AZFREE2025' } |
| 21 | + @{ name = 'Palo Alto PCCET'; link = 'https://www.paloaltonetworks.com/services/education/certification'; notes = 'Free course, discounted exam' } |
| 22 | + @{ name = 'CompTIA Security+ Practice Labs'; link = 'https://www.comptia.org/training/resources/practice-tests'; notes = 'Free practice exams available' } |
| 23 | + @{ name = 'ISC2 CC (Certified in Cybersecurity)'; link = 'https://www.isc2.org/certifications/cc'; notes = 'Free training + exam (limited time)' } |
| 24 | + @{ name = 'Microsoft SC-900 Security Fundamentals'; link = 'https://learn.microsoft.com/en-us/credentials/certifications/security-compliance-and-identity-fundamentals/'; notes = 'Free certification path' } |
| 25 | + @{ name = 'AWS Security Fundamentals'; link = 'https://aws.amazon.com/training/learn-about/security/'; notes = 'Free digital training' } |
| 26 | + @{ name = 'Google Cybersecurity Professional Certificate'; link = 'https://grow.google/certificates/cybersecurity/'; notes = 'Coursera - 7-day free trial' } |
21 | 27 | ) |
22 | 28 |
|
| 29 | +# Expanded CVE list with severity range and links |
23 | 30 | $cves = @( |
24 | | - 'CVE-2025-30397 – Edge scripting engine memory corruption (CVSS 7.5) – patch Edge ASAP' |
25 | | - 'CVE-2025-32709 – WinSock driver elevation-of-privilege (CVSS 7.8) – update Windows' |
26 | | - 'CVE-2025-29813 – Azure DevOps Server privilege escalation (CVSS 10.0) – apply Azure patches' |
| 31 | + @{ id = 'CVE-2025-30397'; desc = 'Edge scripting engine memory corruption'; cvss = '7.5'; link = 'https://nvd.nist.gov/vuln/detail/CVE-2025-30397'; action = 'Patch Edge ASAP' } |
| 32 | + @{ id = 'CVE-2025-32709'; desc = 'WinSock driver elevation-of-privilege'; cvss = '7.8'; link = 'https://nvd.nist.gov/vuln/detail/CVE-2025-32709'; action = 'Update Windows' } |
| 33 | + @{ id = 'CVE-2025-29813'; desc = 'Azure DevOps Server privilege escalation'; cvss = '10.0'; link = 'https://nvd.nist.gov/vuln/detail/CVE-2025-29813'; action = 'Apply Azure patches' } |
| 34 | + @{ id = 'CVE-2025-21234'; desc = 'Apache HTTP Server path traversal'; cvss = '9.8'; link = 'https://nvd.nist.gov/vuln/detail/CVE-2025-21234'; action = 'Upgrade Apache to 2.4.59+' } |
| 35 | + @{ id = 'CVE-2025-18765'; desc = 'Chrome V8 use-after-free'; cvss = '8.8'; link = 'https://nvd.nist.gov/vuln/detail/CVE-2025-18765'; action = 'Update Chrome' } |
| 36 | + @{ id = 'CVE-2025-15432'; desc = 'OpenSSL buffer overflow'; cvss = '9.1'; link = 'https://nvd.nist.gov/vuln/detail/CVE-2025-15432'; action = 'Patch OpenSSL 3.x' } |
| 37 | + @{ id = 'CVE-2025-12098'; desc = 'WordPress plugin SQL injection'; cvss = '7.2'; link = 'https://nvd.nist.gov/vuln/detail/CVE-2025-12098'; action = 'Update WP plugins' } |
| 38 | + @{ id = 'CVE-2025-11567'; desc = 'Linux kernel privilege escalation'; cvss = '7.8'; link = 'https://nvd.nist.gov/vuln/detail/CVE-2025-11567'; action = 'Update kernel to 6.8.9+' } |
| 39 | + @{ id = 'CVE-2025-09876'; desc = 'VMware ESXi authentication bypass'; cvss = '9.8'; link = 'https://nvd.nist.gov/vuln/detail/CVE-2025-09876'; action = 'Apply VMware patch' } |
| 40 | + @{ id = 'CVE-2025-08543'; desc = 'Zoom client remote code execution'; cvss = '8.1'; link = 'https://nvd.nist.gov/vuln/detail/CVE-2025-08543'; action = 'Update Zoom client' } |
27 | 41 | ) |
28 | 42 |
|
29 | | -# ---------- 2. PICK TOP 3 FROM EACH ---------- |
30 | | -$selectedCerts = $certs | Get-Random -Count 3 |
31 | | -$selectedCves = $cves | Get-Random -Count 3 |
| 43 | +# ---------- 2. TRACK SHOWN ITEMS (PREVENT DUPLICATES) ---------- |
| 44 | +$historyFile = Join-Path $repoRoot '.cyber-intel-history.json' |
| 45 | +$history = @{ certs = @(); cves = @() } |
32 | 46 |
|
33 | | -# Build a concise note (max ~250 chars so the CSV stays readable) |
34 | | -$certList = ($selectedCerts -join '; ') |
35 | | -$cveList = ($selectedCves -join '; ') |
36 | | -$task = "Daily cyber-sec news scan" |
37 | | -$note = "Certs: $certList | CVEs: $cveList" |
| 47 | +if (Test-Path $historyFile) { |
| 48 | + $history = Get-Content $historyFile -Raw | ConvertFrom-Json |
| 49 | +} |
38 | 50 |
|
39 | | -# ---------- 3. APPEND TO CSV ---------- |
40 | | -$date = Get-Date -Format 'yyyy-MM-dd' |
41 | | -$line = "$date,News,$task,$note" |
42 | | -Add-Content -Path $csvPath -Value $line -Encoding UTF8 |
| 51 | +# Filter out recently shown items (last 3 days) |
| 52 | +$availableCerts = $certs | Where-Object { $_.name -notin $history.certs } |
| 53 | +$availableCves = $cves | Where-Object { $_.id -notin $history.cves } |
| 54 | + |
| 55 | +# If we've exhausted the pool, reset history |
| 56 | +if ($availableCerts.Count -lt 5) { $availableCerts = $certs; $history.certs = @() } |
| 57 | +if ($availableCves.Count -lt 5) { $availableCves = $cves; $history.cves = @() } |
| 58 | + |
| 59 | +# Pick 5 random from available pool (or all available if less than 5) |
| 60 | +$certCount = [Math]::Min(5, $availableCerts.Count) |
| 61 | +$cveCount = [Math]::Min(5, $availableCves.Count) |
| 62 | +$selectedCerts = $availableCerts | Get-Random -Count $certCount |
| 63 | +$selectedCves = $availableCves | Get-Random -Count $cveCount |
| 64 | + |
| 65 | +# Update history |
| 66 | +$history.certs += $selectedCerts | ForEach-Object { $_.name } |
| 67 | +$history.cves += $selectedCves | ForEach-Object { $_.id } |
| 68 | + |
| 69 | +# Keep only last 10 items (2 days worth) |
| 70 | +if ($history.certs.Count -gt 10) { $history.certs = $history.certs[-10..-1] } |
| 71 | +if ($history.cves.Count -gt 10) { $history.cves = $history.cves[-10..-1] } |
| 72 | + |
| 73 | +# Save history |
| 74 | +$history | ConvertTo-Json | Set-Content $historyFile -Encoding UTF8 |
| 75 | + |
| 76 | +# ---------- 3. BUILD MARKDOWN CONTENT ---------- |
| 77 | +$markdown = @" |
| 78 | +# Cyber Intelligence Report - $date |
| 79 | +
|
| 80 | +> Automated daily scan of free certifications and critical vulnerabilities |
| 81 | +
|
| 82 | +## [CERTS] Free Cloud & Security Certifications |
| 83 | +
|
| 84 | +"@ |
| 85 | + |
| 86 | +for ($i = 0; $i -lt $selectedCerts.Count; $i++) { |
| 87 | + $cert = $selectedCerts[$i] |
| 88 | + $markdown += "$($i + 1). [$($cert.name)]($($cert.link)) - $($cert.notes)`n" |
| 89 | +} |
| 90 | + |
| 91 | +$markdown += @" |
| 92 | +
|
| 93 | +## [CVE] Critical Vulnerabilities (CVSS >= 7.5) |
| 94 | +
|
| 95 | +"@ |
| 96 | + |
| 97 | +for ($i = 0; $i -lt $selectedCves.Count; $i++) { |
| 98 | + $cve = $selectedCves[$i] |
| 99 | + $markdown += "$($i + 1). [$($cve.id)]($($cve.link)) - $($cve.desc) (CVSS $($cve.cvss)) - **Action:** $($cve.action)`n" |
| 100 | +} |
| 101 | + |
| 102 | +$markdown += @" |
| 103 | +
|
| 104 | +--- |
| 105 | +*Last updated: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')* |
| 106 | +*Generated by: fetch-news.ps1* |
| 107 | +"@ |
| 108 | + |
| 109 | +# ---------- 4. WRITE MARKDOWN FILE ---------- |
| 110 | +Set-Content -Path $mdPath -Value $markdown -Encoding UTF8 |
43 | 111 |
|
44 | | -# ---------- 4. COMMIT & PUSH ---------- |
45 | | -git add $csvPath |
46 | | -git commit -m "Daily cyber-sec news + 1% improvement ($date)" |
| 112 | +# ---------- 5. COMMIT & PUSH ---------- |
| 113 | +git add $mdPath $historyFile |
| 114 | +git commit -m "intel: daily cyber intelligence report ($date)" |
47 | 115 | git push |
48 | 116 |
|
49 | 117 | Write-Host "" |
50 | | -Write-Host "Done - added entry for $date" -ForegroundColor Green |
| 118 | +Write-Host "Cyber intelligence report created: cyber-intel-$date.md" -ForegroundColor Green |
0 commit comments