Automation in the context of multifactor authentication: Difference between revisions

Jump to navigation Jump to search
Marked this version for translation
No edit summary
(Marked this version for translation)
Line 2: Line 2:
<translate>
<translate>


<!--T:1-->
Automated workflows which connect to the clusters without a human being present can not make use of a second factor. We are therefore deploying dedicated login nodes to be used for that purpose. These nodes will not require the use of a second factor, but will be otherwise much more limited than regular login nodes in terms of the type of authentication they accept and the type of action that they can be used to perform.  
Automated workflows which connect to the clusters without a human being present can not make use of a second factor. We are therefore deploying dedicated login nodes to be used for that purpose. These nodes will not require the use of a second factor, but will be otherwise much more limited than regular login nodes in terms of the type of authentication they accept and the type of action that they can be used to perform.  


= Increased security restrictions =
= Increased security restrictions = <!--T:2-->
== Available only by request ==
== Available only by request ==
Users who need to make use of automated workflows for their research must first contact our [[Technical support]] to be allowed to use these nodes. When contacting us, please explain in detail the type of automation you intend to use as part of your workflow. Tell us what commands will be executed and what tools or libraries you will be using to manage the automation.
Users who need to make use of automated workflows for their research must first contact our [[Technical support]] to be allowed to use these nodes. When contacting us, please explain in detail the type of automation you intend to use as part of your workflow. Tell us what commands will be executed and what tools or libraries you will be using to manage the automation.


== Available only through restricted SSH keys ==
== Available only through restricted SSH keys == <!--T:3-->
The only accepted means of authentication for the automation nodes will be through [[SSH_Keys#Using_CCDB|SSH keys uploaded to the CCDB]]. SSH keys written in your <tt>.ssh/authorized_keys</tt> file are not accepted. In addition, the SSH keys <b>must</b> obey the following constraints.   
The only accepted means of authentication for the automation nodes will be through [[SSH_Keys#Using_CCDB|SSH keys uploaded to the CCDB]]. SSH keys written in your <tt>.ssh/authorized_keys</tt> file are not accepted. In addition, the SSH keys <b>must</b> obey the following constraints.   


=== <tt>restrict</tt> constraint ===
=== <tt>restrict</tt> constraint === <!--T:4-->
This constraint disables port forwarding, agent forwarding, and X11 forwarding. It also disables the pseudo teletype (PTY), blocking most interactive workload. This constraint is required because these automation nodes are not intended to be used to start long-running or interactive processes. Regular login nodes must be used for this.  
This constraint disables port forwarding, agent forwarding, and X11 forwarding. It also disables the pseudo teletype (PTY), blocking most interactive workload. This constraint is required because these automation nodes are not intended to be used to start long-running or interactive processes. Regular login nodes must be used for this.  


=== <tt>from="pattern-list"</tt> constraint ===
=== <tt>from="pattern-list"</tt> constraint === <!--T:5-->
The <tt>from="pattern-list"</tt> constraint specifies that this key can only be used from IP addresses that match the patterns. This is to ensure that this key is not used from computers other than the ones intended. The pattern list must include only IP addresses that fully specify at least the network class, the network, and the subnet, which are the first 3 sections of an IP address. For example, <tt>192.168.*.*</tt> would not be accepted, but <tt>192.168.1.*</tt> would be accepted.  
The <tt>from="pattern-list"</tt> constraint specifies that this key can only be used from IP addresses that match the patterns. This is to ensure that this key is not used from computers other than the ones intended. The pattern list must include only IP addresses that fully specify at least the network class, the network, and the subnet, which are the first 3 sections of an IP address. For example, <tt>192.168.*.*</tt> would not be accepted, but <tt>192.168.1.*</tt> would be accepted.  


=== <tt>command="COMMAND"</tt> constraint ===
=== <tt>command="COMMAND"</tt> constraint === <!--T:6-->
The <tt>command="COMMAND"</tt> constraint forces the command <tt>COMMAND</tt> to be executed when the connection is established. This is so that you may restrict which commands can be used with this key.  
The <tt>command="COMMAND"</tt> constraint forces the command <tt>COMMAND</tt> to be executed when the connection is established. This is so that you may restrict which commands can be used with this key.  


== Convenience wrapper scripts to use for <tt>command=</tt> ==
== Convenience wrapper scripts to use for <tt>command=</tt> == <!--T:7-->
<tt>command</tt> constraints can specify any command, but they are most useful when using a wrapper script which will accept or reject commands based what command is being called. You can write your own script, but for convenience, we provide a number of such scripts which will allow common actions. These scripts are defined in [https://github.com/ComputeCanada/software-stack-custom/tree/main/bin/computecanada/allowed_commands this git repository].
<tt>command</tt> constraints can specify any command, but they are most useful when using a wrapper script which will accept or reject commands based what command is being called. You can write your own script, but for convenience, we provide a number of such scripts which will allow common actions. These scripts are defined in [https://github.com/ComputeCanada/software-stack-custom/tree/main/bin/computecanada/allowed_commands this git repository].


<!--T:8-->
* <tt>/cvmfs/soft.computecanada.ca/custom/bin/computecanada/allowed_commands/transfer_commands.sh</tt> will allow only file transfers, such as <tt>scp</tt>, <tt>sftp</tt> or <tt>rsync</tt>.
* <tt>/cvmfs/soft.computecanada.ca/custom/bin/computecanada/allowed_commands/transfer_commands.sh</tt> will allow only file transfers, such as <tt>scp</tt>, <tt>sftp</tt> or <tt>rsync</tt>.
* <tt>/cvmfs/soft.computecanada.ca/custom/bin/computecanada/allowed_commands/archiving_commands.sh</tt> will allow commands to archive files, such as <tt>gzip</tt>, <tt>tar</tt> or <tt>dar</tt>.
* <tt>/cvmfs/soft.computecanada.ca/custom/bin/computecanada/allowed_commands/archiving_commands.sh</tt> will allow commands to archive files, such as <tt>gzip</tt>, <tt>tar</tt> or <tt>dar</tt>.
Line 30: Line 32:
* <tt>/cvmfs/soft.computecanada.ca/custom/bin/computecanada/allowed_commands/allowed_commands.sh</tt> will allow all of the above.
* <tt>/cvmfs/soft.computecanada.ca/custom/bin/computecanada/allowed_commands/allowed_commands.sh</tt> will allow all of the above.


== Examples of accepted SSH keys ==
== Examples of accepted SSH keys == <!--T:9-->
Accepted SSH keys must include all 3 of the above constraints to be accepted. Here are examples of SSH keys that would be accepted:  
Accepted SSH keys must include all 3 of the above constraints to be accepted. Here are examples of SSH keys that would be accepted:  
For example, the following key would be accepted, and could only be used for transferring files (through <tt>scp</tt>, <tt>sftp</tt> or <tt>rsync</tt> for example):  
For example, the following key would be accepted, and could only be used for transferring files (through <tt>scp</tt>, <tt>sftp</tt> or <tt>rsync</tt> for example):  
Line 41: Line 43:
</pre>
</pre>


= Using the right key =
= Using the right key = <!--T:10-->
If you have multiple keys on your computer, you need to be careful to use the correct key. This is typically done by passing parameters to the command that you are using. Below are a few examples.  
If you have multiple keys on your computer, you need to be careful to use the correct key. This is typically done by passing parameters to the command that you are using. Below are a few examples.  


<!--T:11-->
With <tt>ssh</tt> or <tt>scp</tt>:
With <tt>ssh</tt> or <tt>scp</tt>:
{{Command|ssh -i .ssh/private_key_to_use ...}}
{{Command|ssh -i .ssh/private_key_to_use ...}}
{{Command|scp -i .ssh/private_key_to_use ...}}
{{Command|scp -i .ssh/private_key_to_use ...}}


<!--T:12-->
With <tt>rsync</tt>:  
With <tt>rsync</tt>:  
{{Command|rsync -e "ssh -i .ssh/private_key_to_use" ...}}
{{Command|rsync -e "ssh -i .ssh/private_key_to_use" ...}}


</translate>
</translate>
rsnt_translations
56,420

edits

Navigation menu