SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
Advanced use of SVN
  in the life-cycle of web oriented projects



Emiliano `AlberT` Gabrielli
 emiliano.gabrielli@deArchitettura.com
CIO & CTO @
Intro::why another SVN-related talk
• underline, one time again, the necessity of adopting versioning
  tools in every project
• discuss some undervalued security-related points:
   ∘ ACL granularity
   ∘ roles separation in the development team
   ∘ security in the data storage
   ∘ avoiding osmotic migration of configuration vulnerabilities from the
     devel/test environment into production
• point out how to use SVN with an enterprise oriented mind
   ∘ avoid OSS forking
   ∘ increase SW lifetime and maintainability
   ∘ automate daily quality related tasks




                             Emiliano Gabrielli,                            2
Everybody needs a RCS
A Revision Control System makes the life easier in a number of
situations:
• aims to standardize the work-flow of the developing team
• makes junior coders less fearful
• automates production of the project history documentation
• gives the team a powerful weapon against disasters
• aims to automate deploying, making releases, application
  versioning, etc
• makes it possible to have per-customer customized versions of
  the same project, without the headache of syncing updates,
  security patches and bug fix
• permits the inclusion of 3rd party OSS, without the needing of
  forking it
• makes our new features to OSS simply available for submission to
  the community

                           Emiliano Gabrielli,                       3
This presentation is on SVN
Using SVN is a drug. Once you know it you can't do anything
without it

 $ mkdir IPC_09
 $ cd IPC_09
 $ svnadmin create SVN_REPO
 $ mkdir presentation_init
 $ cp ../PHPCon09_SVN_advanced.odp presentation_init
 $ svn import ./presentation_init/ 
                   file:///home/albert/Desktop/IPC_09/SVN_REPO
 $ svn co file:///~/Desktop/IPC_09/SVN_REPO presentation
 $ rm -rf presentation_init



                              Emiliano Gabrielli,                4
SVN::ACL granularity
Using SVN in combination with apache mod_dav_svn and
mod_authz_svn makes it possible to have a fine-grain control on
the access of every single member of the development team to the
code repository

• don't give direct access (ssh, file-system, etc) to the repository
• implement apache-svn repository access
• configure users (username/password pairs)
• define groups of users based on their role
• deny access to every user/group on every repository
• grant a WL based access to each repository




                            Emiliano Gabrielli,                        5
SVN::role separation - mod_authz_svn syntax

[groups]
<group_name> = <user>[,<user>...]
...

[<repo_name>:<path in repository>]
@<group> = [rw|r]
<user>    = [rw|r]
*         = [rw|r]


* → Everyone
r → GET, PROPFIND, REPORT, OPTIONS
w → MKCOL, DELETE, PUT, PROPATCH, CHECKOUT, MERGE, MKACTIVITY

svn copy and svn move require at least w on destination


                          Emiliano Gabrielli,                   6
SVN::role separation - users, groups, repos and paths

• 2 types of rights
• 3 levels of access granting:
   ∘ Users and groups
   ∘ Repository
   ∘ Path in repository
• We can define non-system users in a htpasswd-like way:
   ∘ htdigest [-c] passwordfile realm username
   ∘ -c   flag creates a new file
• We can grant different access to different repositories
• For fine grain per directory r/w control we need mod_authz_svn




                              Emiliano Gabrielli,                  7
SVN::security in the data storage
By defining roles and ACL we can reach a good isolation of
security sensitive data in the repository tree:
• DB users/pwds
• Application level credentials (backend)
• Company accounts (SMS-GW uses/pwd)
• Credentials on the production server !

Creating a production branch we can easily achieve all the aboves
by the matter of a simple svn merge:
• Deny access to /branches/prod to everybody
• Grant rw permission to the production server webmaster
• Create /branches/prod as a copy of /trunk asap
• Granted people has to modify credentials only once!



                           Emiliano Gabrielli,                      8
SVN::avoiding configuration vulnerabilities dev-to-prod migration

Creating a production branch we also grant against the evil of
routine-bounded tasks typical od development environment:

• devel/test passwords are typically weak and .. shared
• It is possible to automate a forced check on commit time, to
  search for evil well known code
• A conscientious use of markers like “FIXME” may be a best
  practice
• Maybe useful in devel to intentionally have (and commit) some
  kind of tricky code, helper scripts, debugging and so on
• The aboves do not have to be in production !




                           Emiliano Gabrielli,                      9
SVN::aim to be “enterprise”

By the effort of developing one time forever some helper script it
is possible to dramatically simplify and automate the life-cycle of
a project, as the life of the project manager and the team

• SVN helps to avoid errors in the development work-flow
• Who helps us to avoid errors in the SVN management ?
• Branching and merging can be error prone
• Tagging has to be a coherent process through the entire
• Import a vendor drop has to be safe and simple
• New people in the team have to be easily integrated and skilled
• New developers have to be productive not creating disasters




                            Emiliano Gabrielli,                       10
SVN::aim to be “enterprise” (2)
  • avoid OSS forking:
     ∘ Branching and using the vendor drop import concept we can easily
       modify OSS to our needs, without having to fork the vendor
     ∘ svn_load_dirs.pl is a script available on svn web site that helps in
       the vendor drop import task
     ∘ Merging the vendor in our trunk we can get the new and maintain
       our customizations ... for free !
  • increase SW lifetime and maintainability:
     ∘ Forking makes impossible to re-sync with OSS updates
     ∘ One day our fork will be much less smart than its OSS counterpart
     ∘ That day we will have to make a choice: redo the job or freeze our
       features forever
  • Using a few helper scripts we can automate daily tasks:
     ∘ assure tags naming and comments are coherent
     ∘ Deploy its a matter of execute an interactive script
     ∘ Everything is proposed/defaulted and previewed
                             Emiliano Gabrielli,                              11
deprj-tools::a set of script that makes the difference
  • We have developed a set of well tested, solid and simply to use
    script that automates and makes interactive every step in the
    project life-cycle:
     ∘ deprj-svn_vendor_load.sh: a wrapper over svn_load_dirs.pl, but
       it knows our repository structure and automates importing and
       merging
     ∘ deprj-svn_prj_tag.sh: assure the current copy is a trunk
       checkout, tells the name of the last tag made, give the opportunity
       to list tags suggest 1_0_0 as default if no previous tag is present
     ∘ deprj-svn_prod_sync.sh: makes production branch if it does not
       exists, makes the merge from the trunk at the revision of the last
       tag, marks the current sync revision, gives the comment for
       commit
     ∘ deprj-common.sh: functions and variables sourced by every other
       script. This makes the code KISS and DRY




                             Emiliano Gabrielli,                            12
Questions ?




Emiliano `AlberT` Gabrielli
 emiliano.gabrielli@deArchitettura.com
CIO & CTO @
Advanced use of SVN
  in the life-cycle of web oriented projects



Emiliano `AlberT` Gabrielli
 emiliano.gabrielli@deArchitettura.com
CIO & CTO @

Mais conteúdo relacionado

Mais procurados

Docker and Selenoid - Make Autotests Great Again
Docker and Selenoid - Make Autotests Great Again Docker and Selenoid - Make Autotests Great Again
Docker and Selenoid - Make Autotests Great Again
COMAQA.BY
 
Continuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and DeployitContinuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and Deployit
XebiaLabs
 
Dev ops tools and was liberty profile
Dev ops tools and was liberty profileDev ops tools and was liberty profile
Dev ops tools and was liberty profile
sflynn073
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practices
Code Mastery
 
Continuous Integration (Jenkins/Hudson)
Continuous Integration (Jenkins/Hudson)Continuous Integration (Jenkins/Hudson)
Continuous Integration (Jenkins/Hudson)
Dennys Hsieh
 

Mais procurados (20)

Jenkins
JenkinsJenkins
Jenkins
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svn
 
Build Time Hacking
Build Time HackingBuild Time Hacking
Build Time Hacking
 
Continuous Delivery Using Jenkins
Continuous Delivery Using JenkinsContinuous Delivery Using Jenkins
Continuous Delivery Using Jenkins
 
Docker and Selenoid - Make Autotests Great Again
Docker and Selenoid - Make Autotests Great Again Docker and Selenoid - Make Autotests Great Again
Docker and Selenoid - Make Autotests Great Again
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
 
Continuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and DeployitContinuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and Deployit
 
Dev ops tools and was liberty profile
Dev ops tools and was liberty profileDev ops tools and was liberty profile
Dev ops tools and was liberty profile
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practices
 
Securing jenkins
Securing jenkinsSecuring jenkins
Securing jenkins
 
CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2
 
K8s Cluster Build
K8s Cluster BuildK8s Cluster Build
K8s Cluster Build
 
MohitBilakhia
MohitBilakhiaMohitBilakhia
MohitBilakhia
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introduction
 
Presentation 1 open source tools in continuous integration environment v1.0
Presentation 1   open source tools in continuous integration environment v1.0Presentation 1   open source tools in continuous integration environment v1.0
Presentation 1 open source tools in continuous integration environment v1.0
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
 
Continuous Integration (Jenkins/Hudson)
Continuous Integration (Jenkins/Hudson)Continuous Integration (Jenkins/Hudson)
Continuous Integration (Jenkins/Hudson)
 
Jenkins + Docker = Continuous Improvement
Jenkins + Docker = Continuous ImprovementJenkins + Docker = Continuous Improvement
Jenkins + Docker = Continuous Improvement
 
10 Reasons to Use an IDE for OpenVMS Development
10 Reasons to Use an IDE for OpenVMS Development10 Reasons to Use an IDE for OpenVMS Development
10 Reasons to Use an IDE for OpenVMS Development
 

Destaque

Subversion client
Subversion clientSubversion client
Subversion client
rchakra
 
高级英语全国2008年10月高等教育自学考试
高级英语全国2008年10月高等教育自学考试高级英语全国2008年10月高等教育自学考试
高级英语全国2008年10月高等教育自学考试
guest2bb065
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With Subversion
Samnang Chhun
 
SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practices
abackstrom
 
02.19.13 WANDisco SVN Training: Branching Options for Development
02.19.13 WANDisco SVN Training: Branching Options for Development02.19.13 WANDisco SVN Training: Branching Options for Development
02.19.13 WANDisco SVN Training: Branching Options for Development
WANdisco Plc
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overview
polarion
 
datastage training | datastage online training | datastage training videos | ...
datastage training | datastage online training | datastage training videos | ...datastage training | datastage online training | datastage training videos | ...
datastage training | datastage online training | datastage training videos | ...
Nancy Thomas
 

Destaque (20)

Subversion client
Subversion clientSubversion client
Subversion client
 
Subversion
SubversionSubversion
Subversion
 
高级英语全国2008年10月高等教育自学考试
高级英语全国2008年10月高等教育自学考试高级英语全国2008年10月高等教育自学考试
高级英语全国2008年10月高等教育自学考试
 
Intervalo técnico Git/SVN
Intervalo técnico Git/SVNIntervalo técnico Git/SVN
Intervalo técnico Git/SVN
 
Scala: Linguagem Promissora e Funcional
Scala: Linguagem Promissora e FuncionalScala: Linguagem Promissora e Funcional
Scala: Linguagem Promissora e Funcional
 
Silverlight Developer Introduction
Silverlight   Developer IntroductionSilverlight   Developer Introduction
Silverlight Developer Introduction
 
Tortoise svn 1.8.1-en
Tortoise svn 1.8.1-enTortoise svn 1.8.1-en
Tortoise svn 1.8.1-en
 
svn
svnsvn
svn
 
Subversion workshop
Subversion workshopSubversion workshop
Subversion workshop
 
Introduction to Subversion
Introduction to SubversionIntroduction to Subversion
Introduction to Subversion
 
Git para quem vem do SVN
Git para quem vem do SVNGit para quem vem do SVN
Git para quem vem do SVN
 
02.28.13 WANDisco SVN Training: Getting Info Out of SVN
02.28.13 WANDisco SVN Training: Getting Info Out of SVN02.28.13 WANDisco SVN Training: Getting Info Out of SVN
02.28.13 WANDisco SVN Training: Getting Info Out of SVN
 
Extending VuGen 11.5 with custom add-ins
Extending VuGen 11.5 with custom add-insExtending VuGen 11.5 with custom add-ins
Extending VuGen 11.5 with custom add-ins
 
Introduce to SVN
Introduce to SVNIntroduce to SVN
Introduce to SVN
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With Subversion
 
SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practices
 
02.19.13 WANDisco SVN Training: Branching Options for Development
02.19.13 WANDisco SVN Training: Branching Options for Development02.19.13 WANDisco SVN Training: Branching Options for Development
02.19.13 WANDisco SVN Training: Branching Options for Development
 
Git vs. SVN
Git vs. SVNGit vs. SVN
Git vs. SVN
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overview
 
datastage training | datastage online training | datastage training videos | ...
datastage training | datastage online training | datastage training videos | ...datastage training | datastage online training | datastage training videos | ...
datastage training | datastage online training | datastage training videos | ...
 

Semelhante a PHP Con09: SVN Advanced

SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
Ashraf Fouad
 

Semelhante a PHP Con09: SVN Advanced (20)

Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...
Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...
Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
The DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkitThe DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkit
 
The DevOps Paradigm
The DevOps ParadigmThe DevOps Paradigm
The DevOps Paradigm
 
Using Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityUsing Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure Security
 
DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017
 
Power of Azure Devops
Power of Azure DevopsPower of Azure Devops
Power of Azure Devops
 
Versioning for Developers
Versioning for DevelopersVersioning for Developers
Versioning for Developers
 
AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...
AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...
AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
InSpec at DevOps ATL Meetup January 22, 2020
InSpec at DevOps ATL Meetup January 22, 2020InSpec at DevOps ATL Meetup January 22, 2020
InSpec at DevOps ATL Meetup January 22, 2020
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
 
SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
 
Adding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpecAdding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpec
 
Jenkins pipeline as code
Jenkins pipeline as codeJenkins pipeline as code
Jenkins pipeline as code
 
Microservices and containers for the unitiated
Microservices and containers for the unitiatedMicroservices and containers for the unitiated
Microservices and containers for the unitiated
 
Achieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef AutomateAchieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef Automate
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline Security
 
Eclipse Che - A Revolutionary IDE for Distributed & Mainframe Development
Eclipse Che - A Revolutionary IDE for Distributed & Mainframe DevelopmentEclipse Che - A Revolutionary IDE for Distributed & Mainframe Development
Eclipse Che - A Revolutionary IDE for Distributed & Mainframe Development
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

PHP Con09: SVN Advanced

  • 1. Advanced use of SVN in the life-cycle of web oriented projects Emiliano `AlberT` Gabrielli emiliano.gabrielli@deArchitettura.com CIO & CTO @
  • 2. Intro::why another SVN-related talk • underline, one time again, the necessity of adopting versioning tools in every project • discuss some undervalued security-related points: ∘ ACL granularity ∘ roles separation in the development team ∘ security in the data storage ∘ avoiding osmotic migration of configuration vulnerabilities from the devel/test environment into production • point out how to use SVN with an enterprise oriented mind ∘ avoid OSS forking ∘ increase SW lifetime and maintainability ∘ automate daily quality related tasks Emiliano Gabrielli, 2
  • 3. Everybody needs a RCS A Revision Control System makes the life easier in a number of situations: • aims to standardize the work-flow of the developing team • makes junior coders less fearful • automates production of the project history documentation • gives the team a powerful weapon against disasters • aims to automate deploying, making releases, application versioning, etc • makes it possible to have per-customer customized versions of the same project, without the headache of syncing updates, security patches and bug fix • permits the inclusion of 3rd party OSS, without the needing of forking it • makes our new features to OSS simply available for submission to the community Emiliano Gabrielli, 3
  • 4. This presentation is on SVN Using SVN is a drug. Once you know it you can't do anything without it $ mkdir IPC_09 $ cd IPC_09 $ svnadmin create SVN_REPO $ mkdir presentation_init $ cp ../PHPCon09_SVN_advanced.odp presentation_init $ svn import ./presentation_init/ file:///home/albert/Desktop/IPC_09/SVN_REPO $ svn co file:///~/Desktop/IPC_09/SVN_REPO presentation $ rm -rf presentation_init Emiliano Gabrielli, 4
  • 5. SVN::ACL granularity Using SVN in combination with apache mod_dav_svn and mod_authz_svn makes it possible to have a fine-grain control on the access of every single member of the development team to the code repository • don't give direct access (ssh, file-system, etc) to the repository • implement apache-svn repository access • configure users (username/password pairs) • define groups of users based on their role • deny access to every user/group on every repository • grant a WL based access to each repository Emiliano Gabrielli, 5
  • 6. SVN::role separation - mod_authz_svn syntax [groups] <group_name> = <user>[,<user>...] ... [<repo_name>:<path in repository>] @<group> = [rw|r] <user> = [rw|r] * = [rw|r] * → Everyone r → GET, PROPFIND, REPORT, OPTIONS w → MKCOL, DELETE, PUT, PROPATCH, CHECKOUT, MERGE, MKACTIVITY svn copy and svn move require at least w on destination Emiliano Gabrielli, 6
  • 7. SVN::role separation - users, groups, repos and paths • 2 types of rights • 3 levels of access granting: ∘ Users and groups ∘ Repository ∘ Path in repository • We can define non-system users in a htpasswd-like way: ∘ htdigest [-c] passwordfile realm username ∘ -c flag creates a new file • We can grant different access to different repositories • For fine grain per directory r/w control we need mod_authz_svn Emiliano Gabrielli, 7
  • 8. SVN::security in the data storage By defining roles and ACL we can reach a good isolation of security sensitive data in the repository tree: • DB users/pwds • Application level credentials (backend) • Company accounts (SMS-GW uses/pwd) • Credentials on the production server ! Creating a production branch we can easily achieve all the aboves by the matter of a simple svn merge: • Deny access to /branches/prod to everybody • Grant rw permission to the production server webmaster • Create /branches/prod as a copy of /trunk asap • Granted people has to modify credentials only once! Emiliano Gabrielli, 8
  • 9. SVN::avoiding configuration vulnerabilities dev-to-prod migration Creating a production branch we also grant against the evil of routine-bounded tasks typical od development environment: • devel/test passwords are typically weak and .. shared • It is possible to automate a forced check on commit time, to search for evil well known code • A conscientious use of markers like “FIXME” may be a best practice • Maybe useful in devel to intentionally have (and commit) some kind of tricky code, helper scripts, debugging and so on • The aboves do not have to be in production ! Emiliano Gabrielli, 9
  • 10. SVN::aim to be “enterprise” By the effort of developing one time forever some helper script it is possible to dramatically simplify and automate the life-cycle of a project, as the life of the project manager and the team • SVN helps to avoid errors in the development work-flow • Who helps us to avoid errors in the SVN management ? • Branching and merging can be error prone • Tagging has to be a coherent process through the entire • Import a vendor drop has to be safe and simple • New people in the team have to be easily integrated and skilled • New developers have to be productive not creating disasters Emiliano Gabrielli, 10
  • 11. SVN::aim to be “enterprise” (2) • avoid OSS forking: ∘ Branching and using the vendor drop import concept we can easily modify OSS to our needs, without having to fork the vendor ∘ svn_load_dirs.pl is a script available on svn web site that helps in the vendor drop import task ∘ Merging the vendor in our trunk we can get the new and maintain our customizations ... for free ! • increase SW lifetime and maintainability: ∘ Forking makes impossible to re-sync with OSS updates ∘ One day our fork will be much less smart than its OSS counterpart ∘ That day we will have to make a choice: redo the job or freeze our features forever • Using a few helper scripts we can automate daily tasks: ∘ assure tags naming and comments are coherent ∘ Deploy its a matter of execute an interactive script ∘ Everything is proposed/defaulted and previewed Emiliano Gabrielli, 11
  • 12. deprj-tools::a set of script that makes the difference • We have developed a set of well tested, solid and simply to use script that automates and makes interactive every step in the project life-cycle: ∘ deprj-svn_vendor_load.sh: a wrapper over svn_load_dirs.pl, but it knows our repository structure and automates importing and merging ∘ deprj-svn_prj_tag.sh: assure the current copy is a trunk checkout, tells the name of the last tag made, give the opportunity to list tags suggest 1_0_0 as default if no previous tag is present ∘ deprj-svn_prod_sync.sh: makes production branch if it does not exists, makes the merge from the trunk at the revision of the last tag, marks the current sync revision, gives the comment for commit ∘ deprj-common.sh: functions and variables sourced by every other script. This makes the code KISS and DRY Emiliano Gabrielli, 12
  • 13. Questions ? Emiliano `AlberT` Gabrielli emiliano.gabrielli@deArchitettura.com CIO & CTO @
  • 14. Advanced use of SVN in the life-cycle of web oriented projects Emiliano `AlberT` Gabrielli emiliano.gabrielli@deArchitettura.com CIO & CTO @