• Valmond@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    9 days ago

    Question, if I can get free valud certs today (there atey sites that give you free ones, I use one for my lemmy site), where’s the security?

    I mean it’s secure against man in the middle, but if my site is hacked, no proof is going to prevent the hackers to distribute whatever they want.

    • Kazumara@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      6
      ·
      edit-2
      9 days ago

      Well it stands to reason, that TLS, i.e. Transport-Layer-Security, would secure the transport, and not secure the server providing the service against intrusion.

      Also how is your hypothetical related to cost of certificates? If you use an expensive certificate with in person validation of your organization and its ownership of the domain name (these types of certs exist), then how does that change the case where your site is hacked, compared to the free certificate?

      • Valmond@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        arrow-down
        1
        ·
        9 days ago

        I think there is a big misunderstanding here.

        My question is why shall I use a trusted certificate instead of rolling my own, if it wasn’t enforced (or st least made inconvenient) by google & co.

        Does their certs protect better in some way?

        • Kazumara@discuss.tchncs.de
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          9 days ago

          A certificate fundamentally only does the following, it binds a name and a public key together and attaches a signature to that binding.

          Anyone can make a certificate binding any key to any name and put their own signature on it, they just can’t fake others people’s signatures. This is also what you do if you self sign a certificate. If you then install the public key of your signing key in your webbrowser you can connect to your own services using your TLS key and your browser will check that the server presents the certificate with a matchign signature proving that it is using the right TLS key.

          You can also bind your TLS key to www.wikipedia.org and sign it. However nobody else knows your signing key, and thus nobody would trust the certificate you signed. Which is a good thing, because otherwise it would be easy for you to impersonate Wikipedia’s website.

          The value of trusted certificates lies in the established trust between the signers (CAs) and the software developers who make browsers etc. The signers will only sign certificates to bind names and TLS keys for the people who actually own the name, and not for third parties.

          The validation of ownership is the thing that varies a lot. The simple way is just checking for control of the web server currently reachable under a name, or checking for control of the DNS entries for a name, but the more complicated validations check business records etc.

          So when you’re asking do they protect better, it’s kind of difficult to say.

          • If you can validate the signature yourself, say you have control of the browser and the server, then your own signature is fine, and a trusted one wouldn’t be any better.
          • But if you want third parties, that don’t know you, to be able to verify that their TLS session is established to a person who actually owns the domain, rather than a man in the middle, then the only practical solution today is using that established trust system.
          • If you are asking about the encryption strength of the TLS session itself, then that’s completely independent of the certificate issue, because again the certificate only binds a name to a key with a signature. You can bind an old short key, whose private key has been leaked before to a name, or you can bind a modern long key that is freshly generated to the same name. You can used either key in a good or a bad cryptographic setup. You can use deprecated SSL 3.0 or modern TLS 1.3. Those choices don’t depend on who signs the certificate.

          I hope that helps, sorry for writing so much

          • Valmond@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            9 days ago

            Not at all, thank you for actually trying to answer my question instead of just telling me how it is supposed to work!

            Just quickly, no I didn’t wonder about the keys encryption strength, what I do wonder about is if it is overall more secure to use a “trusted” entity, than, if the browsers weren’t locked down, my own home-generated signature.

            I mean, if someone tries to “man in the middle”, or maskerade as my website, the trusted stuff will not add any security.

            If someone hacks my site, and then maskerades as me (or does their shenanigans) the trusted stuff doesn’t add any security there either. They can just use my installed all set up “Trusted tm” certificate until it expires (my home made cert will expire too BTW).

            So, for now, I don’t see any benefit to this except the trusted entity gets to have control over it all (and earn some money).

            I bet there are smarter people than me out there who knows why I’m wrong, hence all the noobie questions.

            Cheers!

            • Kazumara@discuss.tchncs.de
              link
              fedilink
              English
              arrow-up
              1
              ·
              edit-2
              9 days ago

              I mean, if someone tries to “man in the middle”, or maskerade as my website, the trusted stuff will not add any security.

              As long as they can obtain a certificate signed by a trusted signer for your name, you are correct. And you are touching on a real issue here. The number of trusted signers in the browser stores is large, and if only one can be tricked or compromised, then the MitM can generate a certificate your browser would trust just as well as your own original one.

              If someone hacks my site […]

              then it’s over anyway, yes. The signature on the certificate only validates your TLS key as being one that was properly assigned to the holder of your domain name. Once the endpoint is compromised, TLS doesn’t matter anymore.

              if the browsers weren’t locked down

              Actually maybe they aren’t as locked down as you think. To my knowledge you can add your own signing key certificates to your local installation of Firefox, Chrome and the Windows cert storage. In fact there are companies who do this a lot. They Man-in-the-Middle all their employees, with a proxy that does security scanning. For this reason they will deploy their signing keys internally. So the browsers still work. You can use these mechanisms for yourself if you like.

              Example documentation: https://support.mozilla.org/en-US/kb/setting-certificate-authorities-firefox

        • WhyJiffie@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          1
          ·
          9 days ago

          because if you roll your own root cert, nobody’s web browsers will see it as trusted, they all will warn the user that something weird is happening and treat the site as if it was plain HTTP. no lemmy server would federate with it for the same reason.

    • AwesomeLowlander@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      5
      ·
      9 days ago

      Certificates are to protect against MitM attacks, not prevent your site from getting hacked. You need to secure everything, this is one aspect of it

        • Give the caller my public key and on we go.

          And how does the client validate that your public key is actually your public key and not some attacker’s?

          The idea of having a trusted 3rd party is to ensure that some impartial and trustworthy arbiter can confirm to the client that yes, this certificate is trustworthy, because they issued it to the correct party.

          But you can absolutely self-sign a certificate. Works just fine, though not all clients accept self-signed certificates as trustworthy as anyone could have issued it.

          • Valmond@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            9 days ago

            Because they’ll use it and it’s I that verify by decrypting it with my private key? If someone makes him use a bad key then it just won’t work.

            • lud@lemm.ee
              link
              fedilink
              English
              arrow-up
              1
              ·
              9 days ago

              Sure, but the first time the other person would have to accept your self signed cert. There is no knowing that the cert presented the first time was actually from you and not someone else.

              • Valmond@lemmy.world
                link
                fedilink
                English
                arrow-up
                1
                ·
                9 days ago

                How would that matter?

                Say my website sends you my homemade cert, if you don’t use it you cant communicate with me (or go unsecure).

                Why myst some “trusted entity” emit tjose certificates? They are just a bunch of RSA keys!

                • lud@lemm.ee
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  edit-2
                  8 days ago

                  Because there is no difference from your homemade cert compared to anyone else’s homemade cert.

                  So if someone else claims to be your website and uses a similar homemade cert there is no way to know that the site isn’t yours.

            • How do they know you verified by decrypting?

              The client has to be able to verify. They can’t trust your result. Imagine a man-in-the-middle attack; if someone intercepted all traffic between you and the client, including the cert exchange, how would either party figure out that traffic was being intercepted?

              Client connects to website, but gets intercepted. Attacker provides own self-signed certificate to client. Client asks you to verify the certificate, but attacker can intercept that too and just reply the certificate is “totes cool bro just trust me”. You are none the wiser either, because the attacker can just decrypt client traffic and pretend they are the client by re-encrypting the data themselves.

              With a Certificate Authority, the client can take the received cert and ask the CA “did you sign this?”. The CA will then tell you they didn’t, exposing the attacker’s fake cert. This works, because the CA is already a trusted entity. That trust is being extended to your website’s certificate validity and thus the website identity.

              • Valmond@lemmy.world
                link
                fedilink
                English
                arrow-up
                1
                ·
                9 days ago

                I see where you’re getting at, or so I think:

                A malevolent user takes over my website and installs his non-authorised certificate => danger!

                But I mean he can use my certificate, it’s already there, installed and set up to work?

                • If he fully takes over your website there’s nothing you can do as a client to detect it. But that’s not the point of the certificate. The certificate is there to ensure you are communicating with the website/server you think you’re communicating with.

                  It ensures your communication is safe. In my example, the attacker doesn’t take over your website, he takes over some part of the network infrastructure between your website and the client, thus intercepting all the traffic. There’s a “man in the middle”, e.g. the website is safe, the client is safe, but the communication between them is not. The certificate ensures nobody is impersonating the website by intercepting all the traffic, ensuring the communication.

                  If the website does get compromised, the CA has the option to invalidate the certificate at your request, via some verification procedure. Thus it also defends against compromised servers, though it’s not the primary purpose for which they exist.

                  • Valmond@lemmy.world
                    link
                    fedilink
                    English
                    arrow-up
                    1
                    ·
                    9 days ago

                    Okay, but (if the big ones didn’t enforce it) a home made cert would also stop a man in the middle attack.

                    And if I figure it’s compromised, I just deal with it through my hoster or on my home-lab server.

                    I just don’t see why it should be a “trusted” entity in there at all. I know today it is how it works but I feel we could and should do away with it (in magic wonderland I guess :-)

        • towerful@programming.dev
          link
          fedilink
          English
          arrow-up
          5
          ·
          9 days ago

          You can distribute your public key, and have people manually add it to their trust stores.
          But OSs and browsers ship with preloaded trusted certificates. This way, the owner of a preloaded trusted certificate can issue new certificates that are automatically trusted by people’s OSs and browsers.
          To become a preloaded trusted certificate owner, I imagine that there are stringent audits and security requirements. Part of that will be verifying the identity of the requester before issuing them a certificate.

          With LetsEncrypt, they either need to talk to a server hosted at the domain to retrieve a token (generated when the request is initiated).
          This proves the requester owns/controls the domain and the server (the requester has correctly set up DNS records, and placed the required token on the server). This is HTTP challenge mode.
          The other method is by a DNS challenge. The requester adds a TXT record to their nameservers with the token value, letsencrypt then inspects the DNS records for the domain and will issue a cert when it sees the token. This proves the requester owns/controls the domain.

          So, proving identity is required (otherwise anyone could generate a trusted cert for any domain). And trusted certificate issuers are required, so people don’t have to constantly import (possibly dodgy) public keys

        • Gremour@lemmy.world
          link
          fedilink
          English
          arrow-up
          4
          ·
          9 days ago

          You can make your own cert. To make sure your cert belongs to you (your site) it is signed by authority and the client then may verify that authority (which cetificate is preinstalled in their system) in fact had verified ownership of your site and then signed your cert claims with their private key.

    • AHemlocksLie@lemmy.zip
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 days ago

      The security of these certificates only guarantees that you’re talking to the right server and that your communication is encrypted. For other concerns like of the server was hacked, you’ll need something else. No individual piece of security tech can secure everything. You as the site admin can only use it as one piece of a comprehensive security package that defends against what you perceive as the most credible threats.

      Asking where’s the security is like asking where’s the protection with a bullet proof vest if you can still get shot in the head. A vest offers one type of protection, but a comprehensive security package is going to include other pieces like helmets.