Difference between revisions of "How to control access rights for LFC/SRM files"

From PDP/Grid Wiki
Jump to navigationJump to search
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
Storing files on the grid is one thing. Controlling access to  these files is a different matter. This page is the result of an ongoing investigation on how to control access rights for different storage systems (currently: dCache and DPM), as well as the way files are stored and accessed on the Local File Catalog (LFC).
+
Storing files on the grid is one thing. Controlling access to  these files is a different matter. These pages are the result of an ongoing investigation on how to control access rights for different storage systems (currently: dCache and DPM), as well as the way files are stored and accessed on the Local File Catalog (LFC).
  
= dCache =
+
'''SRM vs LFC'''
  
Before we start: it is assumed that you already have generated a valid VOMS proxy prior to attempting any of these commands. It is also assumed that you have access rights to the storage systems used below.  
+
Files which are stored on the grid are registered in at least one, but usually two places:
 +
* The back-end storage system. This is the place where the data actually resides. Most back-end storage systems can be accessed using the Storage Resource Manager (SRM) protocol.
 +
* The Local File Catalog: this catalog is intended to provide users with an easier-to-use Logical File Name (LFN) , plus it allows for the use of replica's across different back-end storage systems.
 +
The coupling between the back-end storage and the LFC is not very tight. It is possible to rename a file in the back-end storage system without the LFC knowing about it (resulting in the 'disappearance' of the file in the LFC). You can also delete a file in the LFC while keeping the file stored on the back-end storage system. In most cases this is called 'dark storage'.  
  
All of the sample output below was generated using a <tt>pvier</tt> proxy, unless noted otherwise.
+
Access rights between the back-end storage and the LFC are '''also not coupled'''  : this means you can add or revoke access rights to a particular file or directory in the LFC , but if you do not also modify the access rights in the back-end storage then the file is still accessible !! This can be especially dangerous if a malicious user does not know anything about your LFC entries but if he '''does''' know the Transport URL (TURL) for a file then he might still be able to copy the file from the back-end storage using a plain <tt>globus-url-copy</tt> command (for gsiftp TURLs).
  
== Finding out how storage is organized ==
+
A logical question that comes to mind is : '''Why''' are the back-end storage and the LFC not coupled?
  
To list the storage systems to which you have access use
+
The reason they are not coupled is due to the distributed nature of the grid. User A can copy a file to a back-end storage system, while user B registers it in the LFC. Also, the LFC might be part of one administrative domain (e.g. grid.sara.nl) whereas the back-end storage is part of another (e.g. nikhef.nl). In 98% of the cases this will not be a problem and (theoretically) it would be possible to automatically synchronize the access rights between the back-end storage and the LFC, but it's the remaining 2% which prevent this coupling from happening automagically.  
  lcg-infosites --vo <YOUR-VO> se
 
which for my proxies currently results in
 
Avail Space(Kb) Used Space(Kb)  Type  SEs
 
----------------------------------------------------------
 
12078          108            n.a    srm.grid.rug.nl
 
12078          108            n.a   srm.grid.rug.nl
 
730582644      681194097      n.a   gb-se-amc.amc.nl
 
8226695519985  23304480014    n.a    srm.grid.sara.nl
 
605355546      806421195      n.a    gb-se-nki.els.sara.nl
 
6575746866      20920246        n.a    carme.htc.biggrid.nl
 
152913518      115521938      n.a    se.grid.rug.nl
 
248345185      1166074827      n.a    gb-se-ams.els.sara.nl
 
355230761      1056545980      n.a    gb-se-uu.science.uu.nl
 
1266740857      145035883      n.a    gb-se-wur.els.sara.nl
 
337812899      1076607113      n.a    gb-se-kun.els.sara.nl
 
2195706454      3048365        n.a    tbn18.nikhef.nl
 
771834491      620488567      n.a   gb-se-lumc.lumc.nl
 
  
'''Note''' the current version of the <tt>lcg-infosites</tt> command does not use your grid proxy at all !
+
Before we start: it is assumed that you already have generated a valid VOMS proxy prior to attempting any of these commands. It is also assumed that you have access rights to the storage systems used below.  
 
 
You can then use the <tt>srmls</tt> command to figure out how the storage is organized:
 
$ srmls srm://srm.grid.sara.nl
 
  512 //
 
      [SNIP]
 
      4096 //pnfs/
 
      [SNIP]
 
 
 
This listing tells us that this storage system uses a PNFS file system, which means that we're talking to a dCache SRM. Subsequent <tt>srmls</tt> commands then give us:
 
 
 
$ srmls srm://srm.grid.sara.nl/pnfs/
 
  512 /pnfs//
 
      512 /pnfs//grid.sara.nl/
 
      [SNIP]
 
 
 
$ srmls srm://srm.grid.sara.nl/pnfs/grid.sara.nl
 
  512 /pnfs/grid.sara.nl/
 
      512 /pnfs/grid.sara.nl/disk/
 
      512 /pnfs/grid.sara.nl/tapetests/
 
      512 /pnfs/grid.sara.nl/data/
 
      512 /pnfs/grid.sara.nl/disktests/
 
 
 
$ srmls srm://srm.grid.sara.nl/pnfs/grid.sara.nl/data
 
  0 /pnfs/grid.sara.nl/data/
 
      [SNIP}
 
      512 /pnfs/grid.sara.nl/data/pvier/
 
      512 /pnfs/grid.sara.nl/data/vlemed/
 
 
 
Hey, we are at the VO level now. Here I've listed the two VOs which will be used throughout this page.
 
 
 
== Creating your own directory in SRM-space ==
 
 
 
Before we copy a file to the dCache SRM we first create our own directory. If we do not do this then SRM will
 
store the files in <tt>generated</tt> directories, over which we have no control.
 
 
 
srmmkdir srm://srm.grid.sara.nl/pnfs/grid.sara.nl/data/pvier/janjust/
 
 
 
The URL for this directory will be used throughout the rest of this page, hence we abbreviate it to
 
 
 
SRM=srm://srm.grid.sara.nl/pnfs/grid.sara.nl/data/pvier/janjust
 
 
 
== Copying and registering your file ==
 
 
 
lcg-cr ....
 
 
 
== Looking at the permissions ==
 
 
 
* SRM : srm-get-permissions
 
 
 
== Modifying the permissions ==
 
 
 
* SRM : srm-set-permissions
 
 
 
== Verifying access control ==
 
 
 
* SRM : srm-get-permissions
 
* Try to access the file as another user
 
 
 
= DPM =
 
 
 
== Creating your own directory in DPM-space ==
 
 
 
srmmkdir .... ??
 
dpns-mkdir
 
 
 
== Copying and registering your file ==
 
 
 
lcg-cr ....
 
 
 
== Looking at the permissions ==
 
 
 
* SRM : srm-get-permissions is broken
 
** dpns-getacl
 
 
 
== Modifying the permissions ==
 
 
 
* SRM : dpns-setacl
 
 
 
== Verifying access control ==
 
 
 
* SRM
 
* Try to access the file as another user
 
 
 
= LFC =
 
 
 
== Copying and registering your file ==
 
 
 
* lcg-cr .... with full path
 
* lcg-cr .... with generated path
 
 
 
== Looking at the permissions ==
 
 
 
* lfc-getacl
 
* lfc-la
 
* lfc-lg
 
* lfc-lr
 
* lfc-ls
 
* lcg-gt
 
 
 
== Modifying the permissions ==
 
  
* lfc-setacl
+
All of the sample output on these pages was generated using a GT2-style proxy for the Dutch VO <tt>pvier</tt>, unless noted otherwise.
  
== Verifying access control ==
+
* [[Access control for dCache storage elements]]
 +
* [[Access control for DPM storage elements]]
 +
* [[Access control for StoRM storage elements]] : '''Spoiler alert''': StoRM does not seem to support access control !!!
 +
* [[Access control for CASTOR storage elements]]
 +
* [[Access control for the LFC]]
  
* lfc-getacl
+
This investigation was initiated by T&uuml;nde B&aacute;lint, a research student at Nikhef, in cooperation with Jan Just Keijser.
* lfc-la
 
* lfc-lg
 
* lfc-lr
 
* lfc-ls
 
* Try to access the file as another user
 

Latest revision as of 14:43, 20 August 2009

Storing files on the grid is one thing. Controlling access to these files is a different matter. These pages are the result of an ongoing investigation on how to control access rights for different storage systems (currently: dCache and DPM), as well as the way files are stored and accessed on the Local File Catalog (LFC).

SRM vs LFC

Files which are stored on the grid are registered in at least one, but usually two places:

  • The back-end storage system. This is the place where the data actually resides. Most back-end storage systems can be accessed using the Storage Resource Manager (SRM) protocol.
  • The Local File Catalog: this catalog is intended to provide users with an easier-to-use Logical File Name (LFN) , plus it allows for the use of replica's across different back-end storage systems.

The coupling between the back-end storage and the LFC is not very tight. It is possible to rename a file in the back-end storage system without the LFC knowing about it (resulting in the 'disappearance' of the file in the LFC). You can also delete a file in the LFC while keeping the file stored on the back-end storage system. In most cases this is called 'dark storage'.

Access rights between the back-end storage and the LFC are also not coupled : this means you can add or revoke access rights to a particular file or directory in the LFC , but if you do not also modify the access rights in the back-end storage then the file is still accessible !! This can be especially dangerous if a malicious user does not know anything about your LFC entries but if he does know the Transport URL (TURL) for a file then he might still be able to copy the file from the back-end storage using a plain globus-url-copy command (for gsiftp TURLs).

A logical question that comes to mind is : Why are the back-end storage and the LFC not coupled?

The reason they are not coupled is due to the distributed nature of the grid. User A can copy a file to a back-end storage system, while user B registers it in the LFC. Also, the LFC might be part of one administrative domain (e.g. grid.sara.nl) whereas the back-end storage is part of another (e.g. nikhef.nl). In 98% of the cases this will not be a problem and (theoretically) it would be possible to automatically synchronize the access rights between the back-end storage and the LFC, but it's the remaining 2% which prevent this coupling from happening automagically.

Before we start: it is assumed that you already have generated a valid VOMS proxy prior to attempting any of these commands. It is also assumed that you have access rights to the storage systems used below.

All of the sample output on these pages was generated using a GT2-style proxy for the Dutch VO pvier, unless noted otherwise.

This investigation was initiated by Tünde Bálint, a research student at Nikhef, in cooperation with Jan Just Keijser.