32. Linux and Network Hardening
32.4 Patching, Users, Permissions and Services
Patching fixes known vulnerabilities – the ones Nessus/OpenVAS found in Chapter 20.
sudo yum check-update # what needs updating
sudo yum update -y # apply all updates
sudo yum update --security -y # only security updates (where supported)
sudo yum install -y dnf-automatic 2>/dev/null || true # automatic updates on newer releases; review before enabling
Users and sudo:
sudo awk -F: '$3==0 {print $1}' /etc/passwd # only root should have UID 0
sudo awk -F: '($2==""){print $1}' /etc/shadow # accounts with empty passwords
sudo lastlog | grep -v "Never" # who has logged in
sudo userdel -r olduser # remove unused accounts
sudo visudo # edit sudo rules safely
sudo chage -M 90 -W 7 deploy # password expiry for password users
File permissions:
sudo chmod 600 /etc/ssh/sshd_config
sudo chmod 640 /var/www/html/config.php && sudo chown root:apache /var/www/html/config.php
sudo find / -xdev -perm -4000 -type f 2>/dev/null # SUID files (privilege escalation, Chapter 26)
sudo find / -xdev -type f -perm -0002 2>/dev/null # world-writable files
Services: stop and disable what you do not need.
sudo systemctl list-unit-files --type=service --state=enabled
sudo service vsftpd stop && sudo systemctl disable vsftpd
sudo yum remove -y telnet-server rsh-server
Also keep SELinux in enforcing mode on RHEL-family servers (getenforce should print Enforcing) instead of turning it off to "fix" permission errors.
Ravindra Bagale's Tip
When Apache can't read a file, students run chmod 777 or disable SELinux. Both are dangerous! Set the right owner (chown) and the right permissions (640/750), and for SELinux use restorecon -Rv /var/www/html. 777 means leaving the door open for everyone.
Ravindra Bagale's Tip – मराठी
Apache ला file वाचता येत नाही म्हणून students chmod 777 करतात किंवा SELinux disable करतात. दोन्ही धोकादायक! योग्य owner (chown) आणि योग्य permission (640/750) द्या, आणि SELinux साठी restorecon -Rv /var/www/html वापरा. 777 म्हणजे सगळ्यांसाठी दरवाजा उघडा.
Ravindra Bagale's Tip – हिंदी
Apache file नहीं पढ़ पाता तो students chmod 777 कर देते हैं या SELinux disable कर देते हैं. दोनों खतरनाक! सही owner (chown) और सही permission (640/750) दो, और SELinux के लिए restorecon -Rv /var/www/html इस्तेमाल करो. 777 मतलब सबके लिए दरवाज़ा खुला.
Lab
On Metasploitable or your lab server: list all UID 0 accounts, all SUID files and all enabled services. Remove one unneeded service, fix the permissions of your app's config.php to 640, and run sudo yum update -y. Re-run Lynis and compare the hardening index with 32.1.
Extended teaching notes
Why this lesson matters
Hardening is deleting unnecessary risk: fewer packages, fewer open ports, fewer privileged accounts, faster patches, better logs.
Hardening related services
[('SSH', 'Key auth, no root login, Fail2ban or equivalent, SG limited to your IP/VPN.', '', ''), ('SMB / NFS / LDAP / SNMP', 'Do not expose to the internet; patch; strong auth; disable unused versions (e.g. SMBv1).', '', ''), ('SMTP', 'Authenticated relay only; SPF/DKIM/DMARC for your domains.', '', ''), ('DNS', 'Restrict zone transfers; monitor for unexpected records (crt.sh for certs).', '', ''), ('Firewalls', 'Host firewall + cloud SG/NSG; default deny; document every allow.', '', '')]
Real examples
Global: CIS Benchmarks exist for Linux, Windows and clouds. Indian company (sample): a Pune team requires SSH keys only and weekly patch windows for internet-facing hosts.
Mini case study
Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.
Defender's worksheet (do this today)
- Write the lesson title, date and the exact lab target you are allowed to use.
- List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
- Run one safe check from the lesson on a lab system only. Paste the command and output.
- Write a two-sentence fix you would give a teammate.
- Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.
Indian workplace (sample data)
Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).
Global practice
Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.
Everyday analogy
Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.
Key terms
- Control: a safeguard (patch, config, process, detection).
- Finding: a weakness backed by evidence.
- Remediation: the fix plus how you verified it.
- Scope: systems you have written permission to touch.
- Least privilege: only the access the task needs.
- Defence in depth: several layers so one failure does not end the story.
Common mistakes
- Skipping written permission "just for a quick scan".
- Practising on hostel, office or public targets without authorisation.
- Collecting tool output without writing the fix.
- Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
- Publishing screenshots that contain secrets, cookies or internal hostnames.
Recap
- Evidence, fix, owner, date.
- Own lab only.
- Fix > spectacle.
Real incident: BeyondTrust Remote Support zero-day CVE-2026-102764 – from a web shell to root, stolen admin access and deleted logs (Oct 2026)
1. What happened
BeyondTrust Remote Support (earlier called Bomgar) is an appliance that IT help desks use to connect to company computers and fix them from far away. Because it can reach so many machines, it also stores and hands out many admin passwords and keys.
- On 15 October 2026, BeyondTrust disclosed CVE-2026-102764, a critical flaw in Remote Support versions 26.2.3 and earlier. An attacker on the internet without any login could perform file operations on the appliance.
- Mandiant (Google Threat Intelligence Group) found that a suspected China-nexus espionage group it calls ARMORY CASTLE (earlier tracked as UNC5221) used the flaw as a zero-day in late August 2026, before any patch existed.
- BeyondTrust says the group hit one BeyondTrust-hosted instance and one self-hosted appliance on 29 August. BeyondTrust's own threat hunting found the hosted case on 28 September and contained it within 27 minutes. The patch (BT26-05) came out on 8 October; hosted (SaaS) customers were patched automatically.
- On 16 October 2026, CISA said the flaw is being actively exploited and urged everyone to patch. Mandiant warned that wider attacks on unpatched appliances may follow now that the bug is public.
- BeyondTrust also shared an honest lesson: its sensors did fire when the attacker became root, but an automated triage tool closed those alerts as false positives.
2. How the hack happened (public reporting only – high-level)
- The attacker sent requests to the internet-facing appliance and used the flaw to place a small web shell (a hidden script that runs commands) in the appliance's web folder. No password was needed.
- The web shell ran as the low-privilege web service account. To become root, the attacker made a copy of the system shell owned by root with the SUID bit set – the same SUID privilege-escalation idea from Chapter 26.
- For persistence, the attacker changed the appliance's startup and configuration template so the service account got passwordless sudo. Because the template rebuilds the sudo rules, the backdoor survived reboots and configuration resets.
- As root, the attacker tried to read the appliance's stored password vault, then logged in to the admin portal with an Administrator account and raised that account's rights so it could open remote sessions to internal computers.
- Through those remote sessions the attacker downloaded internal documents such as software lists, and set up a hidden tunnel through the appliance's own reverse proxy.
- Again and again, the attacker deleted system, web and application logs to hide what they did.
3. How to stop it / defend (this lesson: patching, users, permissions and services)
- Patch internet-facing appliances first, and fast. VPNs, firewalls and remote-support boxes are the favourite door for this kind of group. Watch vendor advisories and the CISA Known Exploited Vulnerabilities (KEV) list, and patch those systems within days, not months.
- Hide admin pages from the internet. Allow the admin portal only from your office network or VPN (the same idea as allowing SSH only from your IP with
firewalldorufwin 32.3). Expose only the parts that customers and staff really need. - Know your SUID files. Save today's list from
find / -xdev -perm -4000 -type fand compare it every week. A new SUID file that is just a copy of a shell is a red flag. - Guard sudo rules and startup scripts. Review
visudoand/etc/sudoers.d/regularly. A service account should never haveNOPASSWD: ALL. Use file-integrity monitoring (for example AIDE or Wazuh FIM) on sudo files, startup scripts and web folders. - Get your logs off the box. Forward logs to a central SIEM in near real time (Chapter 31). The attacker deleted local logs, so the off-box copy is often the only proof left. Alert when logs suddenly stop arriving.
- Don't let a robot close serious alerts alone. Keep high-severity alerts for a human, and hunt for behaviour (new web scripts, a web account starting shells, new admin rights) even when no alert fired.
4. How to take care so it won't happen again (checklist)
- [ ] If you run self-hosted BeyondTrust Remote Support or Privileged Remote Access, apply BT26-05 now and follow the vendor advisory.
- [ ] If the appliance was reachable from the internet on a vulnerable version, treat it as possibly compromised: save evidence, rebuild from a clean patched image, then rotate every password and key it stored – after patching, not before.
- [ ] Keep a list of every internet-facing appliance, its version and owner, and check it against the KEV list every week.
- [ ] Keep a baseline of SUID files and sudo rules, and compare it on a schedule.
- [ ] Allow admin portals only from trusted networks, with SSO and strong MFA for every admin.
- [ ] Confirm that logs are reaching your SIEM every day, and review alerts that were closed automatically.
Source: BeyondTrust Security Team, "ARMORY CASTLE and BT26-05: What Security Teams Need to Know", 15 October 2026 (updated 16 October 2026); Mandiant / Google Threat Intelligence Group, "ARMORY CASTLE Exploits BeyondTrust", 15 October 2026; CISA alert "CISA Urges Patching Critical Vulnerability in BeyondTrust Remote Support", 16 October 2026; The Record, "Suspected Chinese espionage attackers abusing BeyondTrust IT support zero-day", 16 October 2026.
1. काय झालं
BeyondTrust Remote Support (आधीचं नाव Bomgar) हे एक appliance आहे. IT help desk वाले लांबून कंपनीच्या computers ला connect होऊन ते दुरुस्त करायला ते वापरतात. ते इतक्या machines पर्यंत पोहोचू शकतं, म्हणून त्यात खूप admin passwords आणि keys साठवलेले असतात आणि तेच ते वाटतं.
- 15 ऑक्टोबर 2026 ला BeyondTrust ने CVE-2026-102764 जाहीर केला. हा Remote Support च्या 26.2.3 आणि त्याआधीच्या versions मधला critical flaw आहे. Internet वरचा attacker कुठलाही login न करता appliance वर file operations करू शकत होता.
- Mandiant (Google Threat Intelligence Group) ला असं दिसलं की ते ARMORY CASTLE (आधी UNC5221 म्हणून track केलेला) म्हणतात तो, China शी संबंध असल्याचा संशय असलेला espionage group, हा flaw ऑगस्ट 2026 च्या शेवटी zero-day म्हणून वापरत होता – म्हणजे patch येण्याआधीच.
- BeyondTrust च्या मते या group ने 29 ऑगस्ट ला एक BeyondTrust-hosted instance आणि एक self-hosted appliance वर हल्ला केला. BeyondTrust च्या स्वतःच्या threat hunting ला hosted case 28 सप्टेंबर ला सापडली आणि त्यांनी ती 27 मिनिटांत आटोक्यात आणली. Patch (BT26-05) 8 ऑक्टोबर ला आला; hosted (SaaS) customers ना तो आपोआप लागला.
- 16 ऑक्टोबर 2026 ला CISA ने सांगितलं की हा flaw सध्या प्रत्यक्ष वापरला जातोय आणि सगळ्यांनी patch करावा. Bug public झाल्यामुळे unpatched appliances वर आणखी मोठे हल्ले होऊ शकतात, असा इशारा Mandiant ने दिला.
- BeyondTrust ने एक प्रामाणिक धडा पण सांगितला: attacker root झाला तेव्हा त्यांचे sensors खरंच वाजले, पण एका automated triage tool ने ते alerts false positive म्हणून बंद केले.
2. Hack कसा झाला (फक्त public reporting – high-level)
- Attacker ने internet वर उघड्या appliance ला requests पाठवल्या आणि flaw वापरून appliance च्या web folder मध्ये एक छोटा web shell (commands चालवणारी लपलेली script) ठेवला. Password ची गरजच पडली नाही.
- हा web shell कमी अधिकार असलेल्या web service account म्हणून चालत होता. Root होण्यासाठी attacker ने system shell ची एक copy बनवली, तिचा owner root केला आणि SUID bit लावला – Chapter 26 मधलीच SUID privilege escalation ची कल्पना.
- Persistence साठी attacker ने appliance चं startup आणि configuration template बदललं, ज्यामुळे service account ला password शिवाय sudo मिळालं. हे template sudo चे rules परत बनवतं, म्हणून हा backdoor reboot आणि configuration reset नंतरही टिकला.
- Root झाल्यावर attacker ने appliance मधली साठवलेली password vault वाचायचा प्रयत्न केला, मग एका Administrator account ने admin portal मध्ये login केलं आणि त्या account चे अधिकार वाढवले, म्हणजे आतल्या computers वर remote sessions उघडता येतील.
- त्या remote sessions मधून attacker ने software lists सारखे आतले documents download केले, आणि appliance च्याच reverse proxy मधून एक लपलेला tunnel बनवला.
- आपलं काम लपवण्यासाठी attacker ने पुन्हा पुन्हा system, web आणि application logs delete केले.
3. कसं थांबवायचं / बचाव (हा lesson: patching, users, permissions आणि services)
- Internet वर उघडे appliances आधी आणि लवकर patch करा. VPN, firewall आणि remote-support boxes हे अशा groups चे आवडते दरवाजे आहेत. Vendor advisories आणि CISA Known Exploited Vulnerabilities (KEV) list वर लक्ष ठेवा, आणि अशा systems महिन्यांत नाही तर काही दिवसांत patch करा.
- Admin pages internet पासून लपवा. Admin portal फक्त office network किंवा VPN मधूनच उघडू द्या (32.3 मध्ये
firewalldकिंवाufwने SSH फक्त तुमच्या IP वरून allow केलं, तीच कल्पना). Customers आणि staff ना खरंच लागतात तेवढेच भाग उघडे ठेवा. - तुमच्या SUID files ओळखा.
find / -xdev -perm -4000 -type fची आजची list save करा आणि दर आठवड्याला compare करा. Shell ची copy असलेली नवीन SUID file दिसली तर तो धोक्याचा इशारा आहे. - Sudo rules आणि startup scripts सांभाळा.
visudoआणि/etc/sudoers.d/नियमित तपासा. Service account ला कधीचNOPASSWD: ALLनको. Sudo files, startup scripts आणि web folders वर file-integrity monitoring (उदा. AIDE किंवा Wazuh FIM) लावा. - Logs box च्या बाहेर पाठवा. Logs लगेच central SIEM कडे forward करा (Chapter 31). Attacker ने local logs delete केले, त्यामुळे बाहेर ठेवलेली copy हाच बऱ्याचदा एकमेव पुरावा उरतो. Logs अचानक यायचे बंद झाले तर alert यायला हवा.
- Serious alerts एकट्या robot ला बंद करू देऊ नका. High-severity alerts माणसासाठी ठेवा, आणि alert आला नसला तरी behaviour शोधा (नवीन web scripts, web account ने shell चालवणं, नवीन admin rights).
4. पुन्हा असं होऊ नये म्हणून काय काळजी घ्यायची (checklist)
- [ ] तुम्ही self-hosted BeyondTrust Remote Support किंवा Privileged Remote Access वापरत असाल, तर आत्ताच BT26-05 लावा आणि vendor advisory प्रमाणे करा.
- [ ] Vulnerable version वर appliance internet वरून reachable होतं, तर ते compromise झालेलं असू शकतं असं समजा: पुरावा save करा, clean patched image मधून परत बनवा, आणि मग त्यात साठवलेला प्रत्येक password आणि key बदला – patching नंतर, आधी नाही.
- [ ] Internet वर उघड्या प्रत्येक appliance ची list ठेवा – त्याचं version आणि owner – आणि दर आठवड्याला KEV list शी तपासा.
- [ ] SUID files आणि sudo rules चा baseline ठेवा, आणि ठरलेल्या वेळी compare करा.
- [ ] Admin portals फक्त trusted networks मधूनच, प्रत्येक admin साठी SSO आणि मजबूत MFA सोबत.
- [ ] Logs रोज SIEM पर्यंत पोहोचतात का ते तपासा, आणि आपोआप बंद झालेले alerts पण review करा.
स्रोत: BeyondTrust Security Team, "ARMORY CASTLE and BT26-05: What Security Teams Need to Know", 15 ऑक्टोबर 2026 (16 ऑक्टोबर 2026 ला update); Mandiant / Google Threat Intelligence Group, "ARMORY CASTLE Exploits BeyondTrust", 15 ऑक्टोबर 2026; CISA alert "CISA Urges Patching Critical Vulnerability in BeyondTrust Remote Support", 16 ऑक्टोबर 2026; The Record, 16 ऑक्टोबर 2026.
1. क्या हुआ
BeyondTrust Remote Support (पहले का नाम Bomgar) एक appliance है. IT help desk वाले दूर से कंपनी के computers से connect होकर उन्हें ठीक करने के लिए इसे इस्तेमाल करते हैं. यह इतनी machines तक पहुँच सकता है, इसलिए इसमें बहुत सारे admin passwords और keys रखे होते हैं और यही उन्हें बाँटता है.
- 15 अक्टूबर 2026 को BeyondTrust ने CVE-2026-102764 का खुलासा किया. यह Remote Support के 26.2.3 और उससे पुराने versions में एक critical flaw है. Internet पर बैठा attacker बिना किसी login के appliance पर file operations कर सकता था.
- Mandiant (Google Threat Intelligence Group) ने पाया कि जिसे वे ARMORY CASTLE (पहले UNC5221 के नाम से track किया गया) कहते हैं, China से जुड़ा होने के शक वाला वह espionage group, यह flaw अगस्त 2026 के आख़िर में zero-day की तरह इस्तेमाल कर रहा था – यानी patch आने से पहले ही.
- BeyondTrust के मुताबिक़ इस group ने 29 अगस्त को एक BeyondTrust-hosted instance और एक self-hosted appliance पर हमला किया. BeyondTrust की अपनी threat hunting को hosted case 28 सितंबर को मिला और उसे 27 मिनट में काबू कर लिया गया. Patch (BT26-05) 8 अक्टूबर को आया; hosted (SaaS) customers को यह अपने आप लग गया.
- 16 अक्टूबर 2026 को CISA ने कहा कि इस flaw का अभी असल में इस्तेमाल हो रहा है और सबको patch करना चाहिए. Bug public होने के बाद unpatched appliances पर और बड़े हमले हो सकते हैं, ऐसी चेतावनी Mandiant ने दी.
- BeyondTrust ने एक ईमानदार सबक़ भी बताया: attacker के root बनते ही उनके sensors सच में बजे, लेकिन एक automated triage tool ने उन alerts को false positive मानकर बंद कर दिया.
2. Hack कैसे हुआ (सिर्फ़ public reporting – high-level)
- Attacker ने internet पर खुले appliance को requests भेजीं और flaw का इस्तेमाल करके appliance के web folder में एक छोटा web shell (commands चलाने वाली छुपी script) रख दिया. Password की ज़रूरत ही नहीं पड़ी.
- यह web shell कम अधिकार वाले web service account के रूप में चल रहा था. Root बनने के लिए attacker ने system shell की एक copy बनाई, उसका owner root किया और SUID bit लगा दिया – Chapter 26 वाला ही SUID privilege escalation का तरीका.
- Persistence के लिए attacker ने appliance का startup और configuration template बदल दिया, जिससे service account को बिना password के sudo मिल गया. यह template sudo के rules दोबारा बनाता है, इसलिए यह backdoor reboot और configuration reset के बाद भी बना रहा.
- Root बनने के बाद attacker ने appliance में रखी password vault पढ़ने की कोशिश की, फिर एक Administrator account से admin portal में login किया और उस account के अधिकार बढ़ा दिए, ताकि अंदर के computers पर remote sessions खोल सके.
- उन remote sessions से attacker ने software lists जैसे अंदर के documents download किए, और appliance के अपने reverse proxy से एक छुपा हुआ tunnel बनाया.
- अपना काम छुपाने के लिए attacker ने बार-बार system, web और application logs delete किए.
3. कैसे रोकें / बचाव (यह lesson: patching, users, permissions और services)
- Internet पर खुले appliances पहले और जल्दी patch करो. VPN, firewall और remote-support boxes ऐसे groups के पसंदीदा दरवाज़े हैं. Vendor advisories और CISA Known Exploited Vulnerabilities (KEV) list पर नज़र रखो, और ऐसे systems महीनों में नहीं, कुछ दिनों में patch करो.
- Admin pages को internet से छुपाओ. Admin portal सिर्फ़ office network या VPN से ही खुलने दो (32.3 में
firewalldयाufwसे SSH सिर्फ़ अपने IP से allow किया था, वही सोच). Customers और staff को जितने हिस्से सच में चाहिए, उतने ही खुले रखो. - अपनी SUID files पहचानो.
find / -xdev -perm -4000 -type fकी आज की list save करो और हर हफ़्ते compare करो. Shell की copy वाली नई SUID file दिखे तो यह ख़तरे का संकेत है. - Sudo rules और startup scripts की हिफ़ाज़त करो.
visudoऔर/etc/sudoers.d/नियमित रूप से जाँचो. Service account को कभी भीNOPASSWD: ALLनहीं मिलना चाहिए. Sudo files, startup scripts और web folders पर file-integrity monitoring (जैसे AIDE या Wazuh FIM) लगाओ. - Logs को box से बाहर भेजो. Logs तुरंत central SIEM को forward करो (Chapter 31). Attacker ने local logs delete कर दिए, इसलिए बाहर रखी copy ही अक्सर अकेला सबूत बचती है. Logs अचानक आना बंद हों तो alert आना चाहिए.
- Serious alerts अकेले robot को बंद मत करने दो. High-severity alerts इंसान के लिए रखो, और alert न आया हो तब भी behaviour खोजो (नई web scripts, web account का shell चलाना, नए admin rights).
4. दोबारा ऐसा न हो, इसके लिए क्या ध्यान रखें (checklist)
- [ ] अगर आप self-hosted BeyondTrust Remote Support या Privileged Remote Access इस्तेमाल करते हो, तो अभी BT26-05 लगाओ और vendor advisory के हिसाब से चलो.
- [ ] अगर vulnerable version पर appliance internet से reachable था, तो मानो कि वह compromise हो चुका हो सकता है: सबूत save करो, clean patched image से दोबारा बनाओ, फिर उसमें रखा हर password और key बदलो – patching के बाद, पहले नहीं.
- [ ] Internet पर खुले हर appliance की list रखो – उसका version और owner – और हर हफ़्ते KEV list से मिलाओ.
- [ ] SUID files और sudo rules का baseline रखो, और तय समय पर compare करो.
- [ ] Admin portals सिर्फ़ trusted networks से, हर admin के लिए SSO और मज़बूत MFA के साथ.
- [ ] Logs रोज़ SIEM तक पहुँच रहे हैं या नहीं, यह जाँचो, और अपने आप बंद हुए alerts भी review करो.
स्रोत: BeyondTrust Security Team, "ARMORY CASTLE and BT26-05: What Security Teams Need to Know", 15 अक्टूबर 2026 (16 अक्टूबर 2026 को update); Mandiant / Google Threat Intelligence Group, "ARMORY CASTLE Exploits BeyondTrust", 15 अक्टूबर 2026; CISA alert "CISA Urges Patching Critical Vulnerability in BeyondTrust Remote Support", 16 अक्टूबर 2026; The Record, 16 अक्टूबर 2026.
Check if you're safe: Is My Website Hacked? · Website Security Checklist · Password Strength Checker
Real incident: Alpine Linux GitLab – a late, half-applied patch let an attacker get close, so the server was rebuilt from scratch (Oct 2026)
1. What happened
In this lesson you learnt that patching means two things: install the fix quickly, and then check that the fix is really there. This real case shows what goes wrong when either step slips.
- Alpine Linux is a small Linux system used inside many Docker containers. Its developers keep their code on their own GitLab server. GitLab is a website where teams store code and run automatic build jobs, called CI (continuous integration).
- A CVE is a public ID number for a security bug. CVE-2026-97229 is a critical bug (score 10 out of 10) in the part of Ruby that reads patterns in CI settings. Ruby is the programming language GitLab is built on. A bad pattern could let an attacker run their own commands on the server. This is called RCE (remote code execution).
- GitLab released the fix on 12 October 2026. On 13 October Alpine upgraded, but by mistake picked version 19.3.4, which did not have the fix, instead of 19.3.5, which did.
- On 20 and 21 October, a newly registered account sent specially made CI settings to Alpine's GitLab. GitLab crashed 8 times. In 4 of those crashes the attacker got part of the way and then failed.
- On 22 October Alpine upgraded again, to 19.3.6. It still did not fix the bug. The fix was a patch to Ruby that GitLab only puts in its own official packages. Alpine's own container image used normal Ruby, so it never got the patch.
- Alpine found no proof that the attacker ran code. But some logs were gone and there was no record of outgoing connections, so they could not be sure. They closed GitLab on 27 October, rebuilt it from scratch, reset all passwords, 2FA, tokens and stored secrets, and reopened it on 29–30 October.
- Alpine says its packages, releases and signing keys were not affected. The signing keys were never stored on the GitLab server.
2. How the hack happened (public reporting only – high-level)
- A fix for a critical bug was published, so attackers knew the bug existed.
- Alpine's server stayed unpatched for over a week because the wrong version was installed.
- The attacker made a new account on the public GitLab and probed it.
- The attacker downloaded Alpine's own GitLab container image, which suggests they were tuning the attack to that exact build.
- The attacker sent crafted CI settings that crashed the server again and again, getting close but not fully succeeding (as far as anyone can tell).
- An upgrade that looked correct still left the bug open, because the real fix was inside a bundled part (Ruby) that the custom image did not include.
3. How to stop it / defend (this lesson: patching)
Why: a published fix is also a public map of the bug. The days between the fix and your update are the most dangerous days.
Controls you can use:
- Patch critical bugs within a day on anything open to the internet. Alpine now aims for this.
- Read the advisory and note the exact fixed version. Then check that the version you installed is that version or newer.
- Check the parts inside the app too. If you build your own image, a fix may live in a bundled part, like Ruby, OpenSSL or Java. Updating only the main app is not enough.
- Close or limit open sign-up on internal tools, so a stranger cannot create an account and reach risky features.
- Keep logs long enough (more than 14 days) and record outgoing connections, so you can prove what did or did not happen.
- When you cannot be sure, rebuild. A clean new server, new passwords and new secrets remove anything an attacker may have left behind.
- Keep signing keys off the main server, so even a full break-in cannot sign fake releases.
Example 1: see which version of a package is installed.
- Open a terminal on your Linux server (RHEL, Rocky or Amazon Linux).
- Run
rpm -q ruby - Output: one line, like
ruby-3.3.12-1.el9.x86_64. - What it means: Ruby 3.3.12 is installed. The advisory says the fix is in 3.3.13 or newer, so this server is still open to the bug.
Example 2: list the security updates that are waiting.
- Use the same terminal.
- Run
sudo dnf updateinfo list --security - Output: one line per waiting fix, like
RHSA-2026:8812 Important/Sec. ruby-3.3.13-1.el9.x86_64. - What it means: a security fix for Ruby is ready. Install it with
sudo dnf upgrade --security, then run Example 1 again and confirm it now shows 3.3.13.
Example 3: check the version inside a running container (the step Alpine missed).
- Find the container name with
docker ps. Here it isgitlab. - Run
docker exec gitlab ruby --version - Output: like
ruby 3.3.12 (2026-07-10 revision 1a2b3c4d5e) [x86_64-linux]. - What it means: the server may be patched, but this container still runs the old Ruby. Rebuild or pull a fixed image, restart the container, and check again.
4. How to take care so it won't happen again (checklist)
- [ ] I install critical security fixes within one day on internet-facing servers.
- [ ] After every patch, I check the installed version against the advisory.
- [ ] I also check bundled parts (Ruby, OpenSSL, Java) inside my containers and custom images.
- [ ] Public sign-up is off, or limited, on internal tools like GitLab.
- [ ] I keep logs for more than 14 days, including outgoing connections.
- [ ] If I cannot rule out a break-in, I rebuild and reset all passwords, tokens and secrets.
- [ ] My signing keys are not stored on the same server as my code tools.
- [ ] I never reuse my work password on other sites.
Source: Alpine Linux, "GitLab security incident: attempted exploitation of CVE-2026-97229", 28 October 2026 (updated 30 October 2026); Alpine Linux, "GitLab is back: what you need to do", 30 October 2026; BleepingComputer, "Alpine Linux rebuilds GitLab after attempted RCE attack" (Bill Toulas), 1 November 2026.
1. काय झालं
या lesson मध्ये तुम्ही शिकलात की patching म्हणजे दोन गोष्टी: fix लवकर install करायचा, आणि मग तो खरंच लागला आहे का ते चेक करायचं. ही खरी घटना दाखवते की यातली कोणतीही एक स्टेप चुकली तर काय होतं.
- Alpine Linux ही एक छोटी Linux system आहे, जी अनेक Docker containers मध्ये वापरली जाते. तिचे developers आपला code स्वतःच्या GitLab server वर ठेवतात. GitLab ही एक website आहे जिथे teams code ठेवतात आणि आपोआप चालणारे build jobs चालवतात, त्यांना CI (continuous integration) म्हणतात.
- CVE म्हणजे security bug ला दिलेला सार्वजनिक ID नंबर. CVE-2026-97229 हा Ruby च्या त्या भागातला गंभीर bug आहे (10 पैकी 10 score) जो CI settings मधले patterns वाचतो. Ruby ही programming language आहे जिच्यावर GitLab बनलं आहे. खराब pattern मुळे attacker server वर स्वतःच्या commands चालवू शकला असता. याला RCE (remote code execution) म्हणतात.
- GitLab ने 12 ऑक्टोबर 2026 ला fix दिला. 13 ऑक्टोबरला Alpine ने upgrade केलं, पण चुकून 19.3.4 version घेतलं, ज्यात fix नव्हता. Fix असलेलं 19.3.5 घ्यायला हवं होतं.
- 20 आणि 21 ऑक्टोबर ला एका नवीन account ने Alpine च्या GitLab ला खास बनवलेल्या CI settings पाठवल्या. GitLab 8 वेळा crash झालं. त्यातल्या 4 वेळा attacker अर्ध्या रस्त्यापर्यंत पोहोचला आणि मग अडकला.
- 22 ऑक्टोबरला Alpine ने पुन्हा 19.3.6 ला upgrade केलं. तरीही bug बंद झाला नाही. Fix हा Ruby साठीचा patch होता, जो GitLab फक्त स्वतःच्या official packages मध्ये टाकतं. Alpine च्या स्वतःच्या container image मध्ये साधी Ruby होती, म्हणून patch कधी आलाच नाही.
- Attacker ने code चालवल्याचा पुरावा Alpine ला मिळाला नाही. पण काही logs गेले होते आणि बाहेर जाणाऱ्या connections ची नोंद नव्हती, म्हणून त्यांना खात्री देता आली नाही. त्यांनी 27 ऑक्टोबरला GitLab बंद केलं, ते पूर्ण नव्याने बनवलं, सगळे passwords, 2FA, tokens आणि साठवलेली गुपितं reset केली, आणि 29–30 ऑक्टोबरला परत चालू केलं.
- Alpine सांगते की त्यांचे packages, releases आणि signing keys वर परिणाम झाला नाही. Signing keys कधीच GitLab server वर ठेवल्या नव्हत्या.
2. हॅक कसा झाला (फक्त जाहीर माहितीवरून – थोडक्यात)
- गंभीर bug चा fix प्रसिद्ध झाला, त्यामुळे attackers ना bug असल्याचं कळलं.
- चुकीचं version install झाल्यामुळे Alpine चा server एक आठवड्याहून जास्त काळ patch शिवाय राहिला.
- Attacker ने public GitLab वर नवीन account बनवलं आणि चाचपणी केली.
- Attacker ने Alpine ची स्वतःची GitLab container image download केली. यावरून वाटतं की तो हल्ला त्या नेमक्या build साठी जुळवत होता.
- Attacker ने खास CI settings पाठवून server पुन्हा पुन्हा crash केला. तो जवळ पोहोचला, पण (आत्तापर्यंतच्या माहितीनुसार) पूर्ण यशस्वी झाला नाही.
- बरोबर वाटणाऱ्या upgrade नंतरही bug उघडाच राहिला, कारण खरा fix आतल्या भागात (Ruby) होता, जो custom image मध्ये नव्हता.
3. हे कसं थांबवायचं / बचाव (हा lesson: patching)
का: प्रसिद्ध झालेला fix म्हणजे bug चा सार्वजनिक नकाशाच असतो. Fix आल्यापासून तुम्ही update करेपर्यंतचे दिवस सगळ्यात धोकादायक असतात.
तुम्ही वापरू शकता असे controls:
- Internet वर उघड्या असलेल्या systems वर गंभीर bugs एका दिवसात patch करा. Alpine आता हेच ध्येय ठेवते.
- Advisory वाचा आणि नेमकं fixed version लिहून ठेवा. मग तुम्ही install केलेलं version तेच किंवा त्याहून नवीन आहे का ते चेक करा.
- App च्या आतले भागही चेक करा. तुम्ही स्वतःची image बनवत असाल, तर fix एखाद्या आतल्या भागात असू शकतो, जसं Ruby, OpenSSL किंवा Java. फक्त मुख्य app update करणं पुरेसं नाही.
- Internal tools वर open sign-up बंद किंवा मर्यादित करा, म्हणजे अनोळखी माणूस account बनवून धोकादायक features पर्यंत पोहोचू शकणार नाही.
- Logs पुरेसे दिवस ठेवा (14 दिवसांहून जास्त) आणि बाहेर जाणाऱ्या connections ची नोंद ठेवा, म्हणजे काय झालं आणि काय नाही हे सिद्ध करता येईल.
- खात्री नसेल तर नव्याने बनवा. स्वच्छ नवीन server, नवीन passwords आणि नवीन गुपितं attacker ने मागे सोडलेलं काहीही काढून टाकतात.
- Signing keys मुख्य server पासून दूर ठेवा, म्हणजे पूर्ण घुसखोरी झाली तरी खोटे releases sign करता येणार नाहीत.
उदाहरण 1: एखाद्या package चं कोणतं version install आहे ते बघा.
- तुमच्या Linux server वर (RHEL, Rocky किंवा Amazon Linux) terminal उघडा.
- हे चालवा:
rpm -q ruby - Output: एक लाइन, जसं
ruby-3.3.12-1.el9.x86_64. - याचा अर्थ: Ruby 3.3.12 install आहे. Advisory सांगते की fix 3.3.13 किंवा नवीन version मध्ये आहे, म्हणून हा server अजूनही bug साठी उघडा आहे.
उदाहरण 2: वाट पाहत असलेल्या security updates ची यादी बघा.
- तोच terminal वापरा.
- हे चालवा:
sudo dnf updateinfo list --security - Output: प्रत्येक बाकी fix साठी एक लाइन, जसं
RHSA-2026:8812 Important/Sec. ruby-3.3.13-1.el9.x86_64. - याचा अर्थ: Ruby साठी security fix तयार आहे. तो
sudo dnf upgrade --securityने install करा, मग उदाहरण 1 पुन्हा चालवा आणि आता 3.3.13 दिसतंय याची खात्री करा.
उदाहरण 3: चालू container च्या आतलं version चेक करा (Alpine कडून सुटलेली स्टेप).
docker psने container चं नाव शोधा. इथे तेgitlabआहे.- हे चालवा:
docker exec gitlab ruby --version - Output: जसं
ruby 3.3.12 (2026-07-10 revision 1a2b3c4d5e) [x86_64-linux]. - याचा अर्थ: server patch झाला असेल, पण हा container अजूनही जुनी Ruby चालवतोय. Fixed image बनवा किंवा pull करा, container restart करा, आणि पुन्हा चेक करा.
4. परत असं होऊ नये म्हणून काळजी (checklist)
- [ ] Internet वर उघड्या servers वर मी गंभीर security fixes एका दिवसात install करतो.
- [ ] प्रत्येक patch नंतर मी install झालेलं version advisory शी जुळवून बघतो.
- [ ] माझ्या containers आणि custom images मधले आतले भागही (Ruby, OpenSSL, Java) मी चेक करतो.
- [ ] GitLab सारख्या internal tools वर public sign-up बंद किंवा मर्यादित आहे.
- [ ] मी logs 14 दिवसांहून जास्त ठेवतो, बाहेर जाणाऱ्या connections सकट.
- [ ] घुसखोरी झाली नाही याची खात्री नसेल, तर मी server नव्याने बनवतो आणि सगळे passwords, tokens आणि गुपितं reset करतो.
- [ ] माझ्या signing keys code tools च्या server वर ठेवलेल्या नाहीत.
- [ ] मी कामाचा password इतर websites वर कधीच परत वापरत नाही.
स्रोत: Alpine Linux, "GitLab security incident: attempted exploitation of CVE-2026-97229", 28 ऑक्टोबर 2026 (updated 30 ऑक्टोबर 2026); Alpine Linux, "GitLab is back: what you need to do", 30 ऑक्टोबर 2026; BleepingComputer, "Alpine Linux rebuilds GitLab after attempted RCE attack" (Bill Toulas), 1 नोव्हेंबर 2026.
1. क्या हुआ
इस lesson में आपने सीखा कि patching यानी दो काम: fix जल्दी install करना, और फिर चेक करना कि वह सच में लगा है या नहीं. यह असली घटना दिखाती है कि इनमें से कोई एक कदम छूट जाए तो क्या होता है.
- Alpine Linux एक छोटा Linux system है, जो कई Docker containers के अंदर इस्तेमाल होता है. इसके developers अपना code अपने GitLab server पर रखते हैं. GitLab एक website है जहाँ teams code रखती हैं और अपने-आप चलने वाले build jobs चलाती हैं, जिन्हें CI (continuous integration) कहते हैं.
- CVE यानी किसी security bug का सार्वजनिक ID नंबर. CVE-2026-97229 Ruby के उस हिस्से का गंभीर bug है (10 में से 10 score) जो CI settings के patterns पढ़ता है. Ruby वह programming language है जिस पर GitLab बना है. खराब pattern से attacker server पर अपने commands चला सकता था. इसे RCE (remote code execution) कहते हैं.
- GitLab ने 12 अक्टूबर 2026 को fix जारी किया. 13 अक्टूबर को Alpine ने upgrade किया, लेकिन गलती से 19.3.4 version ले लिया, जिसमें fix नहीं था. Fix वाला 19.3.5 लेना था.
- 20 और 21 अक्टूबर को एक नए account ने Alpine के GitLab को खास बनाई गई CI settings भेजीं. GitLab 8 बार crash हुआ. उनमें से 4 बार attacker आधे रास्ते तक पहुँचा और फिर अटक गया.
- 22 अक्टूबर को Alpine ने फिर 19.3.6 पर upgrade किया. फिर भी bug बंद नहीं हुआ. Fix Ruby का एक patch था, जिसे GitLab सिर्फ़ अपने official packages में डालता है. Alpine की अपनी container image में सामान्य Ruby थी, इसलिए patch कभी आया ही नहीं.
- Alpine को attacker के code चलाने का सबूत नहीं मिला. लेकिन कुछ logs गायब थे और बाहर जाने वाले connections का कोई रिकॉर्ड नहीं था, इसलिए वे पक्का नहीं कह सके. उन्होंने 27 अक्टूबर को GitLab बंद किया, उसे शुरू से नया बनाया, सारे passwords, 2FA, tokens और रखे हुए राज़ reset किए, और 29–30 अक्टूबर को फिर से खोला.
- Alpine कहता है कि उसके packages, releases और signing keys पर असर नहीं हुआ. Signing keys कभी GitLab server पर रखी ही नहीं गई थीं.
2. हैक कैसे हुआ (सिर्फ़ सार्वजनिक जानकारी से – संक्षेप में)
- गंभीर bug का fix प्रकाशित हुआ, तो attackers को bug के होने का पता चल गया.
- गलत version install होने से Alpine का server एक हफ़्ते से ज़्यादा बिना patch के रहा.
- Attacker ने public GitLab पर नया account बनाया और चेक किया कि क्या-क्या खुला है.
- Attacker ने Alpine की अपनी GitLab container image download की. इससे लगता है कि वह हमले को उसी खास build के हिसाब से तैयार कर रहा था.
- Attacker ने खास CI settings भेजकर server को बार-बार crash किया. वह करीब पहुँचा, लेकिन (अब तक की जानकारी के अनुसार) पूरी तरह सफल नहीं हुआ.
- सही दिखने वाले upgrade के बाद भी bug खुला रहा, क्योंकि असली fix अंदर के हिस्से (Ruby) में था, जो custom image में नहीं था.
3. इसे कैसे रोकें / बचाव (यह lesson: patching)
क्यों: प्रकाशित fix bug का सार्वजनिक नक्शा भी होता है. Fix आने से लेकर आपके update करने तक के दिन सबसे खतरनाक होते हैं.
आप ये controls इस्तेमाल कर सकते हैं:
- Internet पर खुले systems पर गंभीर bugs एक दिन के अंदर patch करें. Alpine अब यही लक्ष्य रखता है.
- Advisory पढ़ें और सही fixed version लिख लें. फिर चेक करें कि आपका install किया version वही या उससे नया है.
- App के अंदर के हिस्से भी चेक करें. अगर आप अपनी image बनाते हैं, तो fix किसी अंदर के हिस्से में हो सकता है, जैसे Ruby, OpenSSL या Java. सिर्फ़ मुख्य app update करना काफ़ी नहीं.
- Internal tools पर open sign-up बंद या सीमित करें, ताकि कोई अजनबी account बनाकर खतरनाक features तक न पहुँच सके.
- Logs काफ़ी दिनों तक रखें (14 दिनों से ज़्यादा) और बाहर जाने वाले connections रिकॉर्ड करें, ताकि साबित कर सकें कि क्या हुआ और क्या नहीं.
- पक्का न हो तो नया बनाएँ. साफ़ नया server, नए passwords और नए राज़ attacker का छोड़ा हुआ सब कुछ हटा देते हैं.
- Signing keys मुख्य server से दूर रखें, ताकि पूरी घुसपैठ होने पर भी नकली releases sign न हो सकें.
उदाहरण 1: देखें कि किसी package का कौन-सा version install है.
- अपने Linux server (RHEL, Rocky या Amazon Linux) पर terminal खोलें.
- यह चलाएँ:
rpm -q ruby - Output: एक लाइन, जैसे
ruby-3.3.12-1.el9.x86_64. - इसका मतलब: Ruby 3.3.12 install है. Advisory कहती है कि fix 3.3.13 या नए version में है, इसलिए यह server अभी भी bug के लिए खुला है.
उदाहरण 2: इंतज़ार कर रहे security updates की लिस्ट देखें.
- वही terminal इस्तेमाल करें.
- यह चलाएँ:
sudo dnf updateinfo list --security - Output: हर बाकी fix के लिए एक लाइन, जैसे
RHSA-2026:8812 Important/Sec. ruby-3.3.13-1.el9.x86_64. - इसका मतलब: Ruby का security fix तैयार है. इसे
sudo dnf upgrade --securityसे install करें, फिर उदाहरण 1 दोबारा चलाएँ और पक्का करें कि अब 3.3.13 दिख रहा है.
उदाहरण 3: चलते container के अंदर का version चेक करें (वह कदम जो Alpine से छूट गया).
docker psसे container का नाम ढूँढें. यहाँ वहgitlabहै.- यह चलाएँ:
docker exec gitlab ruby --version - Output: जैसे
ruby 3.3.12 (2026-07-10 revision 1a2b3c4d5e) [x86_64-linux]. - इसका मतलब: server patch हो गया हो, फिर भी यह container पुरानी Ruby चला रहा है. Fixed image बनाएँ या pull करें, container restart करें, और फिर से चेक करें.
4. दोबारा ऐसा न हो, इसके लिए सावधानी (checklist)
- [ ] Internet पर खुले servers पर मैं गंभीर security fixes एक दिन के अंदर install करता हूँ.
- [ ] हर patch के बाद मैं install हुए version को advisory से मिलाता हूँ.
- [ ] अपने containers और custom images के अंदर के हिस्से (Ruby, OpenSSL, Java) भी मैं चेक करता हूँ.
- [ ] GitLab जैसे internal tools पर public sign-up बंद या सीमित है.
- [ ] मैं logs 14 दिनों से ज़्यादा रखता हूँ, बाहर जाने वाले connections के साथ.
- [ ] अगर घुसपैठ न होने का पक्का न हो, तो मैं server नया बनाता हूँ और सारे passwords, tokens और राज़ reset करता हूँ.
- [ ] मेरी signing keys code tools वाले server पर नहीं रखी हैं.
- [ ] मैं अपना काम का password दूसरी websites पर कभी दोबारा इस्तेमाल नहीं करता.
स्रोत: Alpine Linux, "GitLab security incident: attempted exploitation of CVE-2026-97229", 28 अक्टूबर 2026 (updated 30 अक्टूबर 2026); Alpine Linux, "GitLab is back: what you need to do", 30 अक्टूबर 2026; BleepingComputer, "Alpine Linux rebuilds GitLab after attempted RCE attack" (Bill Toulas), 1 नवंबर 2026.
Ravindra Bagale's Tip
Upgrading is not the same as being fixed. After every security update, run one command to see the real installed version, and compare it with the advisory. Alpine upgraded twice and was still open, because nobody checked the version inside the container.
Ravindra Bagale's Tip – मराठी
Upgrade केलं म्हणजे fix झालं असं नाही. प्रत्येक security update नंतर एक command चालवून खरं install झालेलं version बघा, आणि ते advisory शी जुळवा. Alpine ने दोन वेळा upgrade केलं तरी bug उघडाच राहिला, कारण container च्या आतलं version कोणी चेकच केलं नाही.
Ravindra Bagale's Tip – हिंदी
Upgrade करना और fix होना एक बात नहीं है. हर security update के बाद एक command चलाकर असली install हुआ version देखें, और उसे advisory से मिलाएँ. Alpine ने दो बार upgrade किया फिर भी bug खुला रहा, क्योंकि container के अंदर का version किसी ने चेक ही नहीं किया.
Check if you're safe: Website Security Checklist · Password Strength Checker