コード例 #1
0
        /**
         * {@inheritDoc}
         */
        public override void addAttack(Attack attack) {
            Logger.Warn("Security attack " + attack.GetDetectionPoint().getId() + " triggered by user: " + attack.GetUser().getUsername());

            writeAttack(attack);

            //super.notifyListeners(attack);
            base.notifyListeners(attack);
        }
コード例 #2
0
	/**
	 * {@inheritDoc}
	 */
	//public override void addAttack(Attack attack) {
    public void addAttack(Attack attack) {
        /// <exception cref="NotAuthorizedException"></exception>
		if (detectionSystemId == null) {
			detectionSystemId = attack.GetDetectionSystemId();
		}
		
		appSensorServer.getAttackStore().addAttack(attack);
	}
コード例 #3
0
	/**
	 * {@inheritDoc}
	 */
	//public override void onAdd(Attack attack) {
    public void onAdd(Attack attack) {
		notifyWebSocket("attack", attack);
		
		Logger.Info("Reporter observed attack by user [" + attack.GetUser().getUsername() + "]");
	}
コード例 #4
0
 protected void writeAttack(Attack attack) {
     //string json = gson.toJson(attack);
     string json = attack.toString();
     try {
         //Files.write(getPath(), Arrays.asList(json), StandardCharsets.UTF_8, StandardOpenOption.APPEND, StandardOpenOption.WRITE);
         File.WriteAllText(getPath().ToString(), json, System.Text.Encoding.UTF8);
     } catch(IOException e) {
         Logger.Error("Error occurred loading writing event file to path: " + getPath(), e);
     }
 }
コード例 #5
0
	/**
	 * {@inheritDoc}
	 */
	//public override void addAttack(Attack attack) {
    public void addAttack(Attack attack) {
		requestHandler.addAttack(attack);
	}
コード例 #6
0
 /**
 * Add an {@link Attack}
 * @param attack {@link Attack} to Add
 */
 public void addAttack(Attack attack) {
 }
コード例 #7
0
	    /**
	     * {@inheritDoc}
	     */
	    //@Override
	    public void addAttack(Attack attack) {
		    //make request
	    }
コード例 #8
0
 public abstract void analyze(Attack attack);
コード例 #9
0
 public void onAdd(Attack attack) {
     analyze(attack);
 }
コード例 #10
0
	/**
	 * Add an Attack
	 * @param attack Attack to Add
	 */
    /// <exception cref="NotAuthorizedException"></exception>
	//public void addAttack(Attack attack);
    void addAttack(Attack attack) {
    }
コード例 #11
0
	/**
	 * {@inheritDoc}
	 */
    //public override void onAdd(Attack attack) {
    public void onAdd(Attack attack) {
		Logger.Info("Reporter observed attack by user [" + attack.GetUser().getUsername() + "]");
	}
コード例 #12
0
	    /**
	     * Notify each {@link AttackListener} of the specified {@link Attack}
	     * 
	     * @param response the {@link Attack} to notify each {@link AttackListener} about
	     */
	    public void notifyListeners(Attack attack) {
		    foreach (AttackListener listener in listeners) {
			    listener.onAdd(attack);
		    }
	    }
コード例 #13
0
        //private static System.Collections.Concurrent.Partitioner<AttackListener> listeners = new ();
	
	    /// <summary>
	    /// Add an attack to the AttackStore
	    /// </summary>
	    /// <param name="attack">the <seealso cref="org.owasp.appsensor.Attack"/> object to Add to the AttackStore</param>
        public abstract void addAttack(Attack attack);