ENع
→Cloud security
الدرس 15 · الأنظمة الآمنة

Cloud security

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

12 دقيقة11 خطوة5 أسئلةIntermediate
عن هذا الدرس

In the cloud, security is shared: the provider secures the buildings, hardware and its own software, and you secure your data, your accounts and every setting. The most common cloud weakness is simply a wrong setting. Follow one storage bucket of customer invoices that starts public, unencrypted and unlogged, write the safe settings down as a six-line Python check, and fix the bucket one setting at a time until the check finds nothing wrong.

ستتعلّم

حدّد ما تشعر بأنك أتقنته. هذا التقييم الذاتي لا يؤثر في درجة الدرس.

شكل 15 · تفاعلي
01 / 11

What the cloud is

Cloud computing means renting computers and storage from a provider and using them over the internet. Our example: a small shop's app saves customer invoices in a storage bucket, a place for files in the provider's data centre.

cloud computing   rented computers, storage and
                  software, used over the internet
NIST SP 800-145   "on-demand network access to a
                  shared pool of configurable
                  computing resources"
here              the shop's app → a storage bucket
                  of customer invoices
جارٍ تحميل الرسم…
أو ← →
اقرأ الدرس خطوة بخطوة
  1. What the cloud is

    Cloud computing means renting computers and storage from a provider and using them over the internet. Our example: a small shop's app saves customer invoices in a storage bucket, a place for files in the provider's data centre.

    cloud computing   rented computers, storage and
                      software, used over the internet
    NIST SP 800-145   "on-demand network access to a
                      shared pool of configurable
                      computing resources"
    here              the shop's app → a storage bucket
                      of customer invoices
  2. Security is shared

    Security in the cloud is shared. The provider secures the buildings, the hardware and the cloud's own software. The customer secures what they put in and how they set it up: their app, the data in the bucket, who may use it, and every setting.

    shared responsibility
      provider    buildings, hardware, network,
                  the cloud's own software
      customer    the data, the accounts and who
                  may use what, every setting
    the split moves with the service you rent,
    but your data is always your job
  3. One wrong setting

    The most common cloud weakness is a misconfiguration: a setting left wrong. This bucket has three. It is public, so anyone can read it. Its files are not encrypted. And logging is off, so nobody records who reads them.

    misconfiguration   a setting left wrong
                       (OWASP Top 10: A05)
    bucket settings    now      safe
      public           True     False
      encrypted        False    True
      logging          False    True
  4. Public means anyone

    Public means no sign-in is needed. Anyone who finds the bucket's address can download every invoice, without breaking anything. The data leaks, a loss of confidentiality, because of one wrong setting, not clever hacking.

    public = True    no sign-in needed to read
    who can read     anyone who finds the address
    what leaks       every invoice in the bucket
    harmed           confidentiality
    the cause        a setting, not a break-in
  5. Write the safe settings down

    Clicking through settings by hand is easy to get wrong. Instead, write the safe values down as code. SAFE is a Python dictionary: public must be False, encrypted True and logging True.

    SAFE = {"public": False,
            "encrypted": True,
            "logging": True}
    
    dictionary   setting name → the safe value
    one place    the same rule for every bucket,
                 reviewed like any other code
  6. Let code check the settings

    problems(cfg) goes through SAFE and keeps each setting whose value is different. For our bucket it returns all three names, so the lamp shows 0: not safe. Checking settings with code like this is called policy as code.

    >>> bucket = {"public": True,
    ...           "encrypted": False,
    ...           "logging": False}
    >>> problems(bucket)
    ['public', 'encrypted', 'logging']
    
    lamp   0   (the list is not empty)
  7. Fix 1: block public access

    Fix one: turn public off. Now every read of the bucket must come from a signed-in identity with permission, like the shop's app. The same download from the internet is refused. problems() now returns two names.

    bucket["public"] = False
    from the internet   refused (no sign-in)
    the shop's app      signed in, allowed
    >>> problems(bucket)
    ['encrypted', 'logging']
  8. Fix 2: encrypt at rest

    Fix two: turn on encryption at rest. The files are stored scrambled, and only allowed callers get them unscrambled, with a key the provider's key service guards. A copied disk or file is useless without the key.

    bucket["encrypted"] = True
    at rest       files stored scrambled
    the key       kept in the key service,
                  used only for allowed callers
    >>> problems(bucket)
    ['logging']
  9. Fix 3: turn on logging

    Fix three: turn on logging. Every read of the bucket, even the app's, is now recorded: who, what and when. Logs block nothing, but they let you spot strange reads and investigate later. That is NIST's Detect function.

    bucket["logging"] = True
    each read →  a log entry
                 who · what · when
    logs do not block; they let you
    notice, investigate and prove
    (NIST CSF 2.0: Detect)
  10. Check again, and keep checking

    Run problems() again: it returns an empty list, and the lamp shows 1. Run the check on every change and on a schedule too, because settings drift: someone may switch one back for a quick test.

    >>> problems(bucket)
    []
    lamp   1   (no problems)
    
    run it   on every change, before it ships
             and on a schedule (settings drift)
  11. Cloud security in four habits

    Cloud security in four habits: know your side of the shared responsibility and the provider's, keep buckets private by default, encrypt and log them, and check every setting with code. One wrong setting should never be enough to leak data.

    1  know your side       provider vs customer
    2  private by default   no public data
    3  encrypt and log      at rest; every read
    4  check with code      every change, and
                            on a schedule

اختبار يتاح بعد الخطوة الأخيرة.