Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    BM 6 - Deploy Configuration file with a lot of special characters

    Scheduled Pinned Locked Moved Support
    buildmaster
    3 Posts 2 Posters 6 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      philippe.camelio_3885
      last edited by

      Hello

      I am using BM to deploy HAProxy config and I need some help to add the following rules in a configuration file:

      # ACL LOG4J  https://www.haproxy.com/blog/december-2021-log4shell-mitigation/
         option http-buffer-request
         acl log4shell url,url_dec -m reg \${[^}]*\${
         acl log4shell url,url_dec -m reg \${jndi:(?:ldaps?|iiop|dns|rmi)://
         acl log4shell url,url_dec -i -m reg \${[\w${}\-:]*j[\w${}\-:]*n[\w${}\-:]*d[\w${}\-:]*i[\w${}\-:]*:.*}
         acl log4shell req.hdrs -m reg \${[^}]*\${
         acl log4shell req.hdrs -m reg \${jndi:(?:ldaps?|iiop|dns|rmi)://
         acl log4shell req.hdrs -i -m reg \${[\w${}\-:]*j[\w${}\-:]*n[\w${}\-:]*d[\w${}\-:]*i[\w${}\-:]*:.*}
         acl log4shell_form req.body,url_dec -m reg \${[^}]*\${
         acl log4shell_form req.body,url_dec -m reg \${jndi:(?:ldaps?|iiop|dns|rmi)://
         acl log4shell_form req.body,url_dec -i -m reg \${[\w${}\-:]*j[\w${}\-:]*n[\w${}\-:]*d[\w${}\-:]*i[\w${}\-:]*:.*}
         http-request deny if log4shell
         http-request deny if { req.fhdr(content-type) -m str application/x-www-form-urlencoded } log4shell_form
         
      

      Special characters break the deployment
      I tried to add ` in front of $ unsuccessfully

      Best regards
      Philippe C.

      1 Reply Last reply Reply Quote 0
      • rhessingerR Offline
        rhessinger inedo-engineer
        last edited by

        Hi @philippe-camelio_3885,

        In my experience you should only need to add ` in front of all the $ and that should work. Can you give this version a try?

        # ACL LOG4J  https://www.haproxy.com/blog/december-2021-log4shell-mitigation/
           option http-buffer-request
           acl log4shell url,url_dec -m reg \`${[^}]*\`${
           acl log4shell url,url_dec -m reg \`${jndi:(?:ldaps?|iiop|dns|rmi)://
           acl log4shell url,url_dec -i -m reg \`${[\w`${}\-:]*j[\w`${}\-:]*n[\w`${}\-:]*d[\w`${}\-:]*i[\w`${}\-:]*:.*}
           acl log4shell req.hdrs -m reg \`${[^}]*\`${
           acl log4shell req.hdrs -m reg \`${jndi:(?:ldaps?|iiop|dns|rmi)://
           acl log4shell req.hdrs -i -m reg \`${[\w`${}\-:]*j[\w`${}\-:]*n[\w`${}\-:]*d[\w`${}\-:]*i[\w`${}\-:]*:.*}
           acl log4shell_form req.body,url_dec -m reg \`${[^}]*\`${
           acl log4shell_form req.body,url_dec -m reg \`${jndi:(?:ldaps?|iiop|dns|rmi)://
           acl log4shell_form req.body,url_dec -i -m reg \`${[\w`${}\-:]*j[\w`${}\-:]*n[\w`${}\-:]*d[\w`${}\-:]*i[\w`${}\-:]*:.*}
           http-request deny if log4shell
           http-request deny if { req.fhdr(content-type) -m str application/x-www-form-urlencoded } log4shell_form
        

        Thanks,
        Rich

        Products Engineer, Inedo

        1 Reply Last reply Reply Quote 0
        • P Offline
          philippe.camelio_3885
          last edited by

          Thanks you Rich
          it is working !.

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post
          Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation