Skip to content
Anil Chandran edited this page Nov 21, 2018 · 27 revisions

How to add new AWS Account to PacBot to Monitor ?

For adding a new account to PacBot, follow steps. After account added successfully, PacBot will start data collection from the respective account.

I see the compliance as 100% for all rules which probably won't be true. Is there anything missing?

You probably missing an index. As a short-term fix please create the below index.

PUT "exceptions": {
  "mappings": {
    "sticky_exceptions": {
      "properties": {
        "assetGroup": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "dataSource": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "exceptionName": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "exceptionReason": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "expiryDate": {
          "type": "date"
        },
        "targetTypes": {
          "properties": {
            "name": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "rules": {
              "properties": {
                "ruleId": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                },
                "ruleName": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

How can I add a new user ?

If you are looking to add a new DB user please follow the below steps.

  1. Insert user to oauth_user table
  insert into oauth_user(id,user_id,user_name,first_name,last_name,email,created_date,modified_date) values (<unique-id>,'<userid>','<name>','<first name>','<last name>','<email>',CURDATE(),CURDATE());
  1. Insert user credentials to oauth_user_credentials.

    You need to bcrypt the password.

    You could possibly use some online tool. For e.g https://www.browserling.com/tools/bcrypt

   insert into oauth_user_credentials (id, password, type) values('<unique-id in oauth_user>','<bcrypted password','db');
  1. Insert the role mapping to oauth_user_role_mapping

       Role ids supported
    
           1- Normal User
           703- Admin User
    
insert into oauth_user_role_mapping(userRoleId,userId,roleId,clientId,allocator,createdDate,modifiedDate) values 
(UUID(),'<userid>','<role_id>','22e14922-87d7-4ee4-a470-da0bb10d45d3','PacBotAdmin',CURDATE(),CURDATE());