↓ Skip to main content

Identity and access management

Context
#

Learned in this study
#

Things to explore
#

Overview
#

AWS
#

AWS has the concept of groups, users, roles and policies.

Groups
#

A group is a list of users to which are assigned policies (permissions).

A useful feature they also provide is the Access Advisor, which allows administrators to observe when certain policies are being used and by which users.

To keep things simple, groups cannot be nested into other groups.

Users
#

Users represent an entity that has access to the AWS platform. They may access AWS either programmatically and/or through the console to administer the account.

During the using creation process, the creator has the ability to assign the user to a group, copy permissions from an existing user or attach policies to the user.

Upon creation of a user with programmatic access, the user is generally given an access key with its corresponding secret.

Roles
#

Roles are very similar to groups conceptually, but instead of being “persistent”, they are temporary. While you will generally assign one or many groups to a user, roles are not assigned to a user (or vice-versa, a user is not assigned one or many roles) but given based on certain criteria. A user takes a given role and only receives this role’s policies/permissions until he returns to his own identity.

Policies
#

A policy is a set of rules that determines the permissions given to a user, group or role. It has a name, description and a policy document, which describes the permissions.

The policy document is a JSON formatted object which contains a version and a list of statements. Each statement has an effect (Allow/Deny), a list of actions and a list of resources to which it applies.

You can learn more about AWS policies evaluation logic. Their IAM Policy Reference might also prove useful in understanding the various bits that compose the policy document.

Actions
#

Within AWS, each service has a unique lowercase identifier1. Within each of these services, a list of actions exists, which can be granted (or denied) to an identity. Examples of actions are:

  • *: Allowed to use all actions under all services
  • s3:*: Allowed to use all actions under the s3 service
  • s3:GetObject: Allowed to use the GetObject action under the s3 service

Resources
#

Resources represent entities within their given service. For example, arn:aws:s3:::some-bucket/* represents the content under the some-bucket bucket in the s3 service.

Format : arn:$partition:$service:$region:$account-id:$resource2

See also
#

References
#


How to tackle long term problems as if they were short term ones

  • It’s easy to do things such as checking your email or going on reddit as they are very short term tasks (can be started and completed in less than 10s).
  • Long term tasks on the other hand requires you to save and restore your mental state every time you transition to and from them.

Prioritizing

Steps
#

  • Build a list of task/items List everything that you want to get out of your head. The goal here is to make explicit as much as possible.
  • Deconstruct tasks into their pre-requisites and follow-up tasks There are a couple of important things to consider when one wants to prioritize their task list. One is that even if a task is at the top of the list, it might not be possible to do it until its dependencies are fulfilled. This in turn means that all dependencies will have a superior priority to this task automatically. However, it frequently happens that what we consider dependencies can in fact be delayed or temporarily replaced by another solution which takes less time to implement or costs less (or for whatever other reason can replace the original dependency).
  • Split tasks into 2 groups (and repeat this process) The idea here is to quickly filter out as many tasks as possible. As you may have noticed, I have not specified the filtering predicate. It is up to you to filter out your tasks such that you will have the least amount to filter at once. Examples of predicates you could use are “will/will not do”, “want/do not want”, “need/do not need”, “like/do not like” and so on.
  • Prioritize the tasks that will have to be done After a certain number of iterations of the previous step, you should arrive at a point where the items you have all need to be done, but you do not know in which order you have to do them (or want to do them).

Methods
#

4 Quadrants Method
#

This method, also known as the Eisenhower Matrix, involves categorizing tasks into four groups: Urgent/Important, Not Urgent/Important, Urgent/Not Important, and Not Urgent/Not Important. By sorting tasks this way, you can focus on what truly matters and avoid spending time on less critical activities.

Analytic Hierarchy Process
#

The Analytic Hierarchy Process (AHP) is a structured technique for organizing and analyzing complex decisions. It involves breaking down a problem into its components, comparing them pairwise, and assigning weights to determine the relative priority of each task.

Binary Search Tree
#

Using a binary search tree for prioritization means inserting tasks based on their priority value, allowing for efficient retrieval and reordering. This approach is useful for dynamically managing and updating a list of tasks as priorities change.

Planning Game
#

The Planning Game is a collaborative method often used in agile development, where stakeholders and team members estimate and prioritize tasks together. It encourages discussion, negotiation, and consensus to determine which tasks should be tackled first.

100-Point Method
#

In the 100-Point Method, each participant is given 100 points to distribute among a list of tasks or requirements according to their perceived importance. The tasks with the highest total points are prioritized, reflecting the collective preferences of the group.

Prioritizing reading
#

  • What you feel like reading
  • Reading dependencies
  • ROI evaluation

References
#

  • Karlsson, Joachim, Claes Wohlin, and Björn Regnell. “An evaluation of methods for prioritizing software requirements.” Information and Software Technology 39.14 (1998): 939-947.
  • Karlsson, Joachim, Stefan Olsson, and Kevin Ryan. “Improved practical support for large-scale requirements prioritising.” Requirements Engineering 2.1 (1997): 51-60.
  • Ahl, Viggo. “An experimental comparison of five prioritization methods: investigating ease of use, accuracy and scalability.” (2005).
  • Gill, Nasib Singh. “A Comparison among Various Techniques to Prioritize the Requirements.” International Journal of Computer Science and Management Studies (IJCSMS) www. ijcsms. com 1.12: 601-607.
  • http://www.gwern.net/Resorter

Buying a microscope

USB microscope
#

To consider
#

  • Max magnification
  • Lighting
  • Megapixels

Models
#

Compound microscope
#

  • Max magnification
  • Included digital camera
  • Megapixels
  • Comes with prepared slides

Models
#

References
#


Business model

Context
#

Learned in this study
#

Things to explore
#

Overview
#

Cartalyst
#

Models
#

Subscription based
#

  • Some development must be done in order to protect the software against forbidden use (no subscription)
  • May require a “call-to-home” (Internet connection) to verify the subscription is still valid
    • Might be easily countered by firewalling the application
      • We may allow it to go unchecked for 1-X days until we tell the user to connect, but that is bad user experience

Examples
#

On demand
#

  • Similar to subscription based, but on a per use basis

Examples
#

Open source
#

  • Code is freely available
    • Makes it more difficult to live on producing the software

Support based
#

  • ($X*0.2)/user/year in support fees
  • Fee per request

Traditional - Major version and upgrades
#

  • X$/user (one time fee)
  • ($X*0.2)/user/year in support fees

Software as a service
#

  • Tools are never shared with the outside world

Consultancy
#

  • Develop tools to use on a per-project basis, where clients spent 5k$+ on a single pass
  • Tools are never shared with the outside world

See also
#

References
#


Licensing CLI

Context
#

Learned in this study
#

Things to explore
#

Overview
#

  • Encapsulate the application within a .phar
  • Use obfuscation (can only obfuscate variables inside function/methods as anything else must remain with the same name in order to allow for dynamically called methods (or simply do not support such code))

Requirements
#

  • Must not make it easy to extract the original source code
  • Must checksum itself for modification
  • Should prevent usage by sharing a single license (TBD?)
  • Should not be possible to reuse a trial forever in a VM

Issues
#

  • Relying on opcode (to act as a binary) probably implies you are dependent on the php version used. Furthermore, it also means that the extension must be available and enabled for the code to work
  • Given the current implementation of opcache, the cache cannot be reused on other machines as it contains the system ID as part of an opcache file header

PHP OPCache
#

Header #

  • OPCACHE

  • System ID

  • Timestamp

  • Checksum

-> zend_accel_load_script (persistent_script, from_memory)

Obfuscation
#

  • Replace classes methods with (generated) traits that contain one or many of the classes method
  • Compression/optimization by creating variables

Issues
#

  • Even with obfuscation, PSR0/4 based code is too easy to distinguish (no reason to obfuscate libraries)

Ideas
#

  • Find some way to transform the original source such that it is in symbiosis with a client identifier (and thus cannot be removed)

Packaging
#

  • Replace variables within functions with obfuscated names
  • Concatenate all files into a single file (or bundle of files)
    • Pre-process require/include, or do not allow their use (as the files will not be available)
  • Randomize file order
  • Scramble method order
  • Inject junk code
    • Insert junk code with encrypted user identification
  • Generate a differently scrambled version per download/user

See also
#

References
#

Obfuscation
#


Obfuscator

Context
#

Learned in this study
#

Things to explore
#

Overview
#

  • Encapsulate the application within a .phar
  • Use obfuscation (can only obfuscate variables inside function/methods as anything else must remain with the same name in order to allow for dynamically called methods (or simply do not support such code))

Requirements
#

  • Must not make it easy to extract the original source code
  • Must checksum itself for modification
  • Should prevent usage by sharing a single license (TBD?)
  • Should not be possible to reuse a trial forever in a VM

Issues
#

  • Relying on opcode (to act as a binary) probably implies you are dependent on the php version used. Furthermore, it also means that the extension must be available and enabled for the code to work
  • Given the current implementation of opcache, the cache cannot be reused on other machines as it contains the system ID as part of an opcache file header

PHP OPCache
#

Header #

  • OPCACHE

  • System ID

  • Timestamp

  • Checksum

-> zend_accel_load_script (persistent_script, from_memory)

Obfuscation
#

  • Replace classes methods with (generated) traits that contain one or many of the classes method
  • Compression/optimization by creating variables

Issues
#

  • Even with obfuscation, PSR0/4 based code is too easy to distinguish (no reason to obfuscate libraries)

Ideas
#

  • Find some way to transform the original source such that it is in symbiose with a client identifier (and thus cannot be removed)
  • Obfuscate php built-in functions
  • Zend Host ID limited deployment: It appears that Zend Guard allows the software to be limited to run on only specific “Zend Host” (what are those?)
    • Zend Guard Loader is a custom extension? for PHP which requires a licence_path to work

Packaging
#

  • Replace variables within functions with obfuscated names
  • Concatenate all files into a single file (or bundle of files)
    • Pre-process require/include, or do not allow their use (as the files will not be available)
  • Randomize file order
  • Scramble method order
  • Inject junk code
    • Insert junk code with encrypted user identification
  • Generate a differently scrambled version per download/user

See also
#

References
#


Business

  • Identified a problem
  • Determine if it is of importance (metrics)
  • Explain why your solution is better than existing ones
  • Define a clear pricing model
  • Define how your product will be marketed
  • Define how the product will scale from personal to large corporate use

Evaluate business opportunities
#

  • Determine sale pricing
  • Evaluate various sale models
    • Packages
    • Monthly
    • Per action/item/amount
  • Determine various cash flows
    • Money paid to employees/self
    • Money paid for services required by the product
  • Evaluate tasks that have to be done globally and per client/project (if any)
  • Evaluate anything that has to be paid for every client/project and once/globally
  • Determine all factors that may vary
    • Number of customers
    • Number of days/months/years
    • Disk space usage, bandwidth usage, computer usage

Unsorted
#

  • Track users requests
  • Track users feedback

Automated refactoring

Context
#

Learned in this study
#

Things to explore
#

Overview
#

  • Component extraction (find all dependencies and attempt to create a self-contained library)
  • Convert function-based code into class-based code (static calls)
    • Copy all functions in a file into a new class where each function is static
    • Find all calls to the initial functions and replace them with calls to the class
    • Verify that all entry points load the autoloader (how to check that? search for the autoload.php string and require/include calls?)
  • Template/logic separation
  • Extraction of functions into a separate file
  • Extraction and replacement of inline style
  • Extraction of string resources
  • Extraction of inline JS
  • Extraction of inline CSS
  • Conversion of raw view logic to template logic
  • Removal of inline PHP code in js code
  • Convert raw SQL into builder queries
  • Move queries in controller into a service/repository
  • Convert <? to <?php
  • Convert echo calls to string concat + return
  • Update outdated phpdoc
  • Improve typing (parameters and return)

Difficulties of code refactoring
#

  • Lot of code is SQL queries

Refactoring to MVC
#

See also
#

References
#


Javascript datastores

I am currently looking into javascript based libraries that will allow me to do in-browser queries, similar to how a server-side application would query a NoSQL database.

In order to pick the most appropriate database for my project, I first search for available solutions online. Then, I build a comparison table like the one below in order to determine the most popular database and its current health.

Repository Watch Stars Forks Last commit Open issues Open PR
pouchdb/pouchdb 245 5730 630 2016-02-12T17:23:21Z 128 8
google/lovefield 173 4143 195 2016-02-11T05:59:09Z 17 1
louischatriot/nedb 167 3680 237 2016-02-11T11:23:44Z 19 8
typicode/lowdb 87 2833 96 2016-02-09T21:16:31Z 9 3
techfort/LokiJS 102 1800 167 2016-02-08T19:18:40Z 64 0
coresmart/persistencejs 89 1586 226 2015-09-08T18:47:06Z 66 14
typicaljoe/taffydb 100 1309 215 2016-01-07T22:21:06Z 57 16
agershun/alasql 60 927 107 2016-02-09T15:35:07Z 250 0
Irrelon/ForerunnerDB 25 439 33 2016-02-12T16:20:29Z 17 0