50٪ تخفیف روی تمام دوره‌ها!
پایان تخفیف تا:
مشاهده دوره‌ها
0

پارامتر های CIS برای لینوکس قسمت اول

سلام Linux CIS یک چک لیست در قالب استاندارد CIS هست  که در جهت امن تر شدن لینوکس انجام میشود ، این چک لیست ها (پارامتر ها) مواردی هستند که باید در جهت مقاوم سازی یا هاردنینگ روی توزیع لینوکسی انجام شوند ...


من یه تعداد ازاین پارامتر هارو که میخونم متوجه نمیشم که چه حملاتی را ممکنه دفع کنه این تعداد پارامتر ، ممنون میشم روی هر کدام ازین پارامتر ها ، بررسی کنید اگر ست نشه این پارامتر ممکنه چه حملاتی تسهیل گردد ، و اگر این پارامتر ها ست بشود ، چگووونه باعث جلوگیری از همان حملات میشود


یک :‌

/tmp حتما وجود داشته باشد و به این شکل‌ در فایل /etc/fstab تنظیم شود :

tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0


دو :

 Ensure nodev option set on /tmp partition

به این صورت :

mount -o remount,nodev /tmp


سه :‌

Ensure nosuid option set on /tmp partition

به این صورت :

mount -o remount,nosuid /tmp


چهار:

Ensure noexec option set on /tmp partition

به این صورت :

mount -o remount,noexec /tmp







پرسیده شده در 1401/09/29 توسط

2 پاسخ

0

من به ترتیب طبق CIS  دلیل پارامتر های بالارو هم مینوسیم :


یک :‌

Description:
The /tmp directory is a world-writable directory used for temporary storage by 
and some applications.
Rationale:

Making /tmp its own file system allows an administrator to set the noexec option on the
mount, making /tmp useless for an attacker to install executable code. It would also
prevent an attacker from establishing a hardlink to a system setuid program and wait for it
to be updated. Once the program was updated, the hardlink would be broken and the
attacker would have his own copy of the program. If the program happened to have a
security vulnerability, the attacker could continue to exploit the known flaw
This can be accomplished by either mounting tmpfs to /tmp, or creating a separate
partition for /tmp.

دو :

Description:
the nodev mount option specifies that the filesystem cannot contain special devices
Rationale:

Since the /tmp filesystem is not intended to support devices, set this optin to ensure that
users cannot attempt to create block or character special devices in /tmp

سه :

Description:
The nosuid mount option specifies that the filesystem cannot contain setuid files
Rationale:

Since the /tmp filesystem is only intended for temporary file storage, set this option to
ensure that users cannot create setuid files in /tmp 

چهار :

Description:

the noexec mount option specifies that the filesystem cannot contain executable binaries

Rationale:

Since the /tmp filesystem is only intended for temporary file storage, set this option to

ensure that users cannot run executable binaries from /tmp


درقالب مثال حمله یا سناریو اگر توضیح داده بشه ممنون میشم

برای هر کدوم ازین چهار مورد

ممنون واقعا

پاسخ در 1401/09/29 توسط
1

سلام

ببین هکر ها خول دنبال مسیری می گردند که بتونن فایل اونجا upload کنن ولی خول سطح  دسترسی ها همیشه اجازه نمی ده کخ بتونن این کار رو کنن یعنی هکر ها دسترسی ندارن

یکی از مسیر هایی که برای همه یوزر ها به صورت پیش فرض دارای دسترسی خوبی هست هم write کردن و execute کردن در لینوکس مسیر /tmp هست .

خوب برای اینکه اگر هکری به دلیل وجود یک اسیب پذیری یه سرور لینوکسی دسترسی گرفت نتونه در مسیر /tmp فایل مخرب upload کنه و یا نتونه اون رو اجرا کنه این دسترسی ها رو اعمال می کنن

البته admin سرور لینوکس باید یک پارتیشن جداگانه برای /tmp در نظر بگیره و دسترسی های زیر رو از طریق فرایند mount کردن اعمال کنه که کسی اگر هم بر فرض دسترسی به سرور گرفت نتونه از /tmp استفاده کنه

nodev : یعنی هکر نمی تونه Device file ایجاد کنه این نوع فایل ها برای دسارسی گرفتن به device ها مثل printer و ... استفاده می شه

noexec: هکر نمی تونه فایل اجرایی خودشو اجرا کنه

nosuid :  هکر نمی تونه از دسترسی suid که برای اقزایش سطح دسترسی توسط هکر ها استفاده میشه استفاده کنه

پاسخ در 1401/09/29 توسط

پاسخ شما