You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "zwoop (via GitHub)" <gi...@apache.org> on 2025/07/15 14:47:04 UTC

[PR] Adds a %{CERT} and %{CLIENT-CERT} cond [trafficserver]

zwoop opened a new pull request, #12363:
URL: https://github.com/apache/trafficserver/pull/12363

   NOTE (yes you Brian):
   
   I'm working on refactoring some attests, starting with header_rewrite tests, and I will add tests for the certificates as part of that refactoring.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "serrislew (via GitHub)" <gi...@apache.org>.
serrislew commented on code in PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#discussion_r2210810132


##########
doc/admin-guide/plugins/header_rewrite.en.rst:
##########
@@ -496,6 +496,42 @@ As a special matcher, the inbound IP addresses can be matched against a list of
     and the configuration parser will error out. The format here is very specific, in particular no
     white spaces are allowed between the ranges.
 
+If |ATS| is built with :ref:`Cripts <developer-guide-cripts>` support, a number of additional
+qualifiers are available exclusively on TLS sessions, for X509 certificate introspection.
+The client certificate (for mutual TLS) is accessed qith qualifier prefix of ``CLIENT-CERT:``
+and the server certificate with a prefix qualifier of ``SERVER-CERT:``. The X509 naming of the
+specific fields are the same for the two certificates::
+
+   PEM              The PEM-encoded certificate, as a string.
+   SIG              The signature of the certificate.
+   SUBJECT          The subject of the certificate.
+   ISSUER           The issuer of the certificate.
+   SERIAL           The serial number of the certificate.
+   NOT_BEFORE       The date and time when the certificate becomes valid.
+   NOT_AFTER        The date and time when the certificate expires.
+   VERSION          The version of the certificate.
+   SAN:DNS          The Subject Alternative Name (SAN) DNS entries.
+   SAN:IP           The Subject Alternative Name (SAN) IP addresses.
+   SAN:EMAIL        The Subject Alternative Name (SAN) email addresses.
+   SAN:URI          The Subject Alternative Name (SAN) URIs.
+
+These conditions and qualifiers can be used in conditions of course, but more importantly,
+are also very useful when adding or modifying headers. For example, you can add some
+client certificate and server subject to the response headers, so that the client can see it
+as part of the response ::
+
+    cond %{SEND_RESPONSE_HDR_HOOK} [AND]
+    cond %{INBOUND:TLS} ="" [NOT]
+      set-header X-Client-Cert "%{INBOUND:CLIENT-CERT:PEM}"
+      set-header X-Client-Cert-Subject "%{INBOUND:CLIENT-CERT:SUBJECT}"
+      set-header X-Client-Cert-Issuer "%{INBOUND:CLIENT-CERT:ISSUER}"
+      set-header X-Server-Cert-Subject "%{INBOUND:SERVER-CERT:SUBJECT}""
+
+The ``SAN:`` fields will return a semicolon-separated list of the respective
+values, there can be zero, one or many of each SAN type. Example:
+
+    cond %{CLIENT-CERT:SAN:DNS} /example\.com/

Review Comment:
   `%{INBOUND:CLIENT-CERT:SAN:DNS}`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#issuecomment-3104457271

   I missed the reference to the secondary certs RFC... Maybe this should be another qualifier, like
   
   ```
   %{INBOUND:SECONDARY-CERT:#: ...}
   ```
   
   with the # being required. We'd also need to have some sort of "counter" for this I think (as a new condition qualifier)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#discussion_r2216880671


##########
doc/admin-guide/plugins/header_rewrite.en.rst:
##########
@@ -496,6 +496,42 @@ As a special matcher, the inbound IP addresses can be matched against a list of
     and the configuration parser will error out. The format here is very specific, in particular no
     white spaces are allowed between the ranges.
 
+If |ATS| is built with :ref:`Cripts <developer-guide-cripts>` support, a number of additional
+qualifiers are available exclusively on TLS sessions, for X509 certificate introspection.
+The client certificate (for mutual TLS) is accessed qith qualifier prefix of ``CLIENT-CERT:``

Review Comment:
   `qith`



##########
doc/admin-guide/plugins/header_rewrite.en.rst:
##########
@@ -496,6 +496,42 @@ As a special matcher, the inbound IP addresses can be matched against a list of
     and the configuration parser will error out. The format here is very specific, in particular no
     white spaces are allowed between the ranges.
 
+If |ATS| is built with :ref:`Cripts <developer-guide-cripts>` support, a number of additional
+qualifiers are available exclusively on TLS sessions, for X509 certificate introspection.
+The client certificate (for mutual TLS) is accessed qith qualifier prefix of ``CLIENT-CERT:``
+and the server certificate with a prefix qualifier of ``SERVER-CERT:``. The X509 naming of the
+specific fields are the same for the two certificates::
+
+   PEM              The PEM-encoded certificate, as a string.
+   SIG              The signature of the certificate.
+   SUBJECT          The subject of the certificate.
+   ISSUER           The issuer of the certificate.
+   SERIAL           The serial number of the certificate.
+   NOT_BEFORE       The date and time when the certificate becomes valid.
+   NOT_AFTER        The date and time when the certificate expires.
+   VERSION          The version of the certificate.
+   SAN:DNS          The Subject Alternative Name (SAN) DNS entries.
+   SAN:IP           The Subject Alternative Name (SAN) IP addresses.
+   SAN:EMAIL        The Subject Alternative Name (SAN) email addresses.
+   SAN:URI          The Subject Alternative Name (SAN) URIs.
+
+These conditions and qualifiers can be used in conditions of course, but more importantly,
+are also very useful when adding or modifying headers. For example, you can add some
+client certificate and server subject to the response headers, so that the client can see it
+as part of the response ::
+
+    cond %{SEND_RESPONSE_HDR_HOOK} [AND]
+    cond %{INBOUND:TLS} ="" [NOT]
+      set-header X-Client-Cert "%{INBOUND:CLIENT-CERT:PEM}"
+      set-header X-Client-Cert-Subject "%{INBOUND:CLIENT-CERT:SUBJECT}"
+      set-header X-Client-Cert-Issuer "%{INBOUND:CLIENT-CERT:ISSUER}"
+      set-header X-Server-Cert-Subject "%{INBOUND:SERVER-CERT:SUBJECT}""
+
+The ``SAN:`` fields will return a semicolon-separated list of the respective
+values, there can be zero, one or many of each SAN type. Example:

Review Comment:
   Two colons needed at the end, `Example::`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop merged PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds a %{CERT} and %{CLIENT-CERT} cond [trafficserver]

Posted by "serrislew (via GitHub)" <gi...@apache.org>.
serrislew commented on code in PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#discussion_r2208041384


##########
plugins/header_rewrite/resources.cc:
##########
@@ -126,6 +132,32 @@ Resources::gather(const ResourceIDs ids, TSHttpHookID hook)
     break;
   }
 
+  // The following is all the new infrastructure borrowed / reused from
+  // the Cripts library.
+#if TS_HAS_CRIPTS
+  if (ids & (RSRC_CLIENT_CONNECTION | RSRC_MTLS_CERTIFICATE | RSRC_SERVER_CERTIFICATE)) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Client::Connection");
+    client_conn = new cripts::Client::Connection();
+    client_conn->set_state(&state);
+  }
+
+  if (ids & RSRC_SERVER_CONNECTION) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Server::Connection");
+    server_conn = new cripts::Server::Connection();
+    server_conn->set_state(&state);
+  }
+
+  if (ids & RSRC_MTLS_CERTIFICATE) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Certs::Client");
+    mtls_cert = new cripts::Certs::Client(*client_conn);
+  }
+
+  if (ids & RSRC_SERVER_CERTIFICATE) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Certs::Server");
+    server_cert = new cripts::Certs::Server(*client_conn);

Review Comment:
   shouldn't this be `server_conn`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "maskit (via GitHub)" <gi...@apache.org>.
maskit commented on PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#issuecomment-3103615643

   > `%{OUTBOUND-SERVER-CERT:1:CN}`
   with the omission of the index be an implicit "0".
   
   So the second field may or may not be an index number. I can live with it but it sounds like the parser is going to be a bit complicated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "maskit (via GitHub)" <gi...@apache.org>.
maskit commented on PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#issuecomment-3079559658

   I wonder what would be a way to read [additional certificates](https://www.ietf.org/archive/id/draft-ietf-httpbis-secondary-server-certs-01.html). `%{OUTBOUND:SERVER-CERT[1]}` ? It's not supported by even ATS core but it may be worth considering to avoid ugly syntax.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on code in PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#discussion_r2221943192


##########
doc/admin-guide/plugins/header_rewrite.en.rst:
##########
@@ -496,6 +496,42 @@ As a special matcher, the inbound IP addresses can be matched against a list of
     and the configuration parser will error out. The format here is very specific, in particular no
     white spaces are allowed between the ranges.
 
+If |ATS| is built with :ref:`Cripts <developer-guide-cripts>` support, a number of additional
+qualifiers are available exclusively on TLS sessions, for X509 certificate introspection.
+The client certificate (for mutual TLS) is accessed qith qualifier prefix of ``CLIENT-CERT:``

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#issuecomment-3104128484

   [approve ci autest]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds a %{CERT} and %{CLIENT-CERT} cond [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on code in PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#discussion_r2208250742


##########
plugins/header_rewrite/value.cc:
##########
@@ -55,6 +55,7 @@ Value::set_value(const std::string &val)
 
           if (parser.parse_line(_value)) {
             tcond_val->initialize(parser);
+            require_resources(tcond_val->get_resource_ids());

Review Comment:
   > why does Value need the resource ids? doesn't this get defined when initialize() is called
   
   So this is actually a bug in the original header_rewrite code. When you use a condition as a value, it didn't use to update the required resources properly. This mostly worked ok for regular cases, but with new resource values, it would fail. And yes, the resources are set in the initializations, but was never propagated from the "value" back to the operator (e.g. set-header):
   
   The use case here are things like
   
   ```
      set-header X-Cert "%{CERT:SUBBJECT"}
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#issuecomment-3621059290

   10.1.x cherry-pick in: #12738


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on code in PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#discussion_r2221944809


##########
doc/admin-guide/plugins/header_rewrite.en.rst:
##########
@@ -496,6 +496,42 @@ As a special matcher, the inbound IP addresses can be matched against a list of
     and the configuration parser will error out. The format here is very specific, in particular no
     white spaces are allowed between the ranges.
 
+If |ATS| is built with :ref:`Cripts <developer-guide-cripts>` support, a number of additional
+qualifiers are available exclusively on TLS sessions, for X509 certificate introspection.
+The client certificate (for mutual TLS) is accessed qith qualifier prefix of ``CLIENT-CERT:``
+and the server certificate with a prefix qualifier of ``SERVER-CERT:``. The X509 naming of the
+specific fields are the same for the two certificates::
+
+   PEM              The PEM-encoded certificate, as a string.
+   SIG              The signature of the certificate.
+   SUBJECT          The subject of the certificate.
+   ISSUER           The issuer of the certificate.
+   SERIAL           The serial number of the certificate.
+   NOT_BEFORE       The date and time when the certificate becomes valid.
+   NOT_AFTER        The date and time when the certificate expires.
+   VERSION          The version of the certificate.
+   SAN:DNS          The Subject Alternative Name (SAN) DNS entries.
+   SAN:IP           The Subject Alternative Name (SAN) IP addresses.
+   SAN:EMAIL        The Subject Alternative Name (SAN) email addresses.
+   SAN:URI          The Subject Alternative Name (SAN) URIs.
+
+These conditions and qualifiers can be used in conditions of course, but more importantly,
+are also very useful when adding or modifying headers. For example, you can add some
+client certificate and server subject to the response headers, so that the client can see it
+as part of the response ::
+
+    cond %{SEND_RESPONSE_HDR_HOOK} [AND]
+    cond %{INBOUND:TLS} ="" [NOT]
+      set-header X-Client-Cert "%{INBOUND:CLIENT-CERT:PEM}"
+      set-header X-Client-Cert-Subject "%{INBOUND:CLIENT-CERT:SUBJECT}"
+      set-header X-Client-Cert-Issuer "%{INBOUND:CLIENT-CERT:ISSUER}"
+      set-header X-Server-Cert-Subject "%{INBOUND:SERVER-CERT:SUBJECT}""
+
+The ``SAN:`` fields will return a semicolon-separated list of the respective
+values, there can be zero, one or many of each SAN type. Example:

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on code in PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#discussion_r2208831779


##########
plugins/header_rewrite/value.cc:
##########
@@ -55,6 +55,7 @@ Value::set_value(const std::string &val)
 
           if (parser.parse_line(_value)) {
             tcond_val->initialize(parser);
+            require_resources(tcond_val->get_resource_ids());

Review Comment:
   Ok, as discussed on slack, I've made the code cleanup to make this less confusing. There's no difference in behavior, just more clear as to why we have to update the owners resource requirements.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds a %{CERT} and %{CLIENT-CERT} cond [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#issuecomment-3074906108

   [approve ci autest 2]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds a %{CERT} and %{CLIENT-CERT} cond [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on code in PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#discussion_r2208240116


##########
plugins/header_rewrite/resources.cc:
##########
@@ -126,6 +132,32 @@ Resources::gather(const ResourceIDs ids, TSHttpHookID hook)
     break;
   }
 
+  // The following is all the new infrastructure borrowed / reused from
+  // the Cripts library.
+#if TS_HAS_CRIPTS
+  if (ids & (RSRC_CLIENT_CONNECTION | RSRC_MTLS_CERTIFICATE | RSRC_SERVER_CERTIFICATE)) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Client::Connection");
+    client_conn = new cripts::Client::Connection();
+    client_conn->set_state(&state);
+  }
+
+  if (ids & RSRC_SERVER_CONNECTION) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Server::Connection");
+    server_conn = new cripts::Server::Connection();
+    server_conn->set_state(&state);
+  }
+
+  if (ids & RSRC_MTLS_CERTIFICATE) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Certs::Client");
+    mtls_cert = new cripts::Certs::Client(*client_conn);
+  }
+
+  if (ids & RSRC_SERVER_CERTIFICATE) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Certs::Server");
+    server_cert = new cripts::Certs::Server(*client_conn);

Review Comment:
   > shouldn't this be `server_conn`?
   
   No, it is confusing, but this says "get the server certificate used for the TLS handshake on the clients connection into ATS".



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#issuecomment-3101922764

   > I wonder what would be a way to read [additional certificates](https://www.ietf.org/archive/id/draft-ietf-httpbis-secondary-server-certs-01.html). `%{OUTBOUND:SERVER-CERT[1]}` ? It's not supported by even ATS core but it may be worth considering to avoid ugly syntax.
   
   I think the "syntax" for this would likely have to be nested :'s, if / when we want to support this. E.g.
   
   ```
   %{OUTBOUND-SERVER-CERT:1:CN}
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#issuecomment-3103034675

   [approve ci autest 2]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "maskit (via GitHub)" <gi...@apache.org>.
maskit commented on PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#issuecomment-3190029747

   > ```
   > %{INBOUND:SECONDARY-CERT:#: ...}
   > ```
   
   This looks fine, and I don't think it needs to be implemented now. Since it's going to be another qualifier we should be able to add it anytime later. I just wanted to make sure that we won't need to make incompatible changes or introduce a hacky syntax.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HRW: Adds %{INBOUND:SERVER-CERT} and %{INBOUND:CLIENT-CERT} conds [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#issuecomment-3189976166

   @maskit  What should we do here? Land it as is, and fix secondary certs later?  Or try to fix it now (but openssl / ats doesn't support secondary certs I think?)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds a %{CERT} and %{CLIENT-CERT} cond [trafficserver]

Posted by "serrislew (via GitHub)" <gi...@apache.org>.
serrislew commented on code in PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#discussion_r2208098044


##########
plugins/header_rewrite/value.cc:
##########
@@ -55,6 +55,7 @@ Value::set_value(const std::string &val)
 
           if (parser.parse_line(_value)) {
             tcond_val->initialize(parser);
+            require_resources(tcond_val->get_resource_ids());

Review Comment:
   why does Value need the resource ids? doesn't this get defined when initialize() is called



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adds a %{CERT} and %{CLIENT-CERT} cond [trafficserver]

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on code in PR #12363:
URL: https://github.com/apache/trafficserver/pull/12363#discussion_r2208243354


##########
plugins/header_rewrite/resources.cc:
##########
@@ -126,6 +132,32 @@ Resources::gather(const ResourceIDs ids, TSHttpHookID hook)
     break;
   }
 
+  // The following is all the new infrastructure borrowed / reused from
+  // the Cripts library.
+#if TS_HAS_CRIPTS
+  if (ids & (RSRC_CLIENT_CONNECTION | RSRC_MTLS_CERTIFICATE | RSRC_SERVER_CERTIFICATE)) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Client::Connection");
+    client_conn = new cripts::Client::Connection();
+    client_conn->set_state(&state);
+  }
+
+  if (ids & RSRC_SERVER_CONNECTION) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Server::Connection");
+    server_conn = new cripts::Server::Connection();
+    server_conn->set_state(&state);
+  }
+
+  if (ids & RSRC_MTLS_CERTIFICATE) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Certs::Client");
+    mtls_cert = new cripts::Certs::Client(*client_conn);
+  }
+
+  if (ids & RSRC_SERVER_CERTIFICATE) {
+    Dbg(pi_dbg_ctl, "\tAdding Cripts Certs::Server");
+    server_cert = new cripts::Certs::Server(*client_conn);

Review Comment:
   What gets complicated is that there are 4 possible certificates, that Cripts support. On the inbound connection it can get the client certificate and the server certificate (that's on client_conn), and on the outbound connection it can get same (at which point the server certificate is the certificate on the upstream TLS connection / server).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org